From de6b78027cc402d72ddf6428e7af625f962b9bd7 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Tue, 23 Jun 2020 08:42:49 -0400
Subject: [PATCH] Fix tests

---
 indra/newview/llagentaccess.cpp              | 12 ++++++++++++
 indra/newview/tests/llagentaccess_test.cpp   |  2 +-
 indra/newview/tests/llviewernetwork_test.cpp |  8 ++++----
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llagentaccess.cpp b/indra/newview/llagentaccess.cpp
index b567d2bae82..f4ce495ecf6 100644
--- a/indra/newview/llagentaccess.cpp
+++ b/indra/newview/llagentaccess.cpp
@@ -101,19 +101,31 @@ bool LLAgentAccess::canAccessAdult() const
 
 bool LLAgentAccess::prefersPG() const
 {
+#ifdef LL_TEST
+	U32 access = mSavedSettings.getU32("PreferredMaturity");
+#else
 	U32 access = ALControlCache::PreferredMaturity;
+#endif
 	return access < SIM_ACCESS_MATURE;
 }
 
 bool LLAgentAccess::prefersMature() const
 {
+#ifdef LL_TEST
+	U32 access = mSavedSettings.getU32("PreferredMaturity");
+#else
 	U32 access = ALControlCache::PreferredMaturity;
+#endif
 	return access >= SIM_ACCESS_MATURE;
 }
 
 bool LLAgentAccess::prefersAdult() const
 {
+#ifdef LL_TEST
+	U32 access = mSavedSettings.getU32("PreferredMaturity");
+#else
 	U32 access = ALControlCache::PreferredMaturity;
+#endif
 	return access >= SIM_ACCESS_ADULT;
 }
 
diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp
index 45ce1ba62f3..9a8d8bb61fa 100644
--- a/indra/newview/tests/llagentaccess_test.cpp
+++ b/indra/newview/tests/llagentaccess_test.cpp
@@ -65,7 +65,7 @@ U32 LLControlGroup::getU32(const std::string& name)
 	return test_preferred_maturity;
 }
 //----------------------------------------------------------------------------
-	
+
 namespace tut
 {
     struct agentaccess
diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp
index fe81fd63ea1..9fc9ca01ac8 100644
--- a/indra/newview/tests/llviewernetwork_test.cpp
+++ b/indra/newview/tests/llviewernetwork_test.cpp
@@ -159,7 +159,7 @@ const char *gSampleGridFile =
 	"      <array>"
 	"        <string>myloginuri</string>"
 	"      </array>"
-	"      <key>update_query_url_base</key><string>https://update.secondlife.com/update</string>"
+	"      <key>update_query_url_base</key><string>https://app.alchemyviewer.org/update</string>"
 	"      <key>keyname</key><string>util.foobar.lindenlab.com</string>"
 	"    </map>"
 	"  </map>"
@@ -219,7 +219,7 @@ namespace tut
 					  std::string("Agni"),
 					  LLGridManager::getInstance()->getGridId("util.agni.lindenlab.com"));
 		ensure_equals("update url base for Agni", // relies on agni being the default
-					  std::string("https://update.secondlife.com/update"),
+					  std::string("https://app.alchemyviewer.org/update"),
 					  LLGridManager::getInstance()->getUpdateServiceURL());
 		ensure_equals("label for agni",
 					  LLGridManager::getInstance()->getGridLabel("util.agni.lindenlab.com"),
@@ -293,7 +293,7 @@ namespace tut
 					  LLGridManager::getInstance()->getGridId("util.agni.lindenlab.com"),
 					  std::string("Agni"));
 		ensure_equals("update url base for Agni", // relies on agni being the default
-					  std::string("https://update.secondlife.com/update"),
+					  std::string("https://app.alchemyviewer.org/update"),
 					  LLGridManager::getInstance()->getUpdateServiceURL());
 		ensure_equals("label for agni",
 					  LLGridManager::getInstance()->getGridLabel("util.agni.lindenlab.com"),
@@ -424,7 +424,7 @@ namespace tut
 					  LLGridManager::getInstance()->getLoginPage(),
 					  std::string("https://viewer-splash.secondlife.com/"));
 		ensure_equals("update url base for Agni", // relies on agni being the default
-					  std::string("https://update.secondlife.com/update"),
+					  std::string("https://app.alchemyviewer.org/update"),
 					  LLGridManager::getInstance()->getUpdateServiceURL());
 		ensure("Is Agni a production grid", LLGridManager::getInstance()->isInProductionGrid());
 		std::vector<std::string> uris;
-- 
GitLab