summaryrefslogtreecommitdiff
path: root/indra/llcommon/tests
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-10-14 16:30:08 -0700
committerMerov Linden <merov@lindenlab.com>2013-10-14 16:30:08 -0700
commitc2f5365f986aab49d5c7cfa2834a68f5b35c09c2 (patch)
tree4cbbf7bd730ad0ad3aa00569c4364dad51de6082 /indra/llcommon/tests
parent0cf0efb6e31d505bc079f757fe7d832110797199 (diff)
parentf7158bc5afcec1da8b9d2d5a4ed86921e62d4959 (diff)
Pull merge from lindenlab/viewer-release
Diffstat (limited to 'indra/llcommon/tests')
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/StringVec.h0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/bitpack_test.cpp16
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/commonmisc_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/listener.h0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llallocator_heap_profile_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llallocator_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llbase64_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/lldate_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/lldependencies_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llerror_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/lleventcoro_test.cpp49
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/lleventdispatcher_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/lleventfilter_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llframetimer_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llinstancetracker_test.cpp3
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/lllazy_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llleap_test.cpp9
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llmemtype_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llprocess_test.cpp7
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llprocessor_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llrand_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llsdserialize_test.cpp5
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llsingleton_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llstreamqueue_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/llstring_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/lltreeiterators_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/lluri_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/reflection_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/stringize_test.cpp0
-rwxr-xr-x[-rw-r--r--]indra/llcommon/tests/wrapllerrs.h0
30 files changed, 46 insertions, 43 deletions
diff --git a/indra/llcommon/tests/StringVec.h b/indra/llcommon/tests/StringVec.h
index a380b00a05..a380b00a05 100644..100755
--- a/indra/llcommon/tests/StringVec.h
+++ b/indra/llcommon/tests/StringVec.h
diff --git a/indra/llcommon/tests/bitpack_test.cpp b/indra/llcommon/tests/bitpack_test.cpp
index 4c3bc674af..afc0c18cd0 100644..100755
--- a/indra/llcommon/tests/bitpack_test.cpp
+++ b/indra/llcommon/tests/bitpack_test.cpp
@@ -71,7 +71,6 @@ namespace tut
U8 packbuffer[255];
U8 unpackbuffer[255];
int pack_bufsize = 0;
- int unpack_bufsize = 0;
LLBitPack bitpack(packbuffer, 255);
@@ -81,21 +80,20 @@ namespace tut
pack_bufsize = bitpack.flushBitPack();
LLBitPack bitunpack(packbuffer, pack_bufsize*8);
- unpack_bufsize = bitunpack.bitUnpack(&unpackbuffer[0], 8);
+ bitunpack.bitUnpack(&unpackbuffer[0], 8);
ensure("bitPack: individual unpack: 0", unpackbuffer[0] == (U8) str[0]);
- unpack_bufsize = bitunpack.bitUnpack(&unpackbuffer[0], 8);
+ bitunpack.bitUnpack(&unpackbuffer[0], 8);
ensure("bitPack: individual unpack: 1", unpackbuffer[0] == (U8) str[1]);
- unpack_bufsize = bitunpack.bitUnpack(&unpackbuffer[0], 8);
+ bitunpack.bitUnpack(&unpackbuffer[0], 8);
ensure("bitPack: individual unpack: 2", unpackbuffer[0] == (U8) str[2]);
- unpack_bufsize = bitunpack.bitUnpack(&unpackbuffer[0], 8);
+ bitunpack.bitUnpack(&unpackbuffer[0], 8);
ensure("bitPack: individual unpack: 3", unpackbuffer[0] == (U8) str[3]);
- unpack_bufsize = bitunpack.bitUnpack(&unpackbuffer[0], 8);
+ bitunpack.bitUnpack(&unpackbuffer[0], 8);
ensure("bitPack: individual unpack: 4", unpackbuffer[0] == (U8) str[4]);
- unpack_bufsize = bitunpack.bitUnpack(&unpackbuffer[0], 8);
+ bitunpack.bitUnpack(&unpackbuffer[0], 8);
ensure("bitPack: individual unpack: 5", unpackbuffer[0] == (U8) str[5]);
- unpack_bufsize = bitunpack.bitUnpack(unpackbuffer, 8*4); // Life
+ bitunpack.bitUnpack(unpackbuffer, 8*4); // Life
ensure_memory_matches("bitPack: 4 bytes unpack:", unpackbuffer, 4, str+6, 4);
- ensure("keep compiler quiet", unpack_bufsize == unpack_bufsize);
}
// U32 packing
diff --git a/indra/llcommon/tests/commonmisc_test.cpp b/indra/llcommon/tests/commonmisc_test.cpp
index b115c153c1..b115c153c1 100644..100755
--- a/indra/llcommon/tests/commonmisc_test.cpp
+++ b/indra/llcommon/tests/commonmisc_test.cpp
diff --git a/indra/llcommon/tests/listener.h b/indra/llcommon/tests/listener.h
index 9c5c18a150..9c5c18a150 100644..100755
--- a/indra/llcommon/tests/listener.h
+++ b/indra/llcommon/tests/listener.h
diff --git a/indra/llcommon/tests/llallocator_heap_profile_test.cpp b/indra/llcommon/tests/llallocator_heap_profile_test.cpp
index 44a9705803..44a9705803 100644..100755
--- a/indra/llcommon/tests/llallocator_heap_profile_test.cpp
+++ b/indra/llcommon/tests/llallocator_heap_profile_test.cpp
diff --git a/indra/llcommon/tests/llallocator_test.cpp b/indra/llcommon/tests/llallocator_test.cpp
index 4e62eaee67..4e62eaee67 100644..100755
--- a/indra/llcommon/tests/llallocator_test.cpp
+++ b/indra/llcommon/tests/llallocator_test.cpp
diff --git a/indra/llcommon/tests/llbase64_test.cpp b/indra/llcommon/tests/llbase64_test.cpp
index d0394150fa..d0394150fa 100644..100755
--- a/indra/llcommon/tests/llbase64_test.cpp
+++ b/indra/llcommon/tests/llbase64_test.cpp
diff --git a/indra/llcommon/tests/lldate_test.cpp b/indra/llcommon/tests/lldate_test.cpp
index 7c95ccb91f..7c95ccb91f 100644..100755
--- a/indra/llcommon/tests/lldate_test.cpp
+++ b/indra/llcommon/tests/lldate_test.cpp
diff --git a/indra/llcommon/tests/lldependencies_test.cpp b/indra/llcommon/tests/lldependencies_test.cpp
index 5395d785b6..5395d785b6 100644..100755
--- a/indra/llcommon/tests/lldependencies_test.cpp
+++ b/indra/llcommon/tests/lldependencies_test.cpp
diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp
index 279a90e51b..279a90e51b 100644..100755
--- a/indra/llcommon/tests/llerror_test.cpp
+++ b/indra/llcommon/tests/llerror_test.cpp
diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp
index 901ba35b2f..5ebde1a31d 100644..100755
--- a/indra/llcommon/tests/lleventcoro_test.cpp
+++ b/indra/llcommon/tests/lleventcoro_test.cpp
@@ -64,10 +64,10 @@
// Boost.Coroutine #include is the *first* #include of the platform header.
// That means that client code must generally #include Boost.Coroutine headers
// before anything else.
-#include <boost/coroutine/coroutine.hpp>
+#include <boost/dcoroutine/coroutine.hpp>
// Normally, lleventcoro.h obviates future.hpp. We only include this because
// we implement a "by hand" test of future functionality.
-#include <boost/coroutine/future.hpp>
+#include <boost/dcoroutine/future.hpp>
#include <boost/bind.hpp>
#include <boost/range.hpp>
@@ -78,6 +78,7 @@
#include "../test/lltut.h"
#include "llsd.h"
+#include "llsdutil.h"
#include "llevents.h"
#include "tests/wrapllerrs.h"
#include "stringize.h"
@@ -87,7 +88,7 @@
/*****************************************************************************
* from the banana.cpp example program borrowed for test<1>()
*****************************************************************************/
-namespace coroutines = boost::coroutines;
+namespace coroutines = boost::dcoroutines;
using coroutines::coroutine;
template<typename Iter>
@@ -108,7 +109,7 @@ match_substring(BidirectionalIterator begin,
BidirectionalIterator end,
std::string xmatch,
BOOST_DEDUCED_TYPENAME coroutine<BidirectionalIterator(void)>::self& self) {
- BidirectionalIterator begin_ = begin;
+//BidirectionalIterator begin_ = begin;
for(; begin != end; ++begin)
if(match(begin, end, xmatch)) {
self.yield(begin);
@@ -122,7 +123,7 @@ typedef coroutine<std::string::iterator(void)> match_coroutine_type;
* Test helpers
*****************************************************************************/
// I suspect this will be typical of coroutines used in Linden software
-typedef boost::coroutines::coroutine<void()> coroutine_type;
+typedef boost::dcoroutines::coroutine<void()> coroutine_type;
/// Simulate an event API whose response is immediate: sent on receipt of the
/// initial request, rather than after some delay. This is the case that
@@ -173,10 +174,10 @@ namespace tut
// ... do whatever preliminary stuff must happen ...
// declare the future
- boost::coroutines::future<LLSD> future(self);
+ boost::dcoroutines::future<LLSD> future(self);
// tell the future what to wait for
LLTempBoundListener connection(
- LLEventPumps::instance().obtain("source").listen("coro", voidlistener(boost::coroutines::make_callback(future))));
+ LLEventPumps::instance().obtain("source").listen("coro", voidlistener(boost::dcoroutines::make_callback(future))));
ensure("Not yet", ! future);
// attempting to dereference ("resolve") the future causes the calling
// coroutine to wait for it
@@ -213,7 +214,7 @@ namespace tut
BEGIN
{
result = postAndWait(self,
- LLSD().insert("value", 17), // request event
+ LLSDMap("value", 17), // request event
immediateAPI.getPump(), // requestPump
"reply1", // replyPump
"reply"); // request["reply"] = name
@@ -226,7 +227,7 @@ namespace tut
BEGIN
{
LLEventWithID pair = ::postAndWait2(self,
- LLSD().insert("value", 18),
+ LLSDMap("value", 18),
immediateAPI.getPump(),
"reply2",
"error2",
@@ -244,7 +245,7 @@ namespace tut
BEGIN
{
LLEventWithID pair = ::postAndWait2(self,
- LLSD().insert("value", 18).insert("fail", LLSD()),
+ LLSDMap("value", 18)("fail", LLSD()),
immediateAPI.getPump(),
"reply2",
"error2",
@@ -273,7 +274,7 @@ namespace tut
BEGIN
{
LLCoroEventPump waiter;
- result = waiter.postAndWait(self, LLSD().insert("value", 17),
+ result = waiter.postAndWait(self, LLSDMap("value", 17),
immediateAPI.getPump(), "reply");
}
END
@@ -365,7 +366,7 @@ namespace tut
BEGIN
{
LLCoroEventPumps waiter;
- LLEventWithID pair(waiter.postAndWait(self, LLSD().insert("value", 23),
+ LLEventWithID pair(waiter.postAndWait(self, LLSDMap("value", 23),
immediateAPI.getPump(), "reply", "error"));
result = pair.first;
which = pair.second;
@@ -379,7 +380,7 @@ namespace tut
{
LLCoroEventPumps waiter;
LLEventWithID pair(
- waiter.postAndWait(self, LLSD().insert("value", 23).insert("fail", LLSD()),
+ waiter.postAndWait(self, LLSDMap("value", 23)("fail", LLSD()),
immediateAPI.getPump(), "reply", "error"));
result = pair.first;
which = pair.second;
@@ -392,7 +393,7 @@ namespace tut
BEGIN
{
LLCoroEventPumps waiter;
- result = waiter.postAndWaitWithException(self, LLSD().insert("value", 8),
+ result = waiter.postAndWaitWithException(self, LLSDMap("value", 8),
immediateAPI.getPump(), "reply", "error");
}
END
@@ -406,7 +407,7 @@ namespace tut
try
{
result = waiter.postAndWaitWithException(self,
- LLSD().insert("value", 9).insert("fail", LLSD()),
+ LLSDMap("value", 9)("fail", LLSD()),
immediateAPI.getPump(), "reply", "error");
debug("no exception");
}
@@ -424,7 +425,7 @@ namespace tut
BEGIN
{
LLCoroEventPumps waiter;
- result = waiter.postAndWaitWithLog(self, LLSD().insert("value", 30),
+ result = waiter.postAndWaitWithLog(self, LLSDMap("value", 30),
immediateAPI.getPump(), "reply", "error");
}
END
@@ -439,7 +440,7 @@ namespace tut
try
{
result = waiter.postAndWaitWithLog(self,
- LLSD().insert("value", 31).insert("fail", LLSD()),
+ LLSDMap("value", 31)("fail", LLSD()),
immediateAPI.getPump(), "reply", "error");
debug("no exception");
}
@@ -796,4 +797,18 @@ namespace tut
ensure("no result", result.isUndefined());
ensure_contains("got error", threw, "32");
}
+}
+
+/*==========================================================================*|
+#include <boost/context/guarded_stack_allocator.hpp>
+
+namespace tut
+{
+ template<> template<>
+ void object::test<23>()
+ {
+ set_test_name("stacksize");
+ std::cout << "default_stacksize: " << boost::context::guarded_stack_allocator::default_stacksize() << '\n';
+ }
} // namespace tut
+|*==========================================================================*/
diff --git a/indra/llcommon/tests/lleventdispatcher_test.cpp b/indra/llcommon/tests/lleventdispatcher_test.cpp
index 263c9b171f..263c9b171f 100644..100755
--- a/indra/llcommon/tests/lleventdispatcher_test.cpp
+++ b/indra/llcommon/tests/lleventdispatcher_test.cpp
diff --git a/indra/llcommon/tests/lleventfilter_test.cpp b/indra/llcommon/tests/lleventfilter_test.cpp
index ca05ef62a9..ca05ef62a9 100644..100755
--- a/indra/llcommon/tests/lleventfilter_test.cpp
+++ b/indra/llcommon/tests/lleventfilter_test.cpp
diff --git a/indra/llcommon/tests/llframetimer_test.cpp b/indra/llcommon/tests/llframetimer_test.cpp
index 8ac1c91a3a..8ac1c91a3a 100644..100755
--- a/indra/llcommon/tests/llframetimer_test.cpp
+++ b/indra/llcommon/tests/llframetimer_test.cpp
diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp
index 454695ff9f..e769c3e22c 100644..100755
--- a/indra/llcommon/tests/llinstancetracker_test.cpp
+++ b/indra/llcommon/tests/llinstancetracker_test.cpp
@@ -267,7 +267,6 @@ namespace tut
{
existing.insert(&*uki);
}
- Unkeyed* puk = NULL;
try
{
// We don't expect the assignment to take place because we expect
@@ -280,7 +279,7 @@ namespace tut
// realize we're testing the C++ implementation more than
// Unkeyed's implementation, but this seems an important point to
// nail down.
- puk = new Unkeyed("throw");
+ new Unkeyed("throw");
}
catch (const Badness&)
{
diff --git a/indra/llcommon/tests/lllazy_test.cpp b/indra/llcommon/tests/lllazy_test.cpp
index 32a717f4fc..32a717f4fc 100644..100755
--- a/indra/llcommon/tests/lllazy_test.cpp
+++ b/indra/llcommon/tests/lllazy_test.cpp
diff --git a/indra/llcommon/tests/llleap_test.cpp b/indra/llcommon/tests/llleap_test.cpp
index 9b755e9ca5..29060d4ef5 100644..100755
--- a/indra/llcommon/tests/llleap_test.cpp
+++ b/indra/llcommon/tests/llleap_test.cpp
@@ -122,13 +122,10 @@ namespace tut
// finding indra/lib/python. Use our __FILE__, with
// raw-string syntax to deal with Windows pathnames.
"mydir = os.path.dirname(r'" << __FILE__ << "')\n"
- "try:\n"
- " from llbase import llsd\n"
- "except ImportError:\n"
// We expect mydir to be .../indra/llcommon/tests.
- " sys.path.insert(0,\n"
- " os.path.join(mydir, os.pardir, os.pardir, 'lib', 'python'))\n"
- " from indra.base import llsd\n"
+ "sys.path.insert(0,\n"
+ " os.path.join(mydir, os.pardir, os.pardir, 'lib', 'python'))\n"
+ "from indra.base import llsd\n"
"\n"
"class ProtocolError(Exception):\n"
" def __init__(self, msg, data):\n"
diff --git a/indra/llcommon/tests/llmemtype_test.cpp b/indra/llcommon/tests/llmemtype_test.cpp
index 1f050d6dc7..1f050d6dc7 100644..100755
--- a/indra/llcommon/tests/llmemtype_test.cpp
+++ b/indra/llcommon/tests/llmemtype_test.cpp
diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp
index 99186ed434..3e68ef068e 100644..100755
--- a/indra/llcommon/tests/llprocess_test.cpp
+++ b/indra/llcommon/tests/llprocess_test.cpp
@@ -619,7 +619,7 @@ namespace tut
template<> template<>
void object::test<6>()
{
- set_test_name("syntax_error:");
+ set_test_name("syntax_error");
PythonProcessLauncher py(get_test_name(),
"syntax_error:\n");
py.mParams.files.add(LLProcess::FileParam()); // inherit stdin
@@ -957,10 +957,7 @@ namespace tut
childout.getline(), "ok");
// important to get the implicit flush from std::endl
py.mPy->getWritePipe().get_ostream() << "go" << std::endl;
- for (i = 0; i < timeout && py.mPy->isRunning() && ! childout.contains("\n"); ++i)
- {
- yield();
- }
+ waitfor(*py.mPy);
ensure("script never replied", childout.contains("\n"));
ensure_equals("child didn't ack", childout.getline(), "ack");
ensure_equals("bad child termination", py.mPy->getStatus().mState, LLProcess::EXITED);
diff --git a/indra/llcommon/tests/llprocessor_test.cpp b/indra/llcommon/tests/llprocessor_test.cpp
index 884e1b5e5b..884e1b5e5b 100644..100755
--- a/indra/llcommon/tests/llprocessor_test.cpp
+++ b/indra/llcommon/tests/llprocessor_test.cpp
diff --git a/indra/llcommon/tests/llrand_test.cpp b/indra/llcommon/tests/llrand_test.cpp
index 383e6f9e0a..383e6f9e0a 100644..100755
--- a/indra/llcommon/tests/llrand_test.cpp
+++ b/indra/llcommon/tests/llrand_test.cpp
diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp
index e625545763..4d436e8897 100644..100755
--- a/indra/llcommon/tests/llsdserialize_test.cpp
+++ b/indra/llcommon/tests/llsdserialize_test.cpp
@@ -1523,10 +1523,7 @@ namespace tut
"sys.path.insert(0,\n"
" os.path.join(os.path.dirname(r'" __FILE__ "'),\n"
" os.pardir, os.pardir, 'lib', 'python'))\n"
- "try:\n"
- " from llbase import llsd\n"
- "except ImportError:\n"
- " from indra.base import llsd\n")
+ "from indra.base import llsd\n")
{}
~TestPythonCompatible() {}
diff --git a/indra/llcommon/tests/llsingleton_test.cpp b/indra/llcommon/tests/llsingleton_test.cpp
index 385289aefe..385289aefe 100644..100755
--- a/indra/llcommon/tests/llsingleton_test.cpp
+++ b/indra/llcommon/tests/llsingleton_test.cpp
diff --git a/indra/llcommon/tests/llstreamqueue_test.cpp b/indra/llcommon/tests/llstreamqueue_test.cpp
index 050ad5c5bf..050ad5c5bf 100644..100755
--- a/indra/llcommon/tests/llstreamqueue_test.cpp
+++ b/indra/llcommon/tests/llstreamqueue_test.cpp
diff --git a/indra/llcommon/tests/llstring_test.cpp b/indra/llcommon/tests/llstring_test.cpp
index 93d3968dbf..93d3968dbf 100644..100755
--- a/indra/llcommon/tests/llstring_test.cpp
+++ b/indra/llcommon/tests/llstring_test.cpp
diff --git a/indra/llcommon/tests/lltreeiterators_test.cpp b/indra/llcommon/tests/lltreeiterators_test.cpp
index 1d619867d4..1d619867d4 100644..100755
--- a/indra/llcommon/tests/lltreeiterators_test.cpp
+++ b/indra/llcommon/tests/lltreeiterators_test.cpp
diff --git a/indra/llcommon/tests/lluri_test.cpp b/indra/llcommon/tests/lluri_test.cpp
index 4c64f15ca7..4c64f15ca7 100644..100755
--- a/indra/llcommon/tests/lluri_test.cpp
+++ b/indra/llcommon/tests/lluri_test.cpp
diff --git a/indra/llcommon/tests/reflection_test.cpp b/indra/llcommon/tests/reflection_test.cpp
index 8980ebb1f1..8980ebb1f1 100644..100755
--- a/indra/llcommon/tests/reflection_test.cpp
+++ b/indra/llcommon/tests/reflection_test.cpp
diff --git a/indra/llcommon/tests/stringize_test.cpp b/indra/llcommon/tests/stringize_test.cpp
index 3d34f23998..3d34f23998 100644..100755
--- a/indra/llcommon/tests/stringize_test.cpp
+++ b/indra/llcommon/tests/stringize_test.cpp
diff --git a/indra/llcommon/tests/wrapllerrs.h b/indra/llcommon/tests/wrapllerrs.h
index a4d3a4e026..a4d3a4e026 100644..100755
--- a/indra/llcommon/tests/wrapllerrs.h
+++ b/indra/llcommon/tests/wrapllerrs.h