<feed xmlns='http://www.w3.org/2005/Atom'>
<title>viewer.git/indra/llcommon/tests/lleventdispatcher_test.cpp, branch cef_147</title>
<subtitle>Megapahit's fork of the Second Life viewer.
</subtitle>
<id>https://megapahit.org/viewer.git/atom?h=cef_147</id>
<link rel='self' href='https://megapahit.org/viewer.git/atom?h=cef_147'/>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/'/>
<updated>2025-12-01T10:46:57Z</updated>
<entry>
<title>#5078 Replace boost::function with std::function</title>
<updated>2025-12-01T10:46:57Z</updated>
<author>
<name>Rye</name>
<email>rye@alchemyviewer.org</email>
</author>
<published>2025-12-01T10:46:57Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=fb3f0e18a2ada57f98c3b10fab0c13fb2d504ae1'/>
<id>urn:sha1:fb3f0e18a2ada57f98c3b10fab0c13fb2d504ae1</id>
<content type='text'>
* Replace boost::function usage with std::function for easier debugging and reduced compiler warnings
* Remove a few remaining instances of boost::noncopyable that were missed in tests

Signed-off-by: Rye &lt;rye@alchemyviewer.org&gt;</content>
</entry>
<entry>
<title>Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings</title>
<updated>2024-06-01T13:49:26Z</updated>
<author>
<name>Ansariel</name>
<email>ansariel.hiller@phoenixviewer.com</email>
</author>
<published>2024-06-01T13:49:26Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=b42f9d836b4c0f7fbd4bdae1734021e2a09fdbe8'/>
<id>urn:sha1:b42f9d836b4c0f7fbd4bdae1734021e2a09fdbe8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>#824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed</title>
<updated>2024-04-29T04:56:09Z</updated>
<author>
<name>Andrey Lihatskiy</name>
<email>alihatskiy@productengine.com</email>
</author>
<published>2024-04-29T04:43:28Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=1b68f71348ecf3983b76b40d7940da8377f049b7'/>
<id>urn:sha1:1b68f71348ecf3983b76b40d7940da8377f049b7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>DRTVWR-587: Fix LL::apply(function, LLSD array).</title>
<updated>2023-10-29T15:56:17Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2023-10-29T15:56:17Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=f7d2d40b3057f5bc249c88784b35443aad8de7aa'/>
<id>urn:sha1:f7d2d40b3057f5bc249c88784b35443aad8de7aa</id>
<content type='text'>
We define a specialization of LLSDParam&lt;const char*&gt; to support passing an
LLSD object to a const char* function parameter. Needless to remark, passing
object.asString().c_str() would be Bad: destroying the temporary std::string
returned by asString() would immediately invalidate the pointer returned by
its c_str(). But when you pass LLSDParam&lt;const char*&gt;(object) as the
parameter, that specialization itself stores the std::string so the c_str()
pointer remains valid as long as the LLSDParam object does.

Then there's LLSDParam&lt;LLSD&gt;, used when we don't have the parameter type
available to select the LLSDParam specialization. LLSDParam&lt;LLSD&gt; defines a
templated conversion operator T() that constructs an LLSDParam&lt;T&gt; to provide
the actual parameter value. So far, so good.

The trouble was with the implementation of LLSDParam&lt;LLSD&gt;: it constructed a
_temporary_ LLSDParam&lt;T&gt;, implicitly called its operator T() and immediately
destroyed it. Destroying LLSDParam&lt;const char*&gt; destroyed its stored string,
thus invalidating the c_str() pointer before the target function was entered.

Instead, make LLSDParam&lt;LLSD&gt;::operator T() capture each LLSDParam&lt;T&gt; it
constructs, extending its lifespan to the lifespan of the LLSDParam&lt;LLSD&gt;
instance. For this, derive each LLSDParam specialization from LLSDParamBase, a
trivial base class that simply establishes the virtual destructor. We can then
capture any specialization as a pointer to LLSDParamBase.

Also restore LazyEventAPI tests on Mac.
</content>
</entry>
<entry>
<title>DRTVWR-587: Skip Visual Studio LLSDParam&lt;const char*&gt; tests for now.</title>
<updated>2023-10-27T19:40:20Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2023-10-27T19:40:20Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=2667653d41d3b4799bf319783a884cbac7f826da'/>
<id>urn:sha1:2667653d41d3b4799bf319783a884cbac7f826da</id>
<content type='text'>
They do work fine on clang... unblocking the rest of the team during diagnosis.
</content>
</entry>
<entry>
<title>DRTVWR-587: Skip some tests that only fail with older Visual Studio</title>
<updated>2023-07-28T01:09:50Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2023-07-28T01:09:50Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=6a77d333d3eb876ccd64324c09cf63c0989164ca'/>
<id>urn:sha1:6a77d333d3eb876ccd64324c09cf63c0989164ca</id>
<content type='text'>
</content>
</entry>
<entry>
<title>DRTVWR-558: Fix a few lleventdispatcher_test merge glitches.</title>
<updated>2023-07-13T19:58:37Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2023-07-13T19:58:37Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=7d1a3d70373f2988510eccf7dd8f9bd2f6c2694a'/>
<id>urn:sha1:7d1a3d70373f2988510eccf7dd8f9bd2f6c2694a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>DRTVWR-558: Extend LLEventDispatcher::add() overloads.</title>
<updated>2023-07-13T16:49:09Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2023-01-21T03:34:31Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=2c894ecb25de044f5cb9c408c5264e5234b73983'/>
<id>urn:sha1:2c894ecb25de044f5cb9c408c5264e5234b73983</id>
<content type='text'>
Add LL::always_return&lt;T&gt;(), which takes a callable and variadic arguments. It
calls the callable with those arguments and, if the returned type is
convertible to T, converts it and returns it. Otherwise it returns T().
always_return() is generalized from, and supersedes,
LLEventDispatcher::ReturnLLSD.

Add LL::function_arity&lt;CALLABLE&gt;, which extends
boost::function_types::function_arity by reporting results for both
std::function&lt;CALLABLE&gt; and boost::function&lt;CALLABLE&gt;. Use for
LL::apply(function, LLSD array) as well as for LLEventDispatcher.

Make LLEventDispatcher::add() overloads uniformly distinguish between a
callable (whether non-static member function or otherwise) that accepts a
single LLSD parameter, versus any other signature. Accepting exactly one LLSD
parameter signals that the callable will accept the composite arguments LLSD
blob, instead of asking LLEventDispatcher to unpack the arguments blob into
individual arguments.

Support add(subclass method) overloads for arbitrary-parameters methods as
well as for (const LLSD&amp;) methods. Update tests accordingly: we need no longer
pass the boilerplate lambda instance getter that binds and returns 'this'.

Extract to the two LLEventDispatcher::make_invoker() overloads the LL::apply()
logic formerly found in ReturnLLSD.

Change lleventdispatcher_test.cpp tests from boost::bind(), which accepts
variadic arguments (even though it only passes a fixed set to the target
callable), to fixed-signature lambdas. This is because the revamped add()
overloads care about signature.

Add a test for a non-static method that accepts (const LLSD&amp;), in other words
the composite arguments LLSD blob, and likewise returns LLSD.

(cherry picked from commit 95b787f7d7226ee9de79dfc9816f33c8bf199aad)
</content>
</entry>
<entry>
<title>DRTVWR-558: Add tests for batched LLDispatchListener operations.</title>
<updated>2023-07-13T16:49:08Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2023-01-14T04:07:24Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=b36deb79c2e99bfa600b5895c277ffb78c61957f'/>
<id>urn:sha1:b36deb79c2e99bfa600b5895c277ffb78c61957f</id>
<content type='text'>
Specifically, add tests for:

- successful map batch
- map batch with some errors and a reply pump
- map batch with some errors and no reply
- successful array batch
- array batch with some errors and a reply pump
- array batch with some errors and no reply

(cherry picked from commit 078f0f5c9fb5075a8ad01cac417e1d7ee2b6a919)
</content>
</entry>
<entry>
<title>DRTVWR-558: Make DispatchResult methods use their arguments.</title>
<updated>2023-07-13T16:49:08Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2023-01-14T02:53:18Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=98793b8d44b32604033bd1b280f37023c86055bb'/>
<id>urn:sha1:98793b8d44b32604033bd1b280f37023c86055bb</id>
<content type='text'>
Fix lleventdispatcher_test.cpp's test class DispatchResult::strfunc(),
intfunc(), mapfunc() and arrayfunc() to return values derived from (not
identical to) their arguments, so we can reuse these functions for further
testing of passing arguments to a named callable. Adjust existing tests
accordingly.

(cherry picked from commit 07e09a8daea008d28b97399920db60a147cf75c0)
</content>
</entry>
</feed>
