Age | Commit message (Collapse) | Author |
|
One operation we often use is to take an LLSD array of param names, a
corresponding LLSD array of values, and create from them a name=value LLSD
map. Instead of doing that "by hand" every time, use a function.
|
|
Streamline a bit more redundancy from the code in that test.
|
|
Following the C++ convention of having two distinct somethigna, somethingb
names, initially we introduced paramsa, paramsb LLSD arrays, following that
convention all the way down the line. This led to two distinct loops every
time we wanted to walk both arrays, since we didn't want to assume that they
were both the same size. But leveraging the fact that distinct LLSD arrays
stored in the same LLSD container can in fact be of different lengths,
refactored all the pairs of vars into top-level LLSD maps keyed by ["a"] and
["b"]. That lets us perform nested loops rather than duplicating the logic,
making test code much less messy.
|
|
Naively storing a const char* param in a const char* data member ignores the
fact that once the caller's done, the string data referenced by that pointer
will probably be freed. Store the referenced string in a std::string instead.
|
|
|
|
A certain popular-but-dumb compiler seems to think that initializing a
std::vector from a pair of iterators requires assignment. A struct containing
a reference cannot be assigned. Pointers get us past this issue.
|
|
We want to break out a couple different test methods that both need the same
data. While we could define a std::vector<FunctionsTriple> in the
lleventdispatcher_data class and initialize it using a classic {} initializer
as in array_funcs(), using a separate function puts it closer to the tests
consuming that data, and helps reduce clutter in the central data class.
Either way, it's cool that BOOST_FOREACH() handles the gory details of
iterating over a std::vector vs. a classic-C array.
|
|
|
|
You can't directly write:
BOOST_FOREACH(LLSD item, someLLSDarray) { ... }
because LLSD has two distinct iteration mechanisms, one for arrays and one for
maps, neither using the standard [const_]iterator typedefs or begin()/end()
methods. But with these helpers, you can write:
BOOST_FOREACH(LLSD item, llsd::inArray(someLLSDarray)) { ... }
or
BOOST_FOREACH(const llsd::MapEntry& pair, llsd::inMap(someLLSDmap)) { ... }
These are in namespace llsd instead of being (e.g.) llsd_inMap because with a
namespace at least your .cpp file can have a local 'using':
using namespace llsd;
BOOST_FOREACH(LLSD item, inArray(someLLSDarray)) { ... }
It's namespace llsd rather than LLSD because LLSD can't be both a namespace
and a class name.
|
|
Also, finally got sick of hand-writing the official iterator-loop idiom and
dragged in BOOST_FOREACH(). Because LLSD has two completely different
iteration styles, added inArray and inMap helper classes to be able to write:
BOOST_FOREACH(LLSD item, inArray(someArray)) { ... }
|
|
|
|
|
|
|
|
Previous tests involved a small handful of functions with only a couple
different parameter types. Now we exhaustively invoke every registration case,
plus every metadata query case. Call cases still pending.
|
|
Until now, LLEventAPI has only been able to register functions specifically
accepting(const LLSD&). Typically you add a wrapper method to your LLEventAPI
subclass, register that, have it extract desired params from the incoming LLSD
and then call the actual function of interest.
With help from Alain, added new LLEventAPI::add() methods capable of
registering functions/methods with arbitrary parameter signatures. The code
uses boost::fusion magic to implicitly match incoming LLSD arguments to the
function's formal parameter list, bypassing the need for an explicit helper
method.
New add() methods caused an ambiguity with a previous convenience overload.
Removed that overload and fixed the one existing usage.
Replaced LLEventDispatcher::get() with try_call() -- it's no longer easy to
return a Callable for caller to call directly. But the one known use of that
feature simply used it to avoid fatal LL_ERRS on unknown function-name string,
hence the try_call() approach actually addresses that case more directly.
Added indra/common/lleventdispatcher_test.cpp to exercise new functionality.
|
|
|
|
|
|
|
|
This makes logs look less scary on Linux, in-line with other platforms.
|
|
|
|
|
|
|
|
|
|
|
|
reviewed by Nat
|
|
For both the (so far unused) generic KEY form and the KEY = T* form, provide
key_iter, beginKeys(), endKeys().
Change instance_iter so that when dereferenced, it gives you a T& rather than
a T*, to be more harmonious with a typical STL container. (You parameterize
LLInstanceTracker with T, not with T*.)
Fix existing usage in llfasttimer.cpp and lltimer.cpp to agree.
For the KEY = T* specialization, add T* getInstance(T*) so client isn't forced
to know which variant was used.
Add unit tests for uniformity of public operations on both variants.
|
|
|
|
Migrate to the .cpp files where it's needed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test.
|
|
|
|
|
|
|
|
|
|
integration test.
|
|
|
|
integration test.
|
|
|
|
* turn llnamevalue_tut into a llmessage unit test
* turn llsdserialize_tut into a llcommon integration test
* re-enable the (quite slow) llsdserialize test on win32 now that it doesn't have to run on every recompile
* re-enable all llmessage unit tests on linux viewer builds
|
|
|
|
memcpy, don't actually use memcpy - use our own safe 'copy' method. also stripNonprintable() is probably a little faster now...
|
|
|
|
|
|
substitution case (EXT-1282, DEV-41081)
Also 'fix' string tests to match the new expected behaviour of LLStringUtil::format(). They must have been failing dreadfully before, but the legacy tut tests aren't run in a viewer-only build, so...
|
|
test.
|