summaryrefslogtreecommitdiff
path: root/test/libapt/stringview_test.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2018-05-04 18:24:57 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2018-05-04 18:42:37 +0200
commit1d77c915005f7630949e2ce706055ee3235009b6 (patch)
treed10b246f29198a4085e2923a53e4d8bafff73bcc /test/libapt/stringview_test.cc
parent39d9e217a22901892647499ee695ba472a111d25 (diff)
Prevent GTest from flooding us with compiler warnings
GTest has a bunch of undefined macros which causes the compiler to spit out warnings for each one on each test file. There isn't much we can do, so we just disable the warning for the testcases. Other warnings like sign-promo and sign-compare we can avoid by being more explicit about our expected integer constants being unsigned. As we are just changing testcases, there is no user visible change which would deserve to be noted in the changelog. Gbp-Dch: Ignore Reported-By: gcc-8
Diffstat (limited to 'test/libapt/stringview_test.cc')
-rw-r--r--test/libapt/stringview_test.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/libapt/stringview_test.cc b/test/libapt/stringview_test.cc
index f215287d9..95fbe8906 100644
--- a/test/libapt/stringview_test.cc
+++ b/test/libapt/stringview_test.cc
@@ -16,17 +16,17 @@ TEST(StringViewTest,EmptyString)
static_assert( 0 == defString.length(), "def right size");
APT::StringView strString{std::string{}};
- EXPECT_EQ(0, strString.length());
+ EXPECT_EQ(0u, strString.length());
constexpr char const * const charp = "";
constexpr APT::StringView charpString{charp, 0};
static_assert( 0 == charpString.length(), "charp right size");
APT::StringView charp2String{charp};
- EXPECT_EQ(0, strString.length());
+ EXPECT_EQ(0u, strString.length());
const APT::StringView charaString{""};
- EXPECT_EQ(0, charaString.length());
+ EXPECT_EQ(0u, charaString.length());
EXPECT_TRUE(APT::StringView("") == "");
EXPECT_FALSE(APT::StringView("") != "");
@@ -39,22 +39,22 @@ TEST(StringViewTest,FooString)
EXPECT_EQ(0, defString.to_string().compare(0, defString.length(), defString.data(), 3));
APT::StringView strString{std::string{"foo"}};
- EXPECT_EQ(3, strString.length());
+ EXPECT_EQ(3u, strString.length());
EXPECT_EQ(0, strString.to_string().compare(0, strString.length(), strString.data(), 3));
constexpr char const * const charp = "fooGARBAGE";
constexpr APT::StringView charpString{charp, 3};
- EXPECT_EQ(3, charpString.length());
+ EXPECT_EQ(3u, charpString.length());
EXPECT_EQ(0, charpString.to_string().compare(0, charpString.length(), charpString.data(), 3));
char * charp2 = strdup("foo");
APT::StringView charp2String{charp2};
- EXPECT_EQ(3, charp2String.length());
+ EXPECT_EQ(3u, charp2String.length());
EXPECT_EQ(0, charp2String.to_string().compare(0, charp2String.length(), charp2String.data(), 3));
free(charp2);
const APT::StringView charaString{"foo"};
- EXPECT_EQ(3, charaString.length());
+ EXPECT_EQ(3u, charaString.length());
EXPECT_EQ(0, charaString.to_string().compare(0, charaString.length(), charaString.data(), 3));
EXPECT_TRUE(APT::StringView("foo") == "foo");