Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,17 @@ class Test_AdvanceWhiteDialogDetector : public UnitTest{

Test_AdvanceWhiteDialogDetector(
const std::string& image,
bool expected
bool expected,
GameSettings::Device device = GameSettings::Device::switch_1_2
)
: UnitTest("PokemonFRLG::AdvanceWhiteDialogDetector - " + image)
, m_image(UNIT_TEST_RESOURCE_PATH() + image)
, m_expected(expected)
, m_device(device)
{}

virtual UnitTestResult run(Logger& logger, CancellableScope& scope) const override{
GameSettings::instance().DEVICE.set(m_device);
AdvanceWhiteDialogDetector detector(COLOR_RED);
ImageRGB32 image(m_image);
return detector.detect(image) == m_expected;
Expand All @@ -148,6 +151,7 @@ class Test_AdvanceWhiteDialogDetector : public UnitTest{
private:
std::string m_image;
bool m_expected;
GameSettings::Device m_device;
};

void add_tests_AdvanceWhiteDialogDetector(UnitTestDatabase& database){
Expand All @@ -168,14 +172,17 @@ class Test_SelectionDialogDetector : public UnitTest{

Test_SelectionDialogDetector(
const std::string& image,
bool expected
bool expected,
GameSettings::Device device = GameSettings::Device::switch_1_2
)
: UnitTest("PokemonFRLG::SelectionDialogDetector - " + image)
, m_image(UNIT_TEST_RESOURCE_PATH() + image)
, m_expected(expected)
, m_device(device)
{}

virtual UnitTestResult run(Logger& logger, CancellableScope& scope) const override{
GameSettings::instance().DEVICE.set(m_device);
SelectionDialogDetector detector(COLOR_RED);
ImageRGB32 image(m_image);
return detector.detect(image) == m_expected;
Expand All @@ -184,6 +191,7 @@ class Test_SelectionDialogDetector : public UnitTest{
private:
std::string m_image;
bool m_expected;
GameSettings::Device m_device;
};

void add_tests_SelectionDialogDetector(UnitTestDatabase& database){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,17 @@ class Test_ShinySymbolDetector : public UnitTest{

Test_ShinySymbolDetector(
const std::string& image,
bool expected
bool expected,
GameSettings::Device device = GameSettings::Device::switch_1_2
)
: UnitTest("PokemonHome::ShinySymbolDetector - " + image)
: UnitTest("PokemonFRLG::ShinySymbolDetector - " + image)
, m_image(UNIT_TEST_RESOURCE_PATH() + image)
, m_expected(expected)
, m_device(device)
{}

virtual UnitTestResult run(Logger& logger, CancellableScope& scope) const override{
GameSettings::instance().DEVICE.set(m_device);
ShinySymbolDetector detector(COLOR_RED);
ImageRGB32 image(m_image);
return detector.read(logger, image) == m_expected;
Expand All @@ -81,12 +84,14 @@ class Test_ShinySymbolDetector : public UnitTest{
private:
std::string m_image;
bool m_expected;
GameSettings::Device m_device;
};

void add_tests_ShinySymbolDetector(UnitTestDatabase& database){
database.add<Test_ShinySymbolDetector>("PokemonFRLG/ShinySymbolDetector/Char_False.png", false);
database.add<Test_ShinySymbolDetector>("PokemonFRLG/ShinySymbolDetector/Karp-coloredited_True.png", true);
database.add<Test_ShinySymbolDetector>("PokemonFRLG/ShinySymbolDetector/Karp-snotyak_True.png", true);
database.add<Test_ShinySymbolDetector>("PokemonFRLG/ShinySymbolDetector/Carerpie-Emulator-True.png", true, GameSettings::Device::dev_test);
}

}
Expand Down
2 changes: 1 addition & 1 deletion SerialPrograms/Source/PokemonFRLG/PokemonFRLG_Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ GameSettings::GameSettings()
"Refer to the documentation for specific setups.",
{
{Device::switch_1_2, "switch_1_2", "Nintendo Switch 1 and 2"},
//{Device::dev_test, "dev_test", "dev test rg35xx"},
{Device::dev_test, "dev_test", "dev test rg35xx", false},
//{Device::custom, "custom", "Custom"},
},
LockMode::LOCK_WHILE_RUNNING,
Expand Down