summaryrefslogtreecommitdiff
path: root/indra/llcommon/tests/lleventcoro_test.cpp
AgeCommit message (Collapse)Author
2019-08-12DRTVWR-493: Make catch_llerrs() a member of WrapLLErrs.Nat Goodspeed
2019-08-10DRTVWR-493: Introduce test catch_what(), catch_llerrs() functions.Nat Goodspeed
Use them in place of awkward try/catch test boilerplate.
2016-04-04merge with 4.0.3-releaseOz Linden
2015-12-18MAINT-5976: Fix bug in LLCoros::set_consuming() mechanism.Nat Goodspeed
The original implementation of set_consuming() involved a bool* pointing to a local bool in VoidListener::operator()()'s stack frame. postAndSuspend() would set that bool (through the pointer) as soon as it returned from suspension. The trouble with that is that LLEventMailDrop potentially calls its new listener (fulfilling the future) immediately in the listen_impl() override -- in other words, way up at the top of postAndSuspend(), well before the code that sets the relevant bool. Instead, make the adapter formerly known as VoidListener bind the coroutine's get_consuming() value at adapter construction time (before listening on the LLEventPump), so that its operator()() has the coroutine's correct get_consuming() value to return. Eliminating the bool* makes the code both simpler AND more correct! This change makes that adapter very specific to coroutine usage. Rename it FutureListener and migrate it from lleventcoros.h into the .cpp file. Nobody else was using it anyway. Make corresponding changes to postAndSuspend2() and its WaitForEventOnHelper class -- whose name no longer corresponds to the function as it used to. Rename that one FutureListener2. The new FutureListener functionality, common to both these adapters, makes it useful to derive FutureListener2 from FutureListener. Introduce llmake(), a generic function to deduce template type arguments from function parameter types. This allows us to remove the voidlistener() and wfeoh() helper functions. Hiding VoidListener broke one of the lleventcoro_test.cpp tests. But that test was sort of a lame recap of an earlier implementation of postAndSuspend(), based on LLEventPump events. Recast that test to illustrate how to use a coroutine future to suspend a coroutine for something other than an LLEventPump. But that rubbed my nose in the fact that we MUST wrap future's context switching with proper management of the current coroutine. Introduce LLCoros::Future<T>, which wraps boost::dcoroutines::future<T>. Use LLCoros::Future<T> in postAndSuspend() and postAndSuspend2().
2015-12-16MAINT-5976: Introduce LLCoros::set_consuming(bool).Nat Goodspeed
set_consuming(true) tells each postAndSuspend() call to consume the event for which it is suspending.
2015-11-10remove execute permission from many files that should not have itOz Linden
2015-09-18Tweek to naming postEventAndSuspend -> postAndSuspendRider Linden
2015-09-18Set consistent terminology for yield/wait -> suspend for coroutines.Rider Linden
2015-07-10MAINT-5351: Finish cleaning up messy merge from backing out backoutNat Goodspeed
2015-07-10Automated merge with file:///Users/nat/linden/maint-4952-v-t-uNat Goodspeed
2015-07-10Merge restore of more selfless changesNat Goodspeed
2015-07-10Backed out changeset bab1000e1b2d: restore 'selfless' changesNat Goodspeed
2015-07-10Merge restore of selfless changesNat Goodspeed
2015-07-10Backed out changeset 6e1fa9518747: reapply 'selfless' changesNat Goodspeed
2015-07-07MergeRider Linden
2015-07-07Backout selfles merge 738255dbbfd679d9e615baab3398e5e345bbb3c5Rider Linden
2015-07-07Apply reverse patchRider Linden
2015-07-07Backed out selfless mergeRider Linden
2015-07-07Automated merge with ssh://bitbucket.org/nat_linden/viewer-selflessNat Goodspeed
2015-07-06Force Boost use of TR1 for result_of in testsRider Linden
2015-07-06Force Boost result_of to use TR1 for tests.Rider Linden
2015-07-02MAINT-5357: Introduce and populate llcoro:: namespace.Nat Goodspeed
To date, the coroutine helper functions in lleventcoro.h have been in the global namespace. Migrate them into llcoro namespace, and fix references. Specifically, LLVoidListener => llcoro::VoidListener, and voidlistener(), postAndWait(), both waitForEventOn(), postAndWait2(), errorException() and errorLog() have been moved into llcoro. Also migrate new LLCoros::get_self() and Suspending to llcoro:: namespace. While at it, I realized that -- having converted several lleventcoro.h functions from templates (for arbitrary 'self' parameter type) to ordinary functions, having moved them from lleventcoro.h to lleventcoro.cpp, we can now migrate their helpers from lleventcoro.h to lleventcoro.cpp as well. This eliminates the need for the LLEventDetail namespace; the relevant helpers are now in an anonymous namespace in the .cpp file: listenerNameForCoro(), storeToLLSDPath(), WaitForEventOnHelper and wfeoh().
2015-07-01MAINT-5351: Reorganize lleventcoro_test.cpp to be more readable.Nat Goodspeed
Each test<n>() method invokes a function from earlier in the source. It's much better if each of those functions immediately precedes the test that invokes it.
2015-07-01MAINT-5351: Remove 'self' parameter from coroutine functions.Nat Goodspeed
lleventcoro_test.cpp runs clean (as modified for new API), and all the rest builds clean, but the resulting viewer is as yet untested.
2014-10-22Update to build on Xcode 6.0 (fix unit tests): remove unused statement warningcallum_linden
2013-10-21more buildfixRichard Linden
2013-05-23MAINT-2724: Make viewer explicitly set coroutine stack size.Nat Goodspeed
Introduce LLCoros::setStackSize(), with a compile-time default value we hope we never have to use. Make LLAppViewer call it with the value of the new settings variable CoroutineStackSize as soon as we've read settings files. (While we're at it, notify interested parties that we've read settings files.) Give CoroutineStackSize a default value four times the previous default stack size. Make LLCoros::launch() pass the saved stack size to each new coroutine instance. Re-enable lleventcoro integration test. Use LLSDMap() construct rather than LLSD::insert(), which used to return the modified object but is now void.
2013-05-07merge changes for DRTVWR-299Oz Linden
2013-03-29Update Mac and Windows breakpad builds to latestGraham Madarasz
2013-02-21MAINT-2389: Change viewer to Boost package without ucontext.h.Nat Goodspeed
In autobuild.xml, specify today's build of the Boost package that includes the Boost.Context library, and whose boost::dcoroutines library uses Boost.Context exclusively instead of its previous context-switching underpinnings (source of the ucontext.h dependency). Add BOOST_CONTEXT_LIBRARY to Boost.cmake and Copy3rdPartyLibs.cmake. Link it with the viewer and with the lllogin.cpp test executable. Track new Boost package convention that our (early, unofficial) Boost.Coroutine library is now accessed as boost/dcoroutine/etc.h and boost::dcoroutines::etc. Remove #include <boost/coroutine/coroutine.hpp> from llviewerprecompiledheaders.h and lllogin.cpp: old rule that Boost.Coroutine header must be #included before anything else that might use ucontext.h is gone now that we no longer depend on ucontext.h. In fact remove -D_XOPEN_SOURCE in 00-Common.cmake because that was inserted specifically to work around a known problem with the ucontext.h facilities.
2010-08-13Change license from GPL to LGPL (version 2.1)Oz Linden
2009-05-28DEV-32777: ensure that stack objects listening on persistent LLEventPumps getNat Goodspeed
properly disconnected when destroyed. Break out Debug class and associated macros from lleventcoro_test.cpp into test/debug.h. Add Debug output to lllogin_test.
2009-05-22DEV-27646 dll linkage for login module.Brad Kittenbrink
Ok, finally got this to a point where it doesn't break the build and I can check in. llcommon can be built as a shared library (disabled but can be enabled with cmake cache var LLCOMMON_LINK_SHARED. reviewed by Mani on tuesday (I still need to get his suggested changes re-reviewed)
2009-05-13svn merge -r113003:119136 ↵Nat Goodspeed
svn+ssh://svn.lindenlab.com/svn/linden/branches/login-api/login-api-2 svn+ssh://svn.lindenlab.com/svn/linden/branches/login-api/login-api-3 (finish)