aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/Support/YAMLIOTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Support/YAMLIOTest.cpp')
-rw-r--r--unittests/Support/YAMLIOTest.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/unittests/Support/YAMLIOTest.cpp b/unittests/Support/YAMLIOTest.cpp
index cf95532..8aed980 100644
--- a/unittests/Support/YAMLIOTest.cpp
+++ b/unittests/Support/YAMLIOTest.cpp
@@ -1204,9 +1204,9 @@ TEST(YAMLIO, TestValidatingInput) {
std::vector<MyValidation> docList;
Input yin("--- \nvalue: 3.0\n"
"--- \nvalue: -1.0\n...\n",
- NULL, suppressErrorMessages);
+ nullptr, suppressErrorMessages);
yin >> docList;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
@@ -1224,10 +1224,10 @@ TEST(YAMLIO, TestColorsReadError) {
"c2: purple\n"
"c3: green\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> map;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
@@ -1241,11 +1241,11 @@ TEST(YAMLIO, TestFlagsReadError) {
"f2: [ round, hollow ]\n"
"f3: []\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> map;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
@@ -1260,11 +1260,11 @@ TEST(YAMLIO, TestReadBuiltInTypesUint8Error) {
"- 0\n"
"- 257\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
@@ -1279,11 +1279,11 @@ TEST(YAMLIO, TestReadBuiltInTypesUint16Error) {
"- 0\n"
"- 66000\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
@@ -1298,11 +1298,11 @@ TEST(YAMLIO, TestReadBuiltInTypesUint32Error) {
"- 0\n"
"- 5000000000\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
@@ -1317,11 +1317,11 @@ TEST(YAMLIO, TestReadBuiltInTypesUint64Error) {
"- 0\n"
"- 19446744073709551615\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
@@ -1337,11 +1337,11 @@ TEST(YAMLIO, TestReadBuiltInTypesint8OverError) {
"- 127\n"
"- 128\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
//
@@ -1355,11 +1355,11 @@ TEST(YAMLIO, TestReadBuiltInTypesint8UnderError) {
"- 127\n"
"- -129\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
@@ -1375,11 +1375,11 @@ TEST(YAMLIO, TestReadBuiltInTypesint16UnderError) {
"- -32768\n"
"- -32769\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
@@ -1394,11 +1394,11 @@ TEST(YAMLIO, TestReadBuiltInTypesint16OverError) {
"- -32768\n"
"- 32768\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
@@ -1414,11 +1414,11 @@ TEST(YAMLIO, TestReadBuiltInTypesint32UnderError) {
"- -2147483648\n"
"- -2147483649\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
//
@@ -1432,11 +1432,11 @@ TEST(YAMLIO, TestReadBuiltInTypesint32OverError) {
"- -2147483648\n"
"- 2147483649\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
@@ -1452,11 +1452,11 @@ TEST(YAMLIO, TestReadBuiltInTypesint64UnderError) {
"- 9223372036854775807\n"
"- -9223372036854775809\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
//
@@ -1470,11 +1470,11 @@ TEST(YAMLIO, TestReadBuiltInTypesint64OverError) {
"- 9223372036854775807\n"
"- 9223372036854775809\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
//
@@ -1489,11 +1489,11 @@ TEST(YAMLIO, TestReadBuiltInTypesFloatError) {
"- -123.456\n"
"- 1.2.3\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
//
@@ -1508,11 +1508,11 @@ TEST(YAMLIO, TestReadBuiltInTypesDoubleError) {
"- -123.456\n"
"- 1.2.3\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
//
@@ -1526,11 +1526,11 @@ TEST(YAMLIO, TestReadBuiltInTypesHex8Error) {
"- 0xFE\n"
"- 0x123\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
@@ -1545,11 +1545,11 @@ TEST(YAMLIO, TestReadBuiltInTypesHex16Error) {
"- 0xFEFF\n"
"- 0x12345\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
//
@@ -1563,11 +1563,11 @@ TEST(YAMLIO, TestReadBuiltInTypesHex32Error) {
"- 0xFEFF0000\n"
"- 0x1234556789\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
//
@@ -1581,11 +1581,11 @@ TEST(YAMLIO, TestReadBuiltInTypesHex64Error) {
"- 0xFFEEDDCCBBAA9988\n"
"- 0x12345567890ABCDEF0\n"
"...\n",
- /*Ctxt=*/NULL,
+ /*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
TEST(YAMLIO, TestMalformedMapFailsGracefully) {
@@ -1593,15 +1593,15 @@ TEST(YAMLIO, TestMalformedMapFailsGracefully) {
{
// We pass the suppressErrorMessages handler to handle the error
// message generated in the constructor of Input.
- Input yin("{foo:3, bar: 5}", /*Ctxt=*/NULL, suppressErrorMessages);
+ Input yin("{foo:3, bar: 5}", /*Ctxt=*/nullptr, suppressErrorMessages);
yin >> doc;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
{
- Input yin("---\nfoo:3\nbar: 5\n...\n", /*Ctxt=*/NULL, suppressErrorMessages);
+ Input yin("---\nfoo:3\nbar: 5\n...\n", /*Ctxt=*/nullptr, suppressErrorMessages);
yin >> doc;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
}
@@ -1673,7 +1673,7 @@ TEST(YAMLIO, TestEmptyStringFailsForMapWithRequiredFields) {
FooBar doc;
Input yin("");
yin >> doc;
- EXPECT_TRUE(yin.error());
+ EXPECT_TRUE(!!yin.error());
}
TEST(YAMLIO, TestEmptyStringSucceedsForMapWithOptionalFields) {
@@ -1685,7 +1685,7 @@ TEST(YAMLIO, TestEmptyStringSucceedsForMapWithOptionalFields) {
TEST(YAMLIO, TestEmptyStringSucceedsForSequence) {
std::vector<uint8_t> seq;
- Input yin("", /*Ctxt=*/NULL, suppressErrorMessages);
+ Input yin("", /*Ctxt=*/nullptr, suppressErrorMessages);
yin >> seq;
EXPECT_FALSE(yin.error());