diff options
Diffstat (limited to 'indra/newview/tests')
| -rw-r--r-- | indra/newview/tests/llagentaccess_test.cpp | 60 | ||||
| -rw-r--r-- | indra/newview/tests/lllogininstance_test.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/tests/llslurl_test.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/tests/llviewernetwork_test.cpp | 8 |
4 files changed, 68 insertions, 7 deletions
diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp index c970d79975..564a49896c 100644 --- a/indra/newview/tests/llagentaccess_test.cpp +++ b/indra/newview/tests/llagentaccess_test.cpp @@ -84,19 +84,25 @@ namespace tut LLAgentAccess aa(cgr); cgr.setU32("PreferredMaturity", SIM_ACCESS_PG); +#ifndef HACKED_GODLIKE_VIEWER ensure("1 prefersPG", aa.prefersPG()); ensure("1 prefersMature", !aa.prefersMature()); ensure("1 prefersAdult", !aa.prefersAdult()); +#endif // HACKED_GODLIKE_VIEWER cgr.setU32("PreferredMaturity", SIM_ACCESS_MATURE); +#ifndef HACKED_GODLIKE_VIEWER ensure("2 prefersPG", !aa.prefersPG()); ensure("2 prefersMature", aa.prefersMature()); ensure("2 prefersAdult", !aa.prefersAdult()); +#endif // HACKED_GODLIKE_VIEWER cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT); +#ifndef HACKED_GODLIKE_VIEWER ensure("3 prefersPG", !aa.prefersPG()); ensure("3 prefersMature", aa.prefersMature()); ensure("3 prefersAdult", aa.prefersAdult()); +#endif // HACKED_GODLIKE_VIEWER } template<> template<> @@ -107,45 +113,59 @@ namespace tut LLAgentAccess aa(cgr); // make sure default is PG +#ifndef HACKED_GODLIKE_VIEWER ensure("1 isTeen", aa.isTeen()); ensure("1 isMature", !aa.isMature()); ensure("1 isAdult", !aa.isAdult()); +#endif // HACKED_GODLIKE_VIEWER // this is kinda bad -- setting this forces maturity to MATURE but !teen != Mature anymore aa.setTeen(false); +#ifndef HACKED_GODLIKE_VIEWER ensure("2 isTeen", !aa.isTeen()); ensure("2 isMature", aa.isMature()); ensure("2 isAdult", !aa.isAdult()); +#endif // HACKED_GODLIKE_VIEWER // have to flip it back and make sure it still works aa.setTeen(true); +#ifndef HACKED_GODLIKE_VIEWER ensure("3 isTeen", aa.isTeen()); ensure("3 isMature", !aa.isMature()); ensure("3 isAdult", !aa.isAdult()); +#endif // HACKED_GODLIKE_VIEWER // check the conversion routine +#ifndef HACKED_GODLIKE_VIEWER ensure_equals("1 conversion", SIM_ACCESS_PG, aa.convertTextToMaturity('P')); ensure_equals("2 conversion", SIM_ACCESS_MATURE, aa.convertTextToMaturity('M')); ensure_equals("3 conversion", SIM_ACCESS_ADULT, aa.convertTextToMaturity('A')); ensure_equals("4 conversion", SIM_ACCESS_MIN, aa.convertTextToMaturity('Q')); +#endif // HACKED_GODLIKE_VIEWER // now try the other method of setting it - PG aa.setMaturity('P'); ensure("4 isTeen", aa.isTeen()); +#ifndef HACKED_GODLIKE_VIEWER ensure("4 isMature", !aa.isMature()); ensure("4 isAdult", !aa.isAdult()); +#endif // HACKED_GODLIKE_VIEWER // Mature aa.setMaturity('M'); +#ifndef HACKED_GODLIKE_VIEWER ensure("5 isTeen", !aa.isTeen()); ensure("5 isMature", aa.isMature()); ensure("5 isAdult", !aa.isAdult()); +#endif // HACKED_GODLIKE_VIEWER // Adult aa.setMaturity('A'); +#ifndef HACKED_GODLIKE_VIEWER ensure("6 isTeen", !aa.isTeen()); ensure("6 isMature", aa.isMature()); ensure("6 isAdult", aa.isAdult()); +#endif // HACKED_GODLIKE_VIEWER } @@ -156,21 +176,35 @@ namespace tut cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); LLAgentAccess aa(cgr); +#ifndef HACKED_GODLIKE_VIEWER ensure("starts normal", !aa.isGodlike()); +#endif // HACKED_GODLIKE_VIEWER aa.setGodLevel(GOD_NOT); +#ifndef HACKED_GODLIKE_VIEWER ensure("stays normal", !aa.isGodlike()); +#endif // HACKED_GODLIKE_VIEWER aa.setGodLevel(GOD_FULL); +#ifndef HACKED_GODLIKE_VIEWER ensure("sets full", aa.isGodlike()); +#endif // HACKED_GODLIKE_VIEWER aa.setGodLevel(GOD_NOT); +#ifndef HACKED_GODLIKE_VIEWER ensure("resets normal", !aa.isGodlike()); +#endif // HACKED_GODLIKE_VIEWER aa.setAdminOverride(true); +#ifndef HACKED_GODLIKE_VIEWER ensure("admin true", aa.getAdminOverride()); ensure("overrides 1", aa.isGodlike()); +#endif // HACKED_GODLIKE_VIEWER aa.setGodLevel(GOD_FULL); +#ifndef HACKED_GODLIKE_VIEWER ensure("overrides 2", aa.isGodlike()); +#endif // HACKED_GODLIKE_VIEWER aa.setAdminOverride(false); +#ifndef HACKED_GODLIKE_VIEWER ensure("admin false", !aa.getAdminOverride()); ensure("overrides 3", aa.isGodlike()); +#endif // HACKED_GODLIKE_VIEWER } template<> template<> @@ -180,55 +214,73 @@ namespace tut cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); LLAgentAccess aa(cgr); +#ifndef HACKED_GODLIKE_VIEWER ensure("1 pg to start", aa.wantsPGOnly()); ensure("2 pg to start", !aa.canAccessMature()); ensure("3 pg to start", !aa.canAccessAdult()); +#endif // HACKED_GODLIKE_VIEWER aa.setGodLevel(GOD_FULL); +#ifndef HACKED_GODLIKE_VIEWER ensure("1 full god", !aa.wantsPGOnly()); ensure("2 full god", aa.canAccessMature()); ensure("3 full god", aa.canAccessAdult()); +#endif // HACKED_GODLIKE_VIEWER aa.setGodLevel(GOD_NOT); aa.setAdminOverride(true); +#ifndef HACKED_GODLIKE_VIEWER ensure("1 admin mode", !aa.wantsPGOnly()); ensure("2 admin mode", aa.canAccessMature()); ensure("3 admin mode", aa.canAccessAdult()); +#endif // HACKED_GODLIKE_VIEWER aa.setAdminOverride(false); aa.setMaturity('M'); // preferred is still pg by default +#ifndef HACKED_GODLIKE_VIEWER ensure("1 mature pref pg", aa.wantsPGOnly()); ensure("2 mature pref pg", !aa.canAccessMature()); ensure("3 mature pref pg", !aa.canAccessAdult()); +#endif // HACKED_GODLIKE_VIEWER cgr.setU32("PreferredMaturity", SIM_ACCESS_MATURE); +#ifndef HACKED_GODLIKE_VIEWER ensure("1 mature", !aa.wantsPGOnly()); ensure("2 mature", aa.canAccessMature()); ensure("3 mature", !aa.canAccessAdult()); +#endif // HACKED_GODLIKE_VIEWER cgr.setU32("PreferredMaturity", SIM_ACCESS_PG); +#ifndef HACKED_GODLIKE_VIEWER ensure("1 mature pref pg", aa.wantsPGOnly()); ensure("2 mature pref pg", !aa.canAccessMature()); ensure("3 mature pref pg", !aa.canAccessAdult()); +#endif // HACKED_GODLIKE_VIEWER aa.setMaturity('A'); +#ifndef HACKED_GODLIKE_VIEWER ensure("1 adult pref pg", aa.wantsPGOnly()); ensure("2 adult pref pg", !aa.canAccessMature()); ensure("3 adult pref pg", !aa.canAccessAdult()); +#endif // HACKED_GODLIKE_VIEWER cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT); +#ifndef HACKED_GODLIKE_VIEWER ensure("1 adult", !aa.wantsPGOnly()); ensure("2 adult", aa.canAccessMature()); ensure("3 adult", aa.canAccessAdult()); +#endif // HACKED_GODLIKE_VIEWER // make sure that even if pref is high, if access is low we block access // this shouldn't occur in real life but we want to be safe cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT); aa.setMaturity('P'); +#ifndef HACKED_GODLIKE_VIEWER ensure("1 pref adult, actual pg", aa.wantsPGOnly()); ensure("2 pref adult, actual pg", !aa.canAccessMature()); ensure("3 pref adult, actual pg", !aa.canAccessAdult()); +#endif // HACKED_GODLIKE_VIEWER } @@ -239,9 +291,13 @@ namespace tut cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); LLAgentAccess aa(cgr); +#ifndef HACKED_GODLIKE_VIEWER ensure("1 transition starts false", !aa.isInTransition()); +#endif // HACKED_GODLIKE_VIEWER aa.setTransition(); +#ifndef HACKED_GODLIKE_VIEWER ensure("2 transition now true", aa.isInTransition()); +#endif // HACKED_GODLIKE_VIEWER } template<> template<> @@ -253,10 +309,14 @@ namespace tut cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT); aa.setMaturity('M'); +#ifndef HACKED_GODLIKE_VIEWER ensure("1 preferred maturity pegged to M when maturity is M", cgr.getU32("PreferredMaturity") == SIM_ACCESS_MATURE); +#endif // HACKED_GODLIKE_VIEWER aa.setMaturity('P'); +#ifndef HACKED_GODLIKE_VIEWER ensure("1 preferred maturity pegged to P when maturity is P", cgr.getU32("PreferredMaturity") == SIM_ACCESS_PG); +#endif // HACKED_GODLIKE_VIEWER } } diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index c9f49d9343..b7e81c4199 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -114,8 +114,9 @@ LLGridManager::~LLGridManager() { } -void LLGridManager::addGrid(LLSD& grid_data) +bool LLGridManager::addGrid(LLSD& grid_data) { + return true; } LLGridManager::LLGridManager() : diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp index f995d8f0f5..09343ef227 100644 --- a/indra/newview/tests/llslurl_test.cpp +++ b/indra/newview/tests/llslurl_test.cpp @@ -93,7 +93,7 @@ const char *gSampleGridFile = " <array>" " <string>foobar/loginuri</string>" " </array>" - " <key>name</key><string>foo.bar.com</string>" + " <key>keyname</key><string>foo.bar.com</string>" " <key>credential_type</key><string>agent</string>" " <key>grid_login_id</key><string>FooBar</string>" " </map>" @@ -106,7 +106,7 @@ const char *gSampleGridFile = " <array>" " <string>mygrid/loginuri</string>" " </array>" - " <key>name</key><string>my.grid.com</string>" + " <key>keyname</key><string>my.grid.com</string>" " <key>credential_type</key><string>agent</string>" " <key>grid_login_id</key><string>MyGrid</string>" " </map>" diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index 43d3b6522e..a1e97ea17e 100644 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -95,13 +95,13 @@ const char *gSampleGridFile = " <string>altgrid/myloginuri1</string>" " <string>altgrid/myloginuri2</string>" " </array>" - " <key>name</key><string>altgrid.long.name</string>" + " <key>keyname</key><string>altgrid.long.name</string>" " <key>credential_type</key><string>agent</string>" " <key>grid_login_id</key><string>AltGrid</string>" " </map>" " <key>minimal.long.name</key>" " <map>" - " <key>name</key><string>minimal.long.name</string>" + " <key>keyname</key><string>minimal.long.name</string>" " </map>" " <!-- Note that the values for agni and aditi below are deliberately" " incorrect to test that they are not overwritten -->" @@ -115,7 +115,7 @@ const char *gSampleGridFile = " <array>" " <string>myloginuri</string>" " </array>" - " <key>name</key><string>util.agni.lindenlab.com</string> <!-- conflict -->" + " <key>keyname</key><string>util.agni.lindenlab.com</string> <!-- conflict -->" " </map>" " <key>util.foobar.lindenlab.com</key>" " <map>" @@ -127,7 +127,7 @@ const char *gSampleGridFile = " <array>" " <string>myloginuri</string>" " </array>" - " <key>name</key><string>util.foobar.lindenlab.com</string>" + " <key>keyname</key><string>util.foobar.lindenlab.com</string>" " </map>" " </map>" "</llsd>" |
