From 7c8907522fe6600918dacc15ee138ca72b2cf35e Mon Sep 17 00:00:00 2001 From: AiraYumi Date: Sat, 6 Jan 2024 23:29:06 +0900 Subject: replace boost library to standard --- indra/llcommon/tests/llerror_test.cpp | 30 ++++++++++++------------- indra/llcommon/tests/lleventcoro_test.cpp | 8 +++---- indra/llcommon/tests/llinstancetracker_test.cpp | 4 ++-- indra/llcommon/tests/wrapllerrs.h | 4 ++-- 4 files changed, 23 insertions(+), 23 deletions(-) (limited to 'indra/llcommon/tests') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 148c18aabe..b4cdbdc6bf 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -153,27 +153,27 @@ namespace tut int countMessages() { - return boost::dynamic_pointer_cast(mRecorder)->countMessages(); + return std::dynamic_pointer_cast(mRecorder)->countMessages(); } void clearMessages() { - boost::dynamic_pointer_cast(mRecorder)->clearMessages(); + std::dynamic_pointer_cast(mRecorder)->clearMessages(); } void setWantsTime(bool t) { - boost::dynamic_pointer_cast(mRecorder)->showTime(t); + std::dynamic_pointer_cast(mRecorder)->showTime(t); } void setWantsMultiline(bool t) { - boost::dynamic_pointer_cast(mRecorder)->showMultiline(t); + std::dynamic_pointer_cast(mRecorder)->showMultiline(t); } std::string message(int n) { - return boost::dynamic_pointer_cast(mRecorder)->message(n); + return std::dynamic_pointer_cast(mRecorder)->message(n); } void ensure_message_count(int expectedCount) @@ -497,12 +497,12 @@ namespace void testLogName(LLError::RecorderPtr recorder, LogFromFunction f, const std::string& class_name = "") { - boost::dynamic_pointer_cast(recorder)->clearMessages(); + std::dynamic_pointer_cast(recorder)->clearMessages(); std::string name = f(false); f(true); - std::string messageWithoutName = boost::dynamic_pointer_cast(recorder)->message(0); - std::string messageWithName = boost::dynamic_pointer_cast(recorder)->message(1); + std::string messageWithoutName = std::dynamic_pointer_cast(recorder)->message(0); + std::string messageWithName = std::dynamic_pointer_cast(recorder)->message(1); ensure_has(name + " logged without name", messageWithoutName, name); @@ -691,13 +691,13 @@ namespace tut LL_INFOS() << "boo" << LL_ENDL; ensure_message_field_equals(0, MSG_FIELD, "boo"); - ensure_equals("alt recorder count", boost::dynamic_pointer_cast(altRecorder)->countMessages(), 1); - ensure_contains("alt recorder message 0", boost::dynamic_pointer_cast(altRecorder)->message(0), "boo"); + ensure_equals("alt recorder count", std::dynamic_pointer_cast(altRecorder)->countMessages(), 1); + ensure_contains("alt recorder message 0", std::dynamic_pointer_cast(altRecorder)->message(0), "boo"); LLError::setTimeFunction(roswell); LLError::RecorderPtr anotherRecorder(new TestRecorder()); - boost::dynamic_pointer_cast(anotherRecorder)->showTime(true); + std::dynamic_pointer_cast(anotherRecorder)->showTime(true); LLError::addRecorder(anotherRecorder); LL_INFOS() << "baz" << LL_ENDL; @@ -705,10 +705,10 @@ namespace tut std::string when = roswell(); ensure_message_does_not_contain(1, when); - ensure_equals("alt recorder count", boost::dynamic_pointer_cast(altRecorder)->countMessages(), 2); - ensure_does_not_contain("alt recorder message 1", boost::dynamic_pointer_cast(altRecorder)->message(1), when); - ensure_equals("another recorder count", boost::dynamic_pointer_cast(anotherRecorder)->countMessages(), 1); - ensure_contains("another recorder message 0", boost::dynamic_pointer_cast(anotherRecorder)->message(0), when); + ensure_equals("alt recorder count", std::dynamic_pointer_cast(altRecorder)->countMessages(), 2); + ensure_does_not_contain("alt recorder message 1", std::dynamic_pointer_cast(altRecorder)->message(1), when); + ensure_equals("another recorder count", std::dynamic_pointer_cast(anotherRecorder)->countMessages(), 1); + ensure_contains("another recorder message 0", std::dynamic_pointer_cast(anotherRecorder)->message(0), when); LLError::removeRecorder(altRecorder); LLError::removeRecorder(anotherRecorder); diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp index 032923a108..01104545c6 100644 --- a/indra/llcommon/tests/lleventcoro_test.cpp +++ b/indra/llcommon/tests/lleventcoro_test.cpp @@ -101,7 +101,7 @@ namespace tut int which; LLTestApp testApp; - void explicit_wait(boost::shared_ptr>& cbp); + void explicit_wait(std::shared_ptr>& cbp); void waitForEventOn1(); void coroPump(); void postAndWait1(); @@ -111,7 +111,7 @@ namespace tut typedef coroutine_group::object object; coroutine_group coroutinegrp("coroutine"); - void test_data::explicit_wait(boost::shared_ptr>& cbp) + void test_data::explicit_wait(std::shared_ptr>& cbp) { BEGIN { @@ -127,7 +127,7 @@ namespace tut // For test purposes, instead of handing 'callback' (or an // adapter) off to some I/O subsystem, we'll just pass it back to // our caller. - cbp = boost::make_shared>(); + cbp = std::make_shared>(); LLCoros::Future future = LLCoros::getFuture(*cbp); // calling get() on the future causes us to suspend @@ -146,7 +146,7 @@ namespace tut DEBUG; // Construct the coroutine instance that will run explicit_wait. - boost::shared_ptr> respond; + std::shared_ptr> respond; LLCoros::instance().launch("test<1>", [this, &respond](){ explicit_wait(respond); }); mSync.bump(); diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp index 5daa29adf4..95af9c2a50 100644 --- a/indra/llcommon/tests/llinstancetracker_test.cpp +++ b/indra/llcommon/tests/llinstancetracker_test.cpp @@ -94,7 +94,7 @@ namespace tut ensure("couldn't find stack Keyed", bool(found)); ensure_equals("found wrong Keyed instance", found.get(), &one); { - boost::scoped_ptr two(new Keyed("two")); + std::unique_ptr two(new Keyed("two")); ensure_equals(Keyed::instanceCount(), 2); auto found = Keyed::getInstance("two"); ensure("couldn't find heap Keyed", bool(found)); @@ -118,7 +118,7 @@ namespace tut std::weak_ptr found = one.getWeak(); ensure(! found.expired()); { - boost::scoped_ptr two(new Unkeyed); + std::unique_ptr two(new Unkeyed); ensure_equals(Unkeyed::instanceCount(), 2); } ensure_equals(Unkeyed::instanceCount(), 1); diff --git a/indra/llcommon/tests/wrapllerrs.h b/indra/llcommon/tests/wrapllerrs.h index d657b329bb..6978c296b3 100644 --- a/indra/llcommon/tests/wrapllerrs.h +++ b/indra/llcommon/tests/wrapllerrs.h @@ -218,12 +218,12 @@ public: /// for the sought string. std::string messageWith(const std::string& search, bool required=true) { - return boost::dynamic_pointer_cast(mRecorder)->messageWith(search, required); + return std::dynamic_pointer_cast(mRecorder)->messageWith(search, required); } std::ostream& streamto(std::ostream& out) const { - return boost::dynamic_pointer_cast(mRecorder)->streamto(out); + return std::dynamic_pointer_cast(mRecorder)->streamto(out); } friend inline std::ostream& operator<<(std::ostream& out, const CaptureLog& self) -- cgit v1.2.3