summaryrefslogtreecommitdiff
path: root/indra/newview/tests/llversioninfo_test.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2016-11-30 20:10:28 -0500
committerNat Goodspeed <nat@lindenlab.com>2016-11-30 20:10:28 -0500
commit222919be87386af66bba836fbb9495b64b4007f4 (patch)
tree3fc79da4bdae902b7ed4bf1fc7679751247c012c /indra/newview/tests/llversioninfo_test.cpp
parenta47e16b3169b2fd91faf7a4dbfbba1f305298bce (diff)
DRTVWR-418: Adjust for LL_VIEWER_CHANNEL coming in unquoted.
Evidently the LL_VIEWER_CHANNEL macro (defined on the compiler command line) used to contain enclosing double quotes. Something changed (newer CMake version?) so that the macro now expands as Second Life Release rather than as "Second Life Release". That leads to syntax errors when it's used. Add C++ preprocessor trickery to stringize the value of the macro.
Diffstat (limited to 'indra/newview/tests/llversioninfo_test.cpp')
-rw-r--r--indra/newview/tests/llversioninfo_test.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/newview/tests/llversioninfo_test.cpp b/indra/newview/tests/llversioninfo_test.cpp
index 6b0be29c2d..f1f69f33f1 100644
--- a/indra/newview/tests/llversioninfo_test.cpp
+++ b/indra/newview/tests/llversioninfo_test.cpp
@@ -29,6 +29,13 @@
#include "../llversioninfo.h"
+// LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The
+// macro expands to the string name of the channel, but without quotes. We
+// need to turn it into a quoted string. This macro trick does that.
+#define stringize_inner(x) #x
+#define stringize_outer(x) stringize_inner(x)
+#define ll_viewer_channel stringize_outer(LL_VIEWER_CHANNEL)
+
namespace tut
{
struct versioninfo
@@ -50,7 +57,7 @@ namespace tut
mShortVersion = stream.str();
stream.str("");
- stream << LL_VIEWER_CHANNEL
+ stream << ll_viewer_channel
<< " "
<< mVersion;
mVersionAndChannel = stream.str();
@@ -89,7 +96,7 @@ namespace tut
LL_VIEWER_VERSION_BUILD);
ensure_equals("Channel version",
LLVersionInfo::getChannel(),
- LL_VIEWER_CHANNEL);
+ ll_viewer_channel);
ensure_equals("Version String",
LLVersionInfo::getVersion(),
mVersion);