From 416ab835aa4ba8e13d17e8b8ecb434aead3045de Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 1 Dec 2025 05:48:07 -0500 Subject: #5078 Replace boost::assign usage with modern c++ brace initialization Signed-off-by: Rye --- indra/test/llevents_tut.cpp | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'indra/test/llevents_tut.cpp') diff --git a/indra/test/llevents_tut.cpp b/indra/test/llevents_tut.cpp index bf5cd3f853..c5d5dcb9d4 100644 --- a/indra/test/llevents_tut.cpp +++ b/indra/test/llevents_tut.cpp @@ -44,15 +44,12 @@ #include // external library headers #include -#include // other Linden headers #include "tests/listener.h" // must PRECEDE lltut.h #include "lltut.h" #include "catch_and_store_what_in.h" #include "stringize.h" -using boost::assign::list_of; - template T make(const T& value) { @@ -178,7 +175,7 @@ void events_object::test<2>() LLBoundListener bound0 = listener0.listenTo(per_frame, &Listener::callstop); LLBoundListener bound1 = listener1.listenTo(per_frame, &Listener::call, // after listener0 - make(list_of(listener0.getName()))); + make(LLEventPump::NameList{ listener0.getName() })); ensure("enabled", per_frame.enabled()); ensure("connected 0", bound0.connected()); ensure("unblocked 0", !bound0.blocked()); @@ -278,24 +275,24 @@ void events_object::test<6>() button.listen("Mary", boost::bind(&Collect::add, boost::ref(collector), "Mary", _1), // state that "Mary" must come after "checked" - make (list_of("checked"))); + make(NameList{ "checked" })); button.listen("checked", boost::bind(&Collect::add, boost::ref(collector), "checked", _1), // "checked" must come after "spot" - make (list_of("spot"))); + make(NameList{ "spot" })); button.listen("spot", boost::bind(&Collect::add, boost::ref(collector), "spot", _1)); button.post(1); - ensure_equals(collector.result, make(list_of("spot")("checked")("Mary"))); + ensure_equals(collector.result, make(StringVec{ "spot", "checked", "Mary" })); collector.clear(); button.stopListening("Mary"); button.listen("Mary", boost::bind(&Collect::add, boost::ref(collector), "Mary", _1), LLEventPump::empty, // no after dependencies // now "Mary" must come before "spot" - make(list_of("spot"))); + make(NameList{ "spot" })); button.post(2); - ensure_equals(collector.result, make(list_of("Mary")("spot")("checked"))); + ensure_equals(collector.result, make(StringVec{ "Mary", "spot", "checked" })); collector.clear(); button.stopListening("spot"); std::string threw = catch_what( @@ -303,7 +300,7 @@ void events_object::test<6>() button.listen("spot", boost::bind(&Collect::add, boost::ref(collector), "spot", _1), // after "Mary" and "checked" -- whoops! - make(list_of("Mary")("checked"))); + make(NameList{ "Mary", "checked" })); }); // Obviously the specific wording of the exception text can // change; go ahead and change the test to match. @@ -321,20 +318,18 @@ void events_object::test<6>() ensure_contains("cyclic dependencies", threw, "after (\"Mary\", \"checked\") -> \"spot\""); button.listen("yellow", - boost::bind(&Collect::add, boost::ref(collector), "yellow", _1), - make(list_of("checked"))); + boost::bind(&Collect::add, boost::ref(collector), "yellow", _1), make(NameList{ "checked" })); button.listen("shoelaces", - boost::bind(&Collect::add, boost::ref(collector), "shoelaces", _1), - make(list_of("checked"))); + boost::bind(&Collect::add, boost::ref(collector), "shoelaces", _1), make(NameList{ "checked" })); button.post(3); - ensure_equals(collector.result, make(list_of("Mary")("checked")("yellow")("shoelaces"))); + ensure_equals(collector.result, make(StringVec{ "Mary", "checked", "yellow", "shoelaces" })); collector.clear(); threw = catch_what( [&button, &collector](){ button.listen("of", boost::bind(&Collect::add, boost::ref(collector), "of", _1), - make(list_of("shoelaces")), - make(list_of("yellow"))); + make(NameList{ "shoelaces" }), + make(NameList{ "yellow" })); }); // Same remarks about the specific wording of the exception. Just // ensure that it contains enough information to clarify the @@ -347,7 +342,7 @@ void events_object::test<6>() ensure_contains("old order", threw, "was: Mary, checked, yellow, shoelaces"); ensure_contains("new order", threw, "now: Mary, checked, shoelaces, of, yellow"); button.post(4); - ensure_equals(collector.result, make(list_of("Mary")("checked")("yellow")("shoelaces"))); + ensure_equals(collector.result, make(StringVec{ "Mary", "checked", "yellow", "shoelaces" })); } template<> template<> -- cgit v1.3