mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
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:
@@ -41,23 +41,23 @@ public:
|
||||
void testHeaders()
|
||||
{
|
||||
bh h1;
|
||||
expect(h1.empty());
|
||||
BEAST_EXPECT(h1.empty());
|
||||
fill(1, h1);
|
||||
expect(h1.size() == 1);
|
||||
BEAST_EXPECT(h1.size() == 1);
|
||||
bh h2;
|
||||
h2 = h1;
|
||||
expect(h2.size() == 1);
|
||||
BEAST_EXPECT(h2.size() == 1);
|
||||
h2.insert("2", "2");
|
||||
expect(std::distance(h2.begin(), h2.end()) == 2);
|
||||
BEAST_EXPECT(std::distance(h2.begin(), h2.end()) == 2);
|
||||
h1 = std::move(h2);
|
||||
expect(h1.size() == 2);
|
||||
expect(h2.size() == 0);
|
||||
BEAST_EXPECT(h1.size() == 2);
|
||||
BEAST_EXPECT(h2.size() == 0);
|
||||
bh h3(std::move(h1));
|
||||
expect(h3.size() == 2);
|
||||
expect(h1.size() == 0);
|
||||
BEAST_EXPECT(h3.size() == 2);
|
||||
BEAST_EXPECT(h1.size() == 0);
|
||||
self_assign(h3, std::move(h3));
|
||||
expect(h3.size() == 2);
|
||||
expect(h2.erase("Not-Present") == 0);
|
||||
BEAST_EXPECT(h3.size() == 2);
|
||||
BEAST_EXPECT(h2.erase("Not-Present") == 0);
|
||||
}
|
||||
|
||||
void testRFC2616()
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
h.insert("a", "x");
|
||||
h.insert("aa", "y");
|
||||
h.insert("b", "z");
|
||||
expect(h.count("a") == 2);
|
||||
BEAST_EXPECT(h.count("a") == 2);
|
||||
}
|
||||
|
||||
void testErase()
|
||||
@@ -77,9 +77,9 @@ public:
|
||||
h.insert("a", "x");
|
||||
h.insert("aa", "y");
|
||||
h.insert("b", "z");
|
||||
expect(h.size() == 4);
|
||||
BEAST_EXPECT(h.size() == 4);
|
||||
h.erase("a");
|
||||
expect(h.size() == 2);
|
||||
BEAST_EXPECT(h.size() == 2);
|
||||
}
|
||||
|
||||
void run() override
|
||||
|
||||
Reference in New Issue
Block a user