diff options
Diffstat (limited to 'indra/llcommon/tests')
30 files changed, 49 insertions, 31 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 afc0c18cd0..afc0c18cd0 100644..100755 --- a/indra/llcommon/tests/bitpack_test.cpp +++ b/indra/llcommon/tests/bitpack_test.cpp 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 e769c3e22c..e769c3e22c 100644..100755 --- a/indra/llcommon/tests/llinstancetracker_test.cpp +++ b/indra/llcommon/tests/llinstancetracker_test.cpp 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..f188865eb0 100644..100755 --- a/indra/llcommon/tests/llprocess_test.cpp +++ b/indra/llcommon/tests/llprocess_test.cpp @@ -608,6 +608,9 @@ namespace tut void object::test<5>() { set_test_name("exit(2)"); +#if LL_WINDOWS + skip("MAINT-2302: This frequently (though not always) fails on Windows."); +#endif PythonProcessLauncher py(get_test_name(), "import sys\n" "sys.exit(2)\n"); @@ -620,6 +623,9 @@ namespace tut void object::test<6>() { set_test_name("syntax_error:"); +#if LL_WINDOWS + skip("MAINT-2302: This frequently (though not always) fails on Windows."); +#endif PythonProcessLauncher py(get_test_name(), "syntax_error:\n"); py.mParams.files.add(LLProcess::FileParam()); // inherit stdin @@ -641,6 +647,9 @@ namespace tut void object::test<7>() { set_test_name("explicit kill()"); +#if LL_WINDOWS + skip("MAINT-2302: This frequently (though not always) fails on Windows."); +#endif PythonProcessLauncher py(get_test_name(), "from __future__ import with_statement\n" "import sys, time\n" @@ -685,6 +694,9 @@ namespace tut void object::test<8>() { set_test_name("implicit kill()"); +#if LL_WINDOWS + skip("MAINT-2302: This frequently (though not always) fails on Windows."); +#endif NamedTempFile out("out", "not started"); LLProcess::handle phandle(0); { @@ -957,10 +969,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 |