summaryrefslogtreecommitdiff
path: root/indra/newview/tests/llslurl_test.cpp
diff options
context:
space:
mode:
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");