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
2016-08-03 15:34:23 -04:00
parent 1537527927
commit 8d9c0daa9d
29 changed files with 573 additions and 565 deletions

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