Skip to content

Commit 33a6013

Browse files
committed
battle menu tests
1 parent 34f1ddd commit 33a6013

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

SerialPrograms/Source/Tests/PokemonFRLG_Tests.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,12 @@ int test_pokemonFRLG_AdvanceBattleDialogDetector(const ImageViewRGB32& image, bo
5959
return 0;
6060
}
6161

62+
int test_pokemonFRLG_BattleMenuDetector(const ImageViewRGB32& image, bool target){
63+
auto overlay = DummyVideoOverlay();
64+
BattleMenuDetector detector(COLOR_RED);
65+
bool result = detector.detect(image);
66+
TEST_RESULT_EQUAL(result, target);
67+
return 0;
68+
}
69+
6270
}

SerialPrograms/Source/Tests/PokemonFRLG_Tests.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ int test_pokemonFRLG_SelectionDialogDetector(const ImageViewRGB32& image, bool t
2525

2626
int test_pokemonFRLG_AdvanceBattleDialogDetector(const ImageViewRGB32& image, bool target);
2727

28+
int test_pokemonFRLG_BattleMenuDetector(const ImageViewRGB32& image, bool target);
29+
2830
}
2931

3032
#endif

SerialPrograms/Source/Tests/TestMap.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ const std::map<std::string, TestFunction> TEST_MAP = {
313313
{"PokemonFRLG_ShinySymbolDetector", std::bind(image_bool_detector_helper, test_pokemonFRLG_ShinySymbolDetector, _1)},
314314
{"PokemonFRLG_SelectionDialogDetector", std::bind(image_bool_detector_helper, test_pokemonFRLG_SelectionDialogDetector, _1)},
315315
{"PokemonFRLG_AdvanceBattleDialogDetector", std::bind(image_bool_detector_helper, test_pokemonFRLG_AdvanceBattleDialogDetector, _1)},
316+
{"PokemonFRLG_BattleMenuDetector", std::bind(image_bool_detector_helper, test_pokemonFRLG_BattleMenuDetector, _1)},
316317
};
317318

318319
TestFunction find_test_function(const std::string& test_space, const std::string& test_name){

0 commit comments

Comments
 (0)