Skip to content
Snippets Groups Projects
Commit 5709a896 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Fix test build

parent ca88b3c9
No related branches found
No related tags found
No related merge requests found
...@@ -191,7 +191,7 @@ class LLDoubleDispatch ...@@ -191,7 +191,7 @@ class LLDoubleDispatch
insert(Type<Type1>(), Type<Type2>(), func, insertion); insert(Type<Type1>(), Type<Type2>(), func, insertion);
if (symmetrical) if (symmetrical)
{ {
insert(Type<Type2>(), Type<Type1>(), std::bind(func, _2, _1), insertion); insert(Type<Type2>(), Type<Type1>(), std::bind(func, std::placeholders::_2, std::placeholders::_1), insertion);
} }
} }
......
...@@ -153,27 +153,27 @@ namespace tut ...@@ -153,27 +153,27 @@ namespace tut
int countMessages() int countMessages()
{ {
return boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->countMessages(); return std::dynamic_pointer_cast<TestRecorder>(mRecorder)->countMessages();
} }
void clearMessages() void clearMessages()
{ {
boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->clearMessages(); std::dynamic_pointer_cast<TestRecorder>(mRecorder)->clearMessages();
} }
void setWantsTime(bool t) void setWantsTime(bool t)
{ {
boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->showTime(t); std::dynamic_pointer_cast<TestRecorder>(mRecorder)->showTime(t);
} }
void setWantsMultiline(bool t) void setWantsMultiline(bool t)
{ {
boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->showMultiline(t); std::dynamic_pointer_cast<TestRecorder>(mRecorder)->showMultiline(t);
} }
std::string message(int n) std::string message(int n)
{ {
return boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->message(n); return std::dynamic_pointer_cast<TestRecorder>(mRecorder)->message(n);
} }
void ensure_message_count(int expectedCount) void ensure_message_count(int expectedCount)
...@@ -497,12 +497,12 @@ namespace ...@@ -497,12 +497,12 @@ namespace
void testLogName(LLError::RecorderPtr recorder, LogFromFunction f, void testLogName(LLError::RecorderPtr recorder, LogFromFunction f,
const std::string& class_name = "") const std::string& class_name = "")
{ {
boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->clearMessages(); std::dynamic_pointer_cast<tut::TestRecorder>(recorder)->clearMessages();
std::string name = f(false); std::string name = f(false);
f(true); f(true);
std::string messageWithoutName = boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(0); std::string messageWithoutName = std::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(0);
std::string messageWithName = boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(1); std::string messageWithName = std::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(1);
ensure_has(name + " logged without name", ensure_has(name + " logged without name",
messageWithoutName, name); messageWithoutName, name);
...@@ -691,13 +691,13 @@ namespace tut ...@@ -691,13 +691,13 @@ namespace tut
LL_INFOS() << "boo" << LL_ENDL; LL_INFOS() << "boo" << LL_ENDL;
ensure_message_field_equals(0, MSG_FIELD, "boo"); ensure_message_field_equals(0, MSG_FIELD, "boo");
ensure_equals("alt recorder count", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 1); ensure_equals("alt recorder count", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 1);
ensure_contains("alt recorder message 0", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(0), "boo"); ensure_contains("alt recorder message 0", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(0), "boo");
LLError::setTimeFunction(roswell); LLError::setTimeFunction(roswell);
LLError::RecorderPtr anotherRecorder(new TestRecorder()); LLError::RecorderPtr anotherRecorder(new TestRecorder());
boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->showTime(true); std::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->showTime(true);
LLError::addRecorder(anotherRecorder); LLError::addRecorder(anotherRecorder);
LL_INFOS() << "baz" << LL_ENDL; LL_INFOS() << "baz" << LL_ENDL;
...@@ -705,10 +705,10 @@ namespace tut ...@@ -705,10 +705,10 @@ namespace tut
std::string when = roswell(); std::string when = roswell();
ensure_message_does_not_contain(1, when); ensure_message_does_not_contain(1, when);
ensure_equals("alt recorder count", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 2); ensure_equals("alt recorder count", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 2);
ensure_does_not_contain("alt recorder message 1", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(1), when); ensure_does_not_contain("alt recorder message 1", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(1), when);
ensure_equals("another recorder count", boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->countMessages(), 1); ensure_equals("another recorder count", std::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->countMessages(), 1);
ensure_contains("another recorder message 0", boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->message(0), when); ensure_contains("another recorder message 0", std::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->message(0), when);
LLError::removeRecorder(altRecorder); LLError::removeRecorder(altRecorder);
LLError::removeRecorder(anotherRecorder); LLError::removeRecorder(anotherRecorder);
......
...@@ -101,7 +101,7 @@ namespace tut ...@@ -101,7 +101,7 @@ namespace tut
int which; int which;
LLTestApp testApp; LLTestApp testApp;
void explicit_wait(boost::shared_ptr<LLCoros::Promise<std::string>>& cbp); void explicit_wait(std::shared_ptr<LLCoros::Promise<std::string>>& cbp);
void waitForEventOn1(); void waitForEventOn1();
void coroPump(); void coroPump();
void postAndWait1(); void postAndWait1();
...@@ -111,7 +111,7 @@ namespace tut ...@@ -111,7 +111,7 @@ namespace tut
typedef coroutine_group::object object; typedef coroutine_group::object object;
coroutine_group coroutinegrp("coroutine"); coroutine_group coroutinegrp("coroutine");
void test_data::explicit_wait(boost::shared_ptr<LLCoros::Promise<std::string>>& cbp) void test_data::explicit_wait(std::shared_ptr<LLCoros::Promise<std::string>>& cbp)
{ {
BEGIN BEGIN
{ {
...@@ -127,7 +127,7 @@ namespace tut ...@@ -127,7 +127,7 @@ namespace tut
// For test purposes, instead of handing 'callback' (or an // For test purposes, instead of handing 'callback' (or an
// adapter) off to some I/O subsystem, we'll just pass it back to // adapter) off to some I/O subsystem, we'll just pass it back to
// our caller. // our caller.
cbp = boost::make_shared<LLCoros::Promise<std::string>>(); cbp = std::make_shared<LLCoros::Promise<std::string>>();
LLCoros::Future<std::string> future = LLCoros::getFuture(*cbp); LLCoros::Future<std::string> future = LLCoros::getFuture(*cbp);
// calling get() on the future causes us to suspend // calling get() on the future causes us to suspend
...@@ -146,7 +146,7 @@ namespace tut ...@@ -146,7 +146,7 @@ namespace tut
DEBUG; DEBUG;
// Construct the coroutine instance that will run explicit_wait. // Construct the coroutine instance that will run explicit_wait.
boost::shared_ptr<LLCoros::Promise<std::string>> respond; std::shared_ptr<LLCoros::Promise<std::string>> respond;
LLCoros::instance().launch("test<1>", LLCoros::instance().launch("test<1>",
[this, &respond](){ explicit_wait(respond); }); [this, &respond](){ explicit_wait(respond); });
mSync.bump(); mSync.bump();
......
...@@ -218,12 +218,12 @@ class CaptureLog : public boost::noncopyable ...@@ -218,12 +218,12 @@ class CaptureLog : public boost::noncopyable
/// for the sought string. /// for the sought string.
std::string messageWith(const std::string& search, bool required=true) std::string messageWith(const std::string& search, bool required=true)
{ {
return boost::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->messageWith(search, required); return std::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->messageWith(search, required);
} }
std::ostream& streamto(std::ostream& out) const std::ostream& streamto(std::ostream& out) const
{ {
return boost::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->streamto(out); return std::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->streamto(out);
} }
private: private:
......
...@@ -92,7 +92,7 @@ namespace tut ...@@ -92,7 +92,7 @@ namespace tut
op->setReplyPath(LLCore::HttpOperation::HttpReplyQueuePtr_t(), h1); op->setReplyPath(LLCore::HttpOperation::HttpReplyQueuePtr_t(), h1);
// Check ref count // Check ref count
ensure(op.unique() == 1); ensure(op.use_count() == 1);
// release the reference, releasing the operation but // release the reference, releasing the operation but
// not the handlers. // not the handlers.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment