Don't enable Run CPU Tests without the presence of g_Config.memCardDirectory/pspautotests/tests. Restore the previous PSP_CoreParameter().pixelWidth & PSP_CoreParameter().pixelHeight before exiting RunTests.

This commit is contained in:
The Dax committed 2013-10-12 16:01:22 -04:00
1 parent 82c56dccff
commit 4f98e1de1e
2 files changed
+12 -2

No files matched your search

+6 -1
View File
@@ -487,7 +487,12 @@ void DeveloperToolsScreen::CreateViews() {
list->Add(new ItemHeader(s->T("General")));
list->Add(new Choice(de->T("System Information")))->OnClick.Handle(this, &DeveloperToolsScreen::OnSysInfo);
list->Add(new CheckBox(&g_Config.bShowDeveloperMenu, de->T("Show Developer Menu")));
list->Add(new Choice(de->T("Run CPU Tests")))->OnClick.Handle(this, &DeveloperToolsScreen::OnRunCPUTests);
Choice *cpuTests = new Choice(de->T("Run CPU Tests"));
list->Add(cpuTests)->OnClick.Handle(this, &DeveloperToolsScreen::OnRunCPUTests);
if (!File::Exists(g_Config.memCardDirectory + "pspautotests/tests/"))
cpuTests->SetEnabled(false);
list->Add(new CheckBox(&enableLogging_, de->T("Enable Logging")))->OnClick.Handle(this, &DeveloperToolsScreen::OnLoggingChanged);
list->Add(new Choice(de->T("Logging Channels")))->OnClick.Handle(this, &DeveloperToolsScreen::OnLogConfig);
list->Add(new ItemHeader(de->T("Language")));
+6 -1
View File
@@ -92,6 +92,8 @@ void RunTests()
output = "";
if (!PSP_Init(coreParam, &error_string)) {
ELOG("Failed to init unittest %s : %s", testsToRun[i], error_string.c_str());
PSP_CoreParameter().pixelWidth = pixel_xres;
PSP_CoreParameter().pixelHeight = pixel_yres;
return;
}
@@ -114,6 +116,8 @@ void RunTests()
std::ifstream expected(expectedFile.c_str(), std::ios_base::in);
if (!expected) {
ELOG("Error opening expectedFile %s", expectedFile.c_str());
PSP_CoreParameter().pixelWidth = pixel_xres;
PSP_CoreParameter().pixelHeight = pixel_yres;
return;
}
@@ -146,6 +150,7 @@ void RunTests()
}
glstate.Restore();
glstate.viewport.set(0,0,pixel_xres,pixel_yres);
PSP_CoreParameter().pixelWidth = pixel_xres;
PSP_CoreParameter().pixelHeight = pixel_yres;
g_Config.sReportHost = savedReportHost;
}