void COsmo4AppUi::SetInfo(const char *info) { if (view_mode) return; if (info) { char szTitle[200]; sprintf(szTitle, "%s\n%s", info, m_title ? m_title : "Osmo4"); SetTitleInfo(szTitle); } else { SetTitleInfo(m_title); } }
void COsmo4AppUi::SetTitle(const char *title, int store_it) { if (store_it) { if (m_title) gf_free(m_title); m_title = NULL; if (title) m_title = gf_strdup(title); } SetTitleInfo(title ? title : m_title); }
int HackishManualTestExecutor() { CCLOG("%s", "HackishManualTestExecutor"); // Load the testTitleData ifstream titleInput; titleInput.open(TEST_TITLE_DATA_LOC, ios::binary | ios::in); if (titleInput) { int begin = titleInput.tellg(); titleInput.seekg(0, ios::end); int end = titleInput.tellg(); char* titleData = new char[end - begin]; titleInput.seekg(0, ios::beg); titleInput.read(titleData, end - begin); titleData[end - begin] = '\0'; Document testInputs; testInputs.Parse<0>(titleData); SetTitleInfo(testInputs); titleInput.close(); } else if (!HackSetTitleInfo()) // Try to load the test data saved directly in the APK { return -1; // Can't run tests because the setup failed } testsRun = testsPassed = testsFailed = 0; // Not sure if it's possible to do this part more dynamically in C++ ReportTestOutput(&InvalidLogin, "InvalidLogin"); ReportTestOutput(&LoginOrRegister, "LoginOrRegister"); ReportTestOutput(&LoginWithAdvertisingId, "LoginWithAdvertisingId"); ReportTestOutput(&UserDataApi, "UserDataApi"); ReportTestOutput(&UserStatisticsApi, "UserStatisticsApi"); ReportTestOutput(&UserCharacter, "UserCharacter"); ReportTestOutput(&LeaderBoard, "LeaderBoard"); ReportTestOutput(&AccountInfo, "AccountInfo"); ReportTestOutput(&CloudScript, "CloudScript"); return testsFailed > 0 ? 1 : 0; // Return code for the program itself }