Commits

nat_linden committed fb93eec Draft

MAINT-2168: Backed out changeset 797318b62275, pushed to wrong repo
This changeset was prematurely pushed to the wrong repository. Back it out
to propagate it the right way.

Comments (0)

Files changed (1)

indra/llmessage/tests/llhttpclient_test.cpp

 namespace tut
 {
 	LLSD storage;
-
+	
 	class LLSDStorageNode : public LLHTTPNode
 	{
 	public:
 	{
 	public:
 		HTTPClientTestData():
-			PORT(getenv("PORT")),
-			// Turning NULL PORT into empty string doesn't make things work;
-			// that's just to keep this initializer from blowing up. We test
-			// PORT separately in the constructor body.
-			local_server(STRINGIZE("http://127.0.0.1:" << (PORT? PORT : "") << "/"))
+			local_server(STRINGIZE("http://127.0.0.1:" << getenv("PORT") << "/"))
 		{
-			ensure("Set environment variable PORT to local test server port", PORT);
 			apr_pool_create(&mPool, NULL);
 			LLCurl::initClass(false);
 			mServerPump = new LLPumpIO(mPool);
 
 			LLHTTPClient::setPump(*mClientPump);
 		}
-
+		
 		~HTTPClientTestData()
 		{
 			delete mServerPump;
 			LLHTTPStandardServices::useServices();
 			LLHTTPRegistrar::buildAllServices(root);
 		}
-
+		
 		void runThePump(float timeout = 100.0f)
 		{
 			LLTimer timer;
 			mServerPump = NULL;
 		}
 
-		const char* const PORT;
 		const std::string local_server;
 
 	private:
 			{
 				std::string msg =
 					llformat("error() called when not expected, status %d",
-						mStatus);
+						mStatus); 
 				fail(msg);
 			}
 		}
-
+	
 		void ensureStatusError()
 		{
 			if (!mSawError)
 				fail("error() wasn't called");
 			}
 		}
-
+		
 		LLSD getResult()
 		{
 			return mResult;
 		{
 			return mHeader;
 		}
-
+	
 	protected:
 		bool mSawError;
 		U32 mStatus;
 				: mClient(client)
 			{
 			}
-
+		
 		public:
 			static Result* build(HTTPClientTestData& client)
 			{
 				return new Result(client);
 			}
-
+			
 			~Result()
 			{
 				mClient.mResultDeleted = true;
 			}
-
+			
 			virtual void error(U32 status, const std::string& reason)
 			{
 				mClient.mSawError = true;
 							const LLSD& content)
 			{
 				LLHTTPClient::Responder::completed(status, reason, content);
-
+				
 				mClient.mSawCompleted = true;
 			}
 
 			mResult.clear();
 			mHeader.clear();
 			mResultDeleted = false;
-
+			
 			return Result::build(*this);
 		}
 	};
-
-
+	
+	
 	typedef test_group<HTTPClientTestData>	HTTPClientTestGroup;
 	typedef HTTPClientTestGroup::object		HTTPClientTestObject;
 	HTTPClientTestGroup httpClientTestGroup("http_client");