summaryrefslogtreecommitdiff
path: root/indra/test/llevents_tut.cpp
AgeCommit message (Collapse)Author
2020-03-25DRTVWR-476: Kill LLEventQueue, per-frame LLEventPump::flush() calls.Nat Goodspeed
No one uses LLEventQueue to defer posted events until the next mainloop tick -- and with LLCoros moving to Boost.Fiber, cross-coroutine event posting works that way anyway, making LLEventQueue pretty unnecessary. The static RegisterFlush instance in llevents.cpp was used to call LLEventPumps::flush() once per mainloop tick, which in turn called flush() on every registered LLEventPump. But the only reason for that mechanism was to support LLEventQueue. In fact, when LLEventMailDrop overrode its flush() method for something quite different, it was startling to find that the new flush() override was being called once per frame -- which caused at least one fairly mysterious bug. Remove RegisterFlush. Both LLEventPumps::flush() and LLEventPump::flush() remain for now, though intended usage is unclear. Eliminating LLEventQueue means we must at least repurpose LLEventPumps::mQueueNames, a map intended to make LLEventPumps::obtain() instantiate an LLEventQueue rather than the default LLEventPump. Replace it with mFactories, a map from desired instance name to a callable returning LLEventPump*. New map initialization syntax plus lambda support allows us to populate that map at compile time with little lambdas returning the correct subclass instance. Similarly, LLLeapListener::newpump() used to check the ["type"] entry in the LLSD request specifically for "LLEventQueue". Introduce another such map in llleaplistener.cpp for potential future extensibility. Eliminate the LLEventQueue-specific test.
2020-03-25DRTVWR-476: Remove special case for listen(boost::bind(weak_ptr)).Nat Goodspeed
LLEventDetail::visit_and_connect() promised special treatment for the specific case when an LLEventPump::listen() listener was composed of (possibly nested) boost::bind() objects storing boost::weak_ptr values -- specifically boost::bind() rather than std::bind or lambdas, specifically boost::weak_ptr rather than std::weak_ptr. Outside of self-tests, it does not appear that anyone actually uses that support. There is good reason not to: it's a silent side effect of a complicated compile-time inspection that could be silently derailed by use of std::bind() or a lambda or a std::weak_ptr. Can you be sure you've engaged that promise? How? A more robust guarantee can be achieved by storing an LLTempBoundConnection in the transient object itself. When the object is destroyed, the listener is disconnected. Normal C++ rules around object destruction guarantee it. This idiom is widely used. There are a couple good reasons to remove the visit_and_connect() machinery: * boost::bind() and boost::weak_ptr do not constitute the wave of the future. Preferring those constructs to lambdas and std::weak_ptr penalizes new code, whether by silently failing or by discouraging use of modern idioms. * The visit_and_connect() machinery was always complicated, and apparently never very robust. Most of its promised features have been commented out over the years. Making the code base simpler, clearer and more maintainable is always a useful effect. LLEventDetail::visit_and_connect() was also used by the four LLNotificationChannelBase::connectMumble() methods. Streamline those as well. Of course, remove related test code.
2020-03-25DRTVWR-476: Remove llwrap(), LLListenerWrapper[Base] and support.Nat Goodspeed
The only usage of any of this was in test code.
2019-08-10DRTVWR-493: Introduce test catch_what(), catch_llerrs() functions.Nat Goodspeed
Use them in place of awkward try/catch test boilerplate.
2015-11-10remove execute permission from many files that should not have itOz Linden
2014-10-23Fix Xcode 6 compile errors relating to tut::ensure_equals() overloads.Nat Goodspeed
lltut.h declares a number of ensure_equals() overloads for various data types, notably the types supported by LLSD. We expect these to be called by tut code. But the tut code in question is in a template in tut.hpp -- which was #included BEFORE the overloads were declared. Previous C++ compilers have evidently made multiple passes, collecting the relevant overloads before attempting to compile the template bodies. clang does not, complaining that the overloads must be declared before the tut.hpp template code that references them. Reordering parts of lltut.h seems to address that problem. For similar reasons, test programs that use StringVec.h and its operator<<() must #include StringVec.h before lltut.h. Add ensure_equals(const std::string&, const LLSD::Binary&, const LLSD::Binary&) overload. The sloppy mix of (const char*, ...) and (const std::string&, ...) overloads bothers me, since for many of those ... types we seem to have to duplicate them.
2013-03-29Update Mac and Windows breakpad builds to latestGraham Madarasz
2012-02-24Update llevents_tut.cpp to use StringVec, not local StringList.Nat Goodspeed
2012-02-15Fix llprocess_test.cpp's exception catching for Linux.Nat Goodspeed
In the course of re-enabling the indra/test tests last year, Log generalized a workaround I'd introduced in llsdmessage_test.cpp. In Linux viewer land, a test program trying to catch an expected exception can't seem to catch it by its specific class (across the libllcommon.so boundary), but must instead catch std::runtime_error and validate the typeid().name() string. Log added a macro for this idiom in llevents_tut.cpp. Generalize that macro further for normal-case processing as well, move it to a header file of its own and use it in all known places -- plus the new exception-catching tests in llprocess_test.cpp.
2011-09-16Removed the bool version of the linux exception catching macro in ↵Logan Dethrow
llevents_tut.cpp.
2011-09-16Fixed linux exception catching macros in llevents_tut.cpp. All tests now ↵Logan Dethrow
pass on a lenny build machine.
2011-09-15Changed extra linux exception handling into a pair of macros.Logan Dethrow
2011-09-15Added extra exception catching code to llevents_tut.cpp to fix linux test ↵Logan Dethrow
failures.
2011-09-15Backed out changeset 19aa1a773410Logan Dethrow
2011-09-14Copied newer version of llevents_tut from server. Fixed line ending in ↵Logan Dethrow
CMakeLists.txt.
2010-08-13Change license from GPL to LGPL (version 2.1)Oz Linden
2009-11-30DEV-43463: Keep LLEventPump's LLStandardSignal alive during post()Nat Goodspeed
Replace LLEventPump's boost::scoped_ptr<LLStandardSignal> with boost::shared_ptr. Take a local stack copy of that shared_ptr in post() methods, and invoke the signal through that copy. This guards against scenario in which LLEventPump gets destroyed during signal invocation. (See Jira for details.) Re-enable Mani's test case that used to crash. Introduce ll_template_cast<> to allow a template function to recognize a parameter of a particular type. Introduce LLListenerWrapper mechanism to support wrapper objects for LLEventPump listeners. You instantiate an LLListenerWrapper subclass object inline in the listen() call (typically with llwrap<>), passing it the real listener, trusting it to forward the eventual call. Introduce prototypical LLCoutListener and LLLogListener subclasses for illustrative and diagnostic purposes. Test that LLLogListener doesn't block recognizing LLEventTrackable base class bound into wrapped listener.
2009-05-11svn 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
2009-05-08svn merge -r114679:114681 ↵Nat Goodspeed
svn+ssh://svn.lindenlab.com/svn/linden/branches/event-system/event-system-7 svn+ssh://svn.lindenlab.com/svn/linden/branches/event-system/event-system-8