Add BEAST_EXPECT macro:

This macro is used in the unit test framework to assist in
reporting the file and line number of test failures.
This commit is contained in:
Vinnie Falco committed 2017-07-20 08:12:07 -07:00
1 parent c07ba6aeeb
commit b2ea40c757
29 files changed
+573 -565

No files matched your search

+10 -10
View File
@@ -32,8 +32,8 @@ public:
dynabuf_readstream<socket_type, streambuf> srs(ios);
dynabuf_readstream<socket_type, streambuf> srs2(std::move(srs));
srs = std::move(srs2);
expect(&srs.get_io_service() == &ios);
expect(&srs.get_io_service() == &srs2.get_io_service());
BEAST_EXPECT(&srs.get_io_service() == &ios);
BEAST_EXPECT(&srs.get_io_service() == &srs2.get_io_service());
}
{
socket_type sock(ios);
@@ -63,11 +63,11 @@ public:
boost::asio::read(srs, buffer(&s[0], s.size()), ec);
if(! ec)
{
expect(s == "Hello, world!");
BEAST_EXPECT(s == "Hello, world!");
break;
}
}
expect(n < limit);
BEAST_EXPECT(n < limit);
for(n = 0; n < limit; ++n)
{
@@ -82,11 +82,11 @@ public:
boost::asio::read(srs, buffer(&s[0], s.size()), ec);
if(! ec)
{
expect(s == "Hello, world!");
BEAST_EXPECT(s == "Hello, world!");
break;
}
}
expect(n < limit);
BEAST_EXPECT(n < limit);
for(n = 0; n < limit; ++n)
{
@@ -101,11 +101,11 @@ public:
srs, buffer(&s[0], s.size()), do_yield[ec]);
if(! ec)
{
expect(s == "Hello, world!");
BEAST_EXPECT(s == "Hello, world!");
break;
}
}
expect(n < limit);
BEAST_EXPECT(n < limit);
for(n = 0; n < limit; ++n)
{
@@ -121,11 +121,11 @@ public:
srs, buffer(&s[0], s.size()), do_yield[ec]);
if(! ec)
{
expect(s == "Hello, world!");
BEAST_EXPECT(s == "Hello, world!");
break;
}
}
expect(n < limit);
BEAST_EXPECT(n < limit);
}
void run() override