From 1d77c915005f7630949e2ce706055ee3235009b6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 4 May 2018 18:24:57 +0200 Subject: 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 --- test/libapt/commandline_test.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'test/libapt/commandline_test.cc') diff --git a/test/libapt/commandline_test.cc b/test/libapt/commandline_test.cc index 1dc9c6946..cde80b457 100644 --- a/test/libapt/commandline_test.cc +++ b/test/libapt/commandline_test.cc @@ -73,7 +73,7 @@ TEST(CommandLineTest,Parsing) CmdL.Parse(3 , argv); EXPECT_TRUE(c.FindB("Test::Worked", false)); EXPECT_EQ("yes", c.Find("Test::Worked", "no")); - EXPECT_EQ(0, CmdL.FileSize()); + EXPECT_EQ(0u, CmdL.FileSize()); } c.Clear("Test"); { @@ -81,7 +81,7 @@ TEST(CommandLineTest,Parsing) CmdL.Parse(2 , argv); EXPECT_TRUE(c.Exists("Test::Worked")); EXPECT_EQ("yes", c.Find("Test::Worked", "no")); - EXPECT_EQ(0, CmdL.FileSize()); + EXPECT_EQ(0u, CmdL.FileSize()); } c.Clear("Test"); { @@ -89,7 +89,7 @@ TEST(CommandLineTest,Parsing) CmdL.Parse(3 , argv); EXPECT_TRUE(c.Exists("Test::Worked")); EXPECT_EQ("no", c.Find("Test::Worked", "no")); - EXPECT_EQ(1, CmdL.FileSize()); + EXPECT_EQ(1u, CmdL.FileSize()); } c.Clear("Test"); @@ -98,7 +98,7 @@ TEST(CommandLineTest,Parsing) CmdL.Parse(3 , argv); EXPECT_TRUE(c.FindB("Test::Worked", false)); EXPECT_EQ("yes", c.Find("Test::Worked", "no")); - EXPECT_EQ(0, CmdL.FileSize()); + EXPECT_EQ(0u, CmdL.FileSize()); } c.Clear("Test"); { @@ -106,7 +106,7 @@ TEST(CommandLineTest,Parsing) CmdL.Parse(2 , argv); EXPECT_TRUE(c.Exists("Test::Worked")); EXPECT_EQ("yes", c.Find("Test::Worked", "no")); - EXPECT_EQ(0, CmdL.FileSize()); + EXPECT_EQ(0u, CmdL.FileSize()); } c.Clear("Test"); { @@ -114,7 +114,7 @@ TEST(CommandLineTest,Parsing) CmdL.Parse(3 , argv); EXPECT_TRUE(c.Exists("Test::Worked")); EXPECT_EQ("no", c.Find("Test::Worked", "no")); - EXPECT_EQ(1, CmdL.FileSize()); + EXPECT_EQ(1u, CmdL.FileSize()); } c.Clear("Test"); @@ -185,7 +185,7 @@ TEST(CommandLineTest,GetCommand) ASSERT_TRUE(CmdL.Parse(sizeof(argv)/sizeof(argv[0]), argv)); EXPECT_EQ(c.Find("APT::Default-Release"), "unstable"); EXPECT_TRUE(c.FindB("APT::Get::Download-Only")); - ASSERT_EQ(2, CmdL.FileSize()); + ASSERT_EQ(2u, CmdL.FileSize()); EXPECT_EQ(std::string(CmdL.FileList[0]), "remove"); EXPECT_EQ(std::string(CmdL.FileList[1]), "foo"); } @@ -199,7 +199,7 @@ TEST(CommandLineTest,GetCommand) ASSERT_TRUE(CmdL.Parse(sizeof(argv)/sizeof(argv[0]), argv)); EXPECT_EQ(c.Find("APT::Default-Release"), "unstable"); EXPECT_FALSE(c.FindB("APT::Get::Download-Only")); - ASSERT_EQ(3, CmdL.FileSize()); + ASSERT_EQ(3u, CmdL.FileSize()); EXPECT_EQ(std::string(CmdL.FileList[0]), "remove"); EXPECT_EQ(std::string(CmdL.FileList[1]), "-d"); EXPECT_EQ(std::string(CmdL.FileList[2]), "foo"); @@ -214,7 +214,7 @@ TEST(CommandLineTest,GetCommand) ASSERT_TRUE(CmdL.Parse(sizeof(argv)/sizeof(argv[0]), argv)); EXPECT_EQ(c.Find("APT::Default-Release"), "unstable"); EXPECT_FALSE(c.FindB("APT::Get::Download-Only")); - ASSERT_EQ(CmdL.FileSize(), 3); + ASSERT_EQ(3u, CmdL.FileSize()); EXPECT_EQ(std::string(CmdL.FileList[0]), "remove"); EXPECT_EQ(std::string(CmdL.FileList[1]), "-d"); EXPECT_EQ(std::string(CmdL.FileList[2]), "foo"); @@ -229,7 +229,7 @@ TEST(CommandLineTest,GetCommand) ASSERT_TRUE(CmdL.Parse(sizeof(argv)/sizeof(argv[0]), argv)); EXPECT_EQ(c.Find("APT::Default-Release"), "unstable"); EXPECT_FALSE(c.FindB("APT::Get::Download-Only")); - ASSERT_EQ(CmdL.FileSize(), 4); + ASSERT_EQ(4u, CmdL.FileSize()); EXPECT_EQ(std::string(CmdL.FileList[0]), "install"); EXPECT_EQ(std::string(CmdL.FileList[1]), "remove"); EXPECT_EQ(std::string(CmdL.FileList[2]), "-d"); -- cgit v1.2.3