summaryrefslogtreecommitdiff
path: root/indra/llcommon/tests/StringVec.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-03-21 13:03:04 -0400
committerNat Goodspeed <nat@lindenlab.com>2012-03-21 13:03:04 -0400
commit3238cebcb098cfb36aeeee37a7498d569ab04955 (patch)
tree4459c297533a53bc93dfb11316552805c3ff4500 /indra/llcommon/tests/StringVec.h
parentb187aeb8f177bd76e792652e773617beff18b47b (diff)
parentcabb6b6a5f339a69fec25b836f46b8b470eebb90 (diff)
Automated merge with http://hg.secondlife.com/viewer-release
Diffstat (limited to 'indra/llcommon/tests/StringVec.h')
-rw-r--r--indra/llcommon/tests/StringVec.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/indra/llcommon/tests/StringVec.h b/indra/llcommon/tests/StringVec.h
new file mode 100644
index 0000000000..a380b00a05
--- /dev/null
+++ b/indra/llcommon/tests/StringVec.h
@@ -0,0 +1,37 @@
+/**
+ * @file StringVec.h
+ * @author Nat Goodspeed
+ * @date 2012-02-24
+ * @brief Extend TUT ensure_equals() to handle std::vector<std::string>
+ *
+ * $LicenseInfo:firstyear=2012&license=viewerlgpl$
+ * Copyright (c) 2012, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if ! defined(LL_STRINGVEC_H)
+#define LL_STRINGVEC_H
+
+#include <vector>
+#include <string>
+#include <iostream>
+
+typedef std::vector<std::string> StringVec;
+
+std::ostream& operator<<(std::ostream& out, const StringVec& strings)
+{
+ out << '(';
+ StringVec::const_iterator begin(strings.begin()), end(strings.end());
+ if (begin != end)
+ {
+ out << '"' << *begin << '"';
+ while (++begin != end)
+ {
+ out << ", \"" << *begin << '"';
+ }
+ }
+ out << ')';
+ return out;
+}
+
+#endif /* ! defined(LL_STRINGVEC_H) */