Commit Graph

348 Commits (9edad026f4494de1a6f02ecc3f477faa27a361ef)

Author SHA1 Message Date
andreykproductengine 37eb735ba7 Merged in lindenlab/viewer-release 2019-09-10 20:30:25 +03:00
andreykproductengine bc5d79e06e DRTVWR-493 Test fix for W64 2019-08-13 21:46:12 +03:00
Nat Goodspeed 4fce6dc435 DRTVWR-493: Permit LLParamSingleton::initSingleton() circularity.
This was forbidden, but AndreyK points out cases in which LLParamSingleton::
initSingleton() should in fact be allowed to circle back to its own instance()
method. Use a recursive_mutex instead of plain mutex to permit that; remove
LL_ERRS preventing it.

Add LLParamSingleton::instance() method that calls
LLParamSingleton::getInstance(). Inheriting LLSingleton::instance() called
LLSingleton::getInstance() -- not at all what we want.

Add LLParamSingleton unit tests.
2019-08-12 17:35:45 -04:00
Nat Goodspeed f0fa4f94a5 DRTVWR-493: Make catch_llerrs() a member of WrapLLErrs. 2019-08-12 08:26:51 -04:00
Nat Goodspeed adb3f447b3 DRTVWR-493: Introduce test catch_what(), catch_llerrs() functions.
Use them in place of awkward try/catch test boilerplate.
2019-08-10 20:33:59 -04:00
Nat Goodspeed c4096f670c SL-10153: Review and rationalize fetching paths from environment.
Use LLStringUtil::getenv() or getoptenv() whenever we fetch a string that will
be used as a pathname.

Use LLFile::tmpdir() instead of getenv("TEMP").

As an added extra-special bonus, finally clean up $TMP/llcontrol-test-zzzzzz
directories that have been accumulating every time we run a local build!
2018-12-14 15:38:13 -05:00
Nat Goodspeed cd9d051b90 DRTVWR-447: Move test<5> and writeMsgNeedsEscaping() into sequence. 2018-10-17 16:42:59 -04:00
Oz Linden 00a839d665 renumber the new test to replace the one that was removed 2018-10-16 16:18:31 -04:00
Oz Linden d87cc1859f Modify logging so that the in-viewer console and stderr do not escape line breaks
Improve the implementation so that escaping is computed only once
2018-10-11 14:17:52 -04:00
Nat Goodspeed 1e8851c4df Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2018-09-26 16:39:16 -04:00
Oz Linden f1d4e788e7 SL-967 simplify viewer log file field syntax
MAINT-8991: only escape log message characters once, add unit test
remove extra log line created by LL_ERRS
document that tags may not contain spaces
2018-08-29 16:43:45 -04:00
andreykproductengine 098f6399fb SL-10954 Unit test escapePathAndData 2019-05-07 20:36:19 +03:00
Nat Goodspeed e766d9e697 DRTVWR-447: Merge up to latest viewer-release 2018-06-21 13:26:15 -04:00
Andrey Kleshchev 9411bd1cef MAINT-2338 Unit tests 2018-05-22 12:58:52 +00:00
Nat Goodspeed c09d9c12e7 SL-821: Add WSTRINGIZE() and DEWSTRINGIZE() macros for wide strings.
Streamline convenience overload stringize(std::wstring); make convenience
overload wstringize(std::string) symmetrically convert from UTF-8 string.

Also eliminate STRINGIZE() et al. dependency on Boost.Phoenix: use lambdas
instead.

Using lambdas instead of template expansion necessitates reordering some code
in wrapllerrs.h.
2018-05-17 05:45:36 -04:00
Nat Goodspeed fe64db61d6 Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2017-05-22 21:30:26 -04:00
AndreyL ProductEngine 4a90678cc7 Linux buildfix; this should be reverted after gcc update to 4.7+ 2017-05-18 03:13:57 +03:00
Nat Goodspeed 9c66072cac Add LLEventThrottle tests; actually *all* lleventfilter.cpp tests.
For some reason there wasn't an entry in indra/llcommon/CMakeLists.txt to run
the tests in indra/llcommon/tests/lleventfilter_test.cpp. It seems likely that
at some point it existed, since all previous tests built and ran successfully.
In any case, (re-)add lleventfilter_test.cpp to the set of llcommon tests.
Also alphabetize them to make it easier to find a particular test invocation.

Also add new tests for LLEventThrottle.

To support this, refactor the concrete LLEventThrottle class into
LLEventThrottleBase containing all the tricky logic, with pure virtual
methods for access to LLTimer and LLEventTimeout, and an LLEventThrottle
subclass containing the LLTimer and LLEventTimeout instances and corresponding
implementations of the new pure virtual methods.

That permits us to introduce TestEventThrottle, an alternate subclass with
dummy implementations of the methods related to LLTimer and LLEventTimeout. In
particular, we can explicitly advance simulated realtime to simulate
particular LLTimer and LLEventTimeout behaviors.

Finally, introduce Concat, a test LLEventPump listener class whose function is
to concatenate received string event data into a composite string so we can
readily test for particular sequences of events.
2017-05-10 15:04:18 -04:00
Nat Goodspeed a4467e9ffe Automated merge with ssh://bitbucket.org/lindenlab/viewer64-c-11 2017-05-04 17:16:12 -04:00
Callum Prentice 9dd7c67012 Pull in improvements to LLProcess termination via a commit from Nat Linden here: 4f39500cb4?at=default 2017-04-19 16:50:56 -07:00
Nat Goodspeed ae0b3149ba DRTVWR-418: Fix a round of compile errors surfaced by -std=c++11.
These are mostly things that were in fact erroneous, but accepted by older
compilers.

This changeset has not yet been built with Visual Studio 2013 or Linux gcc,
even with -std=c++11.

This changeset has not been built *without* -std=c++11. It should be used in
conjunction with a corresponding change to LL_BUILD_DARWIN_BASE_SWITCHES in
viewer-build-variables/variables.

This is a work in progress. We do not assert that this changeset completes the
work needed to turn on -std=c++11, even on the Mac.
2017-02-23 16:49:49 -05:00
AndreyL ProductEngine 7fceb3a63f Merged in lindenlab/viewer-cleanup 2016-11-14 22:04:37 +02:00
Nat Goodspeed 23d50f53cb MAINT-5232: Ensure custom operator<<() overload is visible to TUT. 2016-10-13 07:11:18 -04:00
Nat Goodspeed 763509589d MAINT-5232: Add LLHeteroMap to contain objects of unrelated classes. 2016-10-12 23:01:48 -04:00
Glenn Glazer 86be29fe80 merge maint-6633 to fork of viewer-bear 2016-10-11 14:42:58 -07:00
Glenn Glazer 19f576872a maint-6633: space, the final frontier 2016-10-11 11:41:25 -07:00
Glenn Glazer e6043fad2a maint-6633: space after colon 2016-10-11 09:21:33 -07:00
Nat Goodspeed 704c53b3c5 MAINT-5232: Merge up to VLC viewer from viewer-release 2016-10-11 10:59:17 -04:00
Glenn Glazer cea2e4a7ad maint-6633: fix spacing 2016-10-10 15:14:46 -07:00
Glenn Glazer acfbcc7352 maint-6633: move INFO around 2016-10-10 14:15:29 -07:00
Glenn Glazer c39b7f2d88 maint-6633: fix tyop 2016-10-10 13:37:42 -07:00
AndreyL ProductEngine 4617e07b37 Merged in lindenlab/viewer-release 2016-10-10 23:26:58 +03:00
Glenn Glazer 972b0b2f1b maint-6633: fix unit test to conform with new desired ordering 2016-10-10 12:31:01 -07:00
Nat Goodspeed d2c3c2f9fe MAINT-5232: Normalize LLSingleton subclasses.
A shocking number of LLSingleton subclasses had public constructors -- and in
several instances, were being explicitly instantiated independently of the
LLSingleton machinery. This breaks the new LLSingleton dependency-tracking
machinery. It seems only fair that if you say you want an LLSingleton, there
should only be ONE INSTANCE!

Introduce LLSINGLETON() and LLSINGLETON_EMPTY_CTOR() macros. These handle the
friend class LLSingleton<whatevah>;
and explicitly declare a private nullary constructor.

To try to enforce the LLSINGLETON() convention, introduce a new pure virtual
LLSingleton method you_must_use_LLSINGLETON_macro() which is, as you might
suspect, defined by the macro. If you declare an LLSingleton subclass without
using LLSINGLETON() or LLSINGLETON_EMPTY_CTOR() in the class body, you can't
instantiate the subclass for lack of a you_must_use_LLSINGLETON_macro()
implementation -- which will hopefully remind the coder.

Trawl through ALL LLSingleton subclass definitions, sprinkling in
LLSINGLETON() or LLSINGLETON_EMPTY_CTOR() as appropriate. Remove all explicit
constructor declarations, public or private, along with relevant 'friend class
LLSingleton<myself>' declarations. Where destructors are declared, move them
into private section as well. Where the constructor was inline but nontrivial,
move out of class body.

Fix several LLSingleton abuses revealed by making ctors/dtors private:

LLGlobalEconomy was both an LLSingleton and the base class for
LLRegionEconomy, a non-LLSingleton. (Therefore every LLRegionEconomy instance
contained another instance of the LLGlobalEconomy "singleton.") Extract
LLBaseEconomy; LLGlobalEconomy is now a trivial subclass of that.
LLRegionEconomy, as you might suspect, now derives from LLBaseEconomy.

LLToolGrab, an LLSingleton, was also explicitly instantiated by
LLToolCompGun's constructor. Extract LLToolGrabBase, explicitly instantiated,
with trivial subclass LLToolGrab, the LLSingleton instance.

(WARNING: LLToolGrabBase methods have an unnerving tendency to go after
LLToolGrab::getInstance(). I DO NOT KNOW what should be the relationship
between the instance in LLToolCompGun and the LLToolGrab singleton instance.)

LLGridManager declared a variant constructor accepting (const std::string&),
with the comment:
// initialize with an explicity grid file for testing.
As there is no evidence of this being called from anywhere, delete it.

LLChicletBar's constructor accepted an optional (const LLSD&). As the LLSD
parameter wasn't used, and as there is no evidence of it being passed from
anywhere, delete the parameter.

LLViewerWindow::shutdownViews() was checking LLNavigationBar::
instanceExists(), then deleting its getInstance() pointer -- leaving a
dangling LLSingleton instance pointer, a land mine if any subsequent code
should attempt to reference it. Use deleteSingleton() instead.

~LLAppViewer() was calling LLViewerEventRecorder::instance() and then
explicitly calling ~LLViewerEventRecorder() on that instance -- leaving the
LLSingleton instance pointer pointing to an allocated-but-destroyed instance.
Use deleteSingleton() instead.
2016-09-15 20:18:12 -04:00
Nat Goodspeed c92eb7e591 Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2016-08-30 11:36:06 -04:00
Nat Goodspeed 0c2442eb68 MAINT-5011: Fix abbreviateFile() test to run under .../indra/ path.
This particular test relied on there being exactly one instance of the string
"indra" in the source file's __FILE__ path -- which is usually true, but not
if the developer clones the viewer source repo under a parent directory whose
path itself contains "indra". Fix to handle any number of occurrences.
2016-08-29 18:48:47 +00:00
Nat Goodspeed 5e9d2f57c8 MAINT-5011: Use LLTHROW() instead of plain BOOST_THROW_EXCEPTION().
A level of preprocessor indirection lets us later change the implementation if
desired.
2016-08-17 11:36:24 -04:00
Nat Goodspeed 1ed76c382e MAINT-5011: Add llexception_test.cpp with tests (and conclusions).
llexception_test.cpp is an unusual test source in that it need not be verified
on every build, so its invocation in indra/llcommon/CMakeLists.txt is
commented out with that remark. Its purpose is to help a developer decide what
base class(es) to use for LLException, how to throw and how to catch.

Our current conclusions are written up as comments in llexception_test.cpp.

Added CRASH_ON_UNHANDLED_EXCEPTION() and LOG_UNHANDLED_EXCEPTION() macros to
llexception.h -- macros to log __FILE__, __LINE__ and __PRETTY_FUNCTION__ of
the catch site. These invoke functions in llexception.cpp so we don't need to
#include llerror.h for every possible catch site.
2016-08-17 10:45:06 -04:00
Glenn Glazer eb350761f7 MAINT=6585: remove extraneous path manipulation from llleap_test 2016-07-21 08:29:45 -07:00
Glenn Glazer 84f6b535ad MAINT=6585: fix llleap_test to use llbase not indra.base 2016-07-21 08:28:14 -07:00
Glenn Glazer 9e93d24b20 MAINT=6585: fix llsdserialize_test 2016-07-20 15:57:53 -07:00
Nat Goodspeed 9c49a6c91d MAINT-5011: Introduce LLException base class for viewer exceptions.
This also introduces LLContinueError for exceptions which should interrupt
some part of viewer processing (e.g. the current coroutine) but should attempt
to let the viewer session proceed.

Derive all existing viewer exception classes from LLException rather than from
std::runtime_error or std::logic_error.

Use BOOST_THROW_EXCEPTION() rather than plain 'throw' to enrich the thrown
exception with source file, line number and containing function.
2016-07-19 16:25:25 -04:00
Oz Linden 9be58e915a merge with 4.0.3-release 2016-04-04 15:53:09 -04:00
Rider Linden b8c1976460 Merge 2016-03-17 13:14:21 -07:00
Oz Linden 31f3db0291 merge changes for DRTVWR-417 2016-03-16 13:08:06 -04:00
Nat Goodspeed 2ee22ed264 MAINT-5976: Fix bug in LLCoros::set_consuming() mechanism.
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-18 18:06:32 -05:00
Nat Goodspeed 6a062089b8 MAINT-5976: Introduce LLCoros::set_consuming(bool).
set_consuming(true) tells each postAndSuspend() call to consume the event for
which it is suspending.
2015-12-16 17:13:04 -05:00
Nat Goodspeed 2ccbb77f3c WOLF-300: Try using a smaller data volume for LLLeap tests on Windows. 2015-11-18 17:22:57 -05:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Rider Linden a8ab084678 Tweek to naming postEventAndSuspend -> postAndSuspend 2015-09-18 11:54:38 -07:00