Poco 1.9.1 assert true (#2255)

* Rename assert by assertTrue

* Update submodules

* Missing assertTrue

* Rename poco_assertTrue to poco_assert

* Rename poco_assertTrue to poco_assert
This commit is contained in:
zosrothko
2018-03-29 19:12:54 +02:00
committed by Aleksandar Fabijanic
parent 5a1bf5eb4a
commit 960ecb38f0
232 changed files with 16274 additions and 16265 deletions

View File

@@ -129,19 +129,19 @@ void SyslogTest::testListener()
listener->open();
CachingChannel cl;
listener->addChannel(&cl);
assert (cl.getCurrentSize() == 0);
assertTrue (cl.getCurrentSize() == 0);
Poco::Message msg("asource", "amessage", Poco::Message::PRIO_CRITICAL);
channel->log(msg);
Poco::Thread::sleep(1000);
listener->close();
channel->close();
assert (cl.getCurrentSize() == 1);
assertTrue (cl.getCurrentSize() == 1);
std::vector<Poco::Message> msgs;
cl.getMessages(msgs, 0, 10);
assert (msgs.size() == 1);
assert (msgs[0].getSource() == "asource");
assert (msgs[0].getText() == "amessage");
assert (msgs[0].getPriority() == Poco::Message::PRIO_CRITICAL);
assertTrue (msgs.size() == 1);
assertTrue (msgs[0].getSource() == "asource");
assertTrue (msgs[0].getText() == "amessage");
assertTrue (msgs[0].getPriority() == Poco::Message::PRIO_CRITICAL);
}
@@ -155,11 +155,11 @@ void SyslogTest::testChannelOpenClose()
CachingChannel cl;
listener->addChannel(&cl);
assert (cl.getCurrentSize() == 0);
assertTrue (cl.getCurrentSize() == 0);
Poco::Message msg1("source1", "message1", Poco::Message::PRIO_CRITICAL);
channel->log(msg1);
Poco::Thread::sleep(1000);
assert (cl.getCurrentSize() == 1);
assertTrue (cl.getCurrentSize() == 1);
channel->close(); // close and re-open channel
channel->open();
@@ -167,20 +167,20 @@ void SyslogTest::testChannelOpenClose()
Poco::Message msg2("source2", "message2", Poco::Message::PRIO_ERROR);
channel->log(msg2);
Poco::Thread::sleep(1000);
assert (cl.getCurrentSize() == 2);
assertTrue (cl.getCurrentSize() == 2);
listener->close();
std::vector<Poco::Message> msgs;
cl.getMessages(msgs, 0, 10);
assert (msgs.size() == 2);
assertTrue (msgs.size() == 2);
assert (msgs[1].getSource() == "source1");
assert (msgs[1].getText() == "message1");
assert (msgs[1].getPriority() == Poco::Message::PRIO_CRITICAL);
assertTrue (msgs[1].getSource() == "source1");
assertTrue (msgs[1].getText() == "message1");
assertTrue (msgs[1].getPriority() == Poco::Message::PRIO_CRITICAL);
assert (msgs[0].getSource() == "source2");
assert (msgs[0].getText() == "message2");
assert (msgs[0].getPriority() == Poco::Message::PRIO_ERROR);
assertTrue (msgs[0].getSource() == "source2");
assertTrue (msgs[0].getText() == "message2");
assertTrue (msgs[0].getPriority() == Poco::Message::PRIO_ERROR);
}
@@ -194,20 +194,20 @@ void SyslogTest::testOldBSD()
listener->open();
CachingChannel cl;
listener->addChannel(&cl);
assert (cl.getCurrentSize() == 0);
assertTrue (cl.getCurrentSize() == 0);
Poco::Message msg("asource", "amessage", Poco::Message::PRIO_CRITICAL);
channel->log(msg);
Poco::Thread::sleep(1000);
listener->close();
channel->close();
assert (cl.getCurrentSize() == 1);
assertTrue (cl.getCurrentSize() == 1);
std::vector<Poco::Message> msgs;
cl.getMessages(msgs, 0, 10);
assert (msgs.size() == 1);
assertTrue (msgs.size() == 1);
// the source is lost with old BSD messages: we only send the local host name!
assert (msgs[0].getSource() == Poco::Net::DNS::thisHost().name());
assert (msgs[0].getText() == "amessage");
assert (msgs[0].getPriority() == Poco::Message::PRIO_CRITICAL);
assertTrue (msgs[0].getSource() == Poco::Net::DNS::thisHost().name());
assertTrue (msgs[0].getText() == "amessage");
assertTrue (msgs[0].getPriority() == Poco::Message::PRIO_CRITICAL);
}
@@ -220,7 +220,7 @@ void SyslogTest::testStructuredData()
listener->open();
CachingChannel cl;
listener->addChannel(&cl);
assert(cl.getCurrentSize() == 0);
assertTrue (cl.getCurrentSize() == 0);
Poco::Message msg1("asource", "amessage", Poco::Message::PRIO_CRITICAL);
msg1.set("structured-data", "[exampleSDID@32473 iut=\"3\" eventSource=\"Application\" eventID=\"1011\"]");
channel->log(msg1);
@@ -230,20 +230,20 @@ void SyslogTest::testStructuredData()
Poco::Thread::sleep(1000);
listener->close();
channel->close();
assert(cl.getCurrentSize() == 2);
assertTrue (cl.getCurrentSize() == 2);
std::vector<Poco::Message> msgs;
cl.getMessages(msgs, 0, 10);
assert(msgs.size() == 2);
assertTrue (msgs.size() == 2);
assert(msgs[0].getSource() == "asource");
assert(msgs[0].getText() == "amessage");
assert(msgs[0].getPriority() == Poco::Message::PRIO_CRITICAL);
assert(msgs[0].get("structured-data") == "[exampleSDID@32473 iut=\"3\" eventSource=\"Application\" eventID=\"1011\"][examplePriority@32473 class=\"high\"]");
assertTrue (msgs[0].getSource() == "asource");
assertTrue (msgs[0].getText() == "amessage");
assertTrue (msgs[0].getPriority() == Poco::Message::PRIO_CRITICAL);
assertTrue (msgs[0].get("structured-data") == "[exampleSDID@32473 iut=\"3\" eventSource=\"Application\" eventID=\"1011\"][examplePriority@32473 class=\"high\"]");
assert(msgs[1].getSource() == "asource");
assert(msgs[1].getText() == "amessage");
assert(msgs[1].getPriority() == Poco::Message::PRIO_CRITICAL);
assert(msgs[1].get("structured-data") == "[exampleSDID@32473 iut=\"3\" eventSource=\"Application\" eventID=\"1011\"]");
assertTrue (msgs[1].getSource() == "asource");
assertTrue (msgs[1].getText() == "amessage");
assertTrue (msgs[1].getPriority() == Poco::Message::PRIO_CRITICAL);
assertTrue (msgs[1].get("structured-data") == "[exampleSDID@32473 iut=\"3\" eventSource=\"Application\" eventID=\"1011\"]");
}