summaryrefslogtreecommitdiff
path: root/indra/newview/tests/llslurl_test.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2014-09-09 15:38:27 -0400
committerMonty Brandenberg <monty@lindenlab.com>2014-09-09 15:38:27 -0400
commit8d7d9bcae697b1450db083d538912fc871b5edae (patch)
treed82320dd37ba3c73c06a12fe8bcbe686952e621a /indra/newview/tests/llslurl_test.cpp
parentf71c6c745bc390fadc571801a0d7c043249ade24 (diff)
parentbd0a9b6b4c929f640164b623f5183d371404bb96 (diff)
Merge. Pull LLSlurl/LLViewerNetwork unit test fix from viewer-drano-http-4
Diffstat (limited to 'indra/newview/tests/llslurl_test.cpp')
-rwxr-xr-xindra/newview/tests/llslurl_test.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp
index 86229ad636..2bc0d5a086 100755
--- a/indra/newview/tests/llslurl_test.cpp
+++ b/indra/newview/tests/llslurl_test.cpp
@@ -6,7 +6,7 @@
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2014, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -31,6 +31,15 @@
#include "../llslurl.h"
#include "../../llxml/llcontrol.h"
#include "llsdserialize.h"
+
+namespace
+{
+
+// Should not collide with other test programs creating temp files.
+static const char * const TEST_FILENAME("llslurl_test.xml");
+
+}
+
//----------------------------------------------------------------------------
// Mock objects for the dependencies of the code we're testing
@@ -143,11 +152,11 @@ namespace tut
template<> template<>
void slurlTestObject::test<1>()
{
- llofstream gridfile("grid_test.xml");
+ llofstream gridfile(TEST_FILENAME);
gridfile << gSampleGridFile;
gridfile.close();
- LLGridManager::getInstance()->initialize("grid_test.xml");
+ LLGridManager::getInstance()->initialize(TEST_FILENAME);
LLGridManager::getInstance()->setGridChoice("util.agni.lindenlab.com");
@@ -260,11 +269,11 @@ namespace tut
template<> template<>
void slurlTestObject::test<2>()
{
- llofstream gridfile("grid_test.xml");
+ llofstream gridfile(TEST_FILENAME);
gridfile << gSampleGridFile;
gridfile.close();
- LLGridManager::getInstance()->initialize("grid_test.xml");
+ LLGridManager::getInstance()->initialize(TEST_FILENAME);
LLSLURL slurl = LLSLURL("my.grid.com", "my region");
ensure_equals("grid/region - type", slurl.getType(), LLSLURL::LOCATION);
@@ -293,11 +302,11 @@ namespace tut
template<> template<>
void slurlTestObject::test<3>()
{
- llofstream gridfile("grid_test.xml");
+ llofstream gridfile(TEST_FILENAME);
gridfile << gSampleGridFile;
gridfile.close();
- LLGridManager::getInstance()->initialize("grid_test.xml");
+ LLGridManager::getInstance()->initialize(TEST_FILENAME);
LLGridManager::getInstance()->setGridChoice("my.grid.com");
LLSLURL slurl = LLSLURL("https://my.grid.com/region/my%20region/1/2/3");