diff options
Diffstat (limited to 'indra/newview/tests')
-rw-r--r-- | indra/newview/tests/lllogininstance_test.cpp | 144 | ||||
-rw-r--r-- | indra/newview/tests/llversioninfo_test.cpp | 6 | ||||
-rw-r--r-- | indra/newview/tests/llviewerassetstats_test.cpp | 26 |
3 files changed, 33 insertions, 143 deletions
diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index b603157ca7..3b7ec48d61 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -31,6 +31,9 @@ #include "../llviewernetwork.h" #include "../lllogininstance.h" + // Needed for Auth Test + #include "../llhasheduniqueid.h" + // STL headers // std headers // external library headers @@ -188,35 +191,6 @@ void LLUIColorTable::saveUserSettings(void)const {} const std::string &LLVersionInfo::getVersion() { return VIEWERLOGIN_VERSION; } const std::string &LLVersionInfo::getChannel() { return VIEWERLOGIN_CHANNEL; } -//----------------------------------------------------------------------------- -#include "../llappviewer.h" -void LLAppViewer::forceQuit(void) {} -LLAppViewer * LLAppViewer::sInstance = 0; - -//----------------------------------------------------------------------------- -#include "llupdaterservice.h" - -std::string const & LLUpdaterService::pumpName(void) -{ - static std::string wakka = "wakka wakka wakka"; - return wakka; -} -bool LLUpdaterService::updateReadyToInstall(void) { return false; } -void LLUpdaterService::initialize(const std::string& channel, - const std::string& version, - const std::string& platform, - const std::string& platform_version, - const unsigned char uniqueid[MD5HEX_STR_SIZE], - const bool& willing_to_test - ) {} - -void LLUpdaterService::setCheckPeriod(unsigned int seconds) {} -void LLUpdaterService::startChecking(bool install_if_ready) {} -void LLUpdaterService::stopChecking() {} -bool LLUpdaterService::isChecking() { return false; } -LLUpdaterService::eUpdaterState LLUpdaterService::getState() { return INITIAL; } -std::string LLUpdaterService::updatedVersion() { return ""; } - bool llHashedUniqueID(unsigned char* id) { memcpy( id, "66666666666666666666666666666666", MD5HEX_STR_SIZE ); @@ -224,6 +198,11 @@ bool llHashedUniqueID(unsigned char* id) } //----------------------------------------------------------------------------- +#include "../llappviewer.h" +void LLAppViewer::forceQuit(void) {} +LLAppViewer * LLAppViewer::sInstance = 0; + +//----------------------------------------------------------------------------- #include "llnotifications.h" #include "llfloaterreg.h" static std::string gTOSType; @@ -339,7 +318,6 @@ namespace tut gSavedSettings.declareBOOL("NoInventoryLibrary", FALSE, "", LLControlVariable::PERSIST_NO); gSavedSettings.declareBOOL("ConnectAsGod", FALSE, "", LLControlVariable::PERSIST_NO); gSavedSettings.declareBOOL("UseDebugMenus", FALSE, "", LLControlVariable::PERSIST_NO); - gSavedSettings.declareBOOL("ForceMandatoryUpdate", FALSE, "", LLControlVariable::PERSIST_NO); gSavedSettings.declareString("ClientSettingsFile", "test_settings.xml", "", LLControlVariable::PERSIST_NO); gSavedSettings.declareString("NextLoginLocation", "", "", LLControlVariable::PERSIST_NO); gSavedSettings.declareBOOL("LoginLastLocation", FALSE, "", LLControlVariable::PERSIST_NO); @@ -477,110 +455,4 @@ namespace tut logininstance->connect(test_uri, agentCredential); ensure_equals("Default for agree to tos", gLoginCreds["params"]["read_critical"].asBoolean(), false); } - - template<> template<> - void lllogininstance_object::test<3>() - { - set_test_name("Test Mandatory Update User Accepts"); - - // Part 1 - Mandatory Update, with User accepts response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "update"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - - notifications.sendYesResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<4>() - { - set_test_name("Test Mandatory Update User Decline"); - - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "update"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendNoResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<6>() - { - set_test_name("Test Optional Update User Accept"); - - // Part 3 - Mandatory Update, with bogus response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "optional"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendYesResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<7>() - { - set_test_name("Test Optional Update User Denies"); - - // Part 3 - Mandatory Update, with bogus response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "optional"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendNoResponse(); - - // User skips, should be reconnecting. - ensure_equals("reconnect uri", gLoginURI, VIEWERLOGIN_URI); - ensure_equals("skipping optional update", gLoginCreds["params"]["skipoptional"].asBoolean(), true); - } } diff --git a/indra/newview/tests/llversioninfo_test.cpp b/indra/newview/tests/llversioninfo_test.cpp index f1f69f33f1..2f7a4e9601 100644 --- a/indra/newview/tests/llversioninfo_test.cpp +++ b/indra/newview/tests/llversioninfo_test.cpp @@ -29,6 +29,8 @@ #include "../llversioninfo.h" + #include <iostream> + // LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The // macro expands to the string name of the channel, but without quotes. We // need to turn it into a quoted string. This macro trick does that. @@ -81,7 +83,9 @@ namespace tut template<> template<> void versioninfo_object_t::test<1>() - { + { + std::cout << "What we parsed from CMake: " << LL_VIEWER_VERSION_BUILD << std::endl; + std::cout << "What we get from llversioninfo: " << LLVersionInfo::getBuild() << std::endl; ensure_equals("Major version", LLVersionInfo::getMajor(), LL_VIEWER_VERSION_MAJOR); diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index a08e32cb49..e2e7f09c3b 100644 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -71,25 +71,33 @@ static const char * all_keys[] = { "duration", "fps", - "get_other", + "get_other_http", + "get_other_udp", "get_texture_temp_http", "get_texture_temp_udp", "get_texture_non_temp_http", "get_texture_non_temp_udp", + "get_wearable_http", "get_wearable_udp", + "get_sound_http", "get_sound_udp", + "get_gesture_http", "get_gesture_udp" }; static const char * resp_keys[] = { - "get_other", + "get_other_http", + "get_other_udp", "get_texture_temp_http", "get_texture_temp_udp", "get_texture_non_temp_http", "get_texture_non_temp_udp", + "get_wearable_http", "get_wearable_udp", + "get_sound_http", "get_sound_udp", + "get_gesture_http", "get_gesture_udp" }; @@ -540,11 +548,17 @@ namespace tut ensure("sd[get_gesture_udp][enqueued] is 0", (0 == sd["get_gesture_udp"]["enqueued"].asInteger())); ensure("sd[get_gesture_udp][dequeued] is 0", (0 == sd["get_gesture_udp"]["dequeued"].asInteger())); - ensure("sd[get_wearable_udp][enqueued] is 4", (4 == sd["get_wearable_udp"]["enqueued"].asInteger())); - ensure("sd[get_wearable_udp][dequeued] is 4", (4 == sd["get_wearable_udp"]["dequeued"].asInteger())); + ensure("sd[get_wearable_http][enqueued] is 2", (2 == sd["get_wearable_http"]["enqueued"].asInteger())); + ensure("sd[get_wearable_http][dequeued] is 2", (2 == sd["get_wearable_http"]["dequeued"].asInteger())); - ensure("sd[get_other][enqueued] is 4", (4 == sd["get_other"]["enqueued"].asInteger())); - ensure("sd[get_other][dequeued] is 0", (0 == sd["get_other"]["dequeued"].asInteger())); + ensure("sd[get_wearable_udp][enqueued] is 2", (2 == sd["get_wearable_udp"]["enqueued"].asInteger())); + ensure("sd[get_wearable_udp][dequeued] is 2", (2 == sd["get_wearable_udp"]["dequeued"].asInteger())); + + ensure("sd[get_other_http][enqueued] is 2", (2 == sd["get_other_http"]["enqueued"].asInteger())); + ensure("sd[get_other_http][dequeued] is 0", (0 == sd["get_other_http"]["dequeued"].asInteger())); + + ensure("sd[get_other_udp][enqueued] is 2", (2 == sd["get_other_udp"]["enqueued"].asInteger())); + ensure("sd[get_other_udp][dequeued] is 0", (0 == sd["get_other_udp"]["dequeued"].asInteger())); // Reset and check zeros... // Reset leaves current region in place |