summaryrefslogtreecommitdiff
path: root/test/libapt/getlanguages_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/getlanguages_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/getlanguages_test.cc')
-rw-r--r--test/libapt/getlanguages_test.cc44
1 files changed, 22 insertions, 22 deletions
diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc
index 26ff66f72..7146c5af2 100644
--- a/test/libapt/getlanguages_test.cc
+++ b/test/libapt/getlanguages_test.cc
@@ -27,7 +27,7 @@ TEST(LanguagesTest,Environment)
env[1] = "";
std::vector<std::string> vec = APT::Configuration::getLanguages(false, false, env);
- ASSERT_EQ(3 ,vec.size());
+ ASSERT_EQ(3u, vec.size());
EXPECT_EQ("de_DE", vec[0]);
EXPECT_EQ("de", vec[1]);
EXPECT_EQ("en", vec[2]);
@@ -35,27 +35,27 @@ TEST(LanguagesTest,Environment)
// Special: Check if the cache is actually in use
env[0] = "en_GB.UTF-8";
vec = APT::Configuration::getLanguages(false, true, env);
- ASSERT_EQ(3, vec.size());
+ ASSERT_EQ(3u, vec.size());
EXPECT_EQ("de_DE", vec[0]);
EXPECT_EQ("de", vec[1]);
EXPECT_EQ("en", vec[2]);
env[0] = "en_GB.UTF-8";
vec = APT::Configuration::getLanguages(false, false, env);
- ASSERT_EQ(2, vec.size());
+ ASSERT_EQ(2u, vec.size());
EXPECT_EQ("en_GB", vec[0]);
EXPECT_EQ("en", vec[1]);
// esperanto
env[0] = "eo.UTF-8";
vec = APT::Configuration::getLanguages(false, false, env);
- ASSERT_EQ(2, vec.size());
+ ASSERT_EQ(2u, vec.size());
EXPECT_EQ("eo", vec[0]);
EXPECT_EQ("en", vec[1]);
env[0] = "tr_DE@euro";
vec = APT::Configuration::getLanguages(false, false, env);
- EXPECT_EQ(3, vec.size());
+ EXPECT_EQ(3u, vec.size());
EXPECT_EQ("tr_DE", vec[0]);
EXPECT_EQ("tr", vec[1]);
EXPECT_EQ("en", vec[2]);
@@ -63,7 +63,7 @@ TEST(LanguagesTest,Environment)
env[0] = "de_NO";
env[1] = "de_NO:en_GB:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en";
vec = APT::Configuration::getLanguages(false, false, env);
- EXPECT_EQ(6, vec.size());
+ EXPECT_EQ(6u, vec.size());
EXPECT_EQ("de_NO", vec[0]);
EXPECT_EQ("de", vec[1]);
EXPECT_EQ("en_GB", vec[2]);
@@ -74,21 +74,21 @@ TEST(LanguagesTest,Environment)
env[0] = "pt_PR.UTF-8";
env[1] = "";
vec = APT::Configuration::getLanguages(false, false, env);
- EXPECT_EQ(3, vec.size());
+ EXPECT_EQ(3u, vec.size());
EXPECT_EQ("pt_PR", vec[0]);
EXPECT_EQ("pt", vec[1]);
EXPECT_EQ("en", vec[2]);
env[0] = "ast_DE.UTF-8";
vec = APT::Configuration::getLanguages(false, false, env); // bogus, but syntactical correct
- EXPECT_EQ(3, vec.size());
+ EXPECT_EQ(3u, vec.size());
EXPECT_EQ("ast_DE", vec[0]);
EXPECT_EQ("ast", vec[1]);
EXPECT_EQ("en", vec[2]);
env[0] = "C";
vec = APT::Configuration::getLanguages(false, false, env);
- EXPECT_EQ(1, vec.size());
+ EXPECT_EQ(1u, vec.size());
EXPECT_EQ("en", vec[0]);
_config->Set("Acquire::Languages", "none");
@@ -99,25 +99,25 @@ TEST(LanguagesTest,Environment)
_config->Set("Acquire::Languages", "environment");
env[0] = "C";
vec = APT::Configuration::getLanguages(false, false, env);
- EXPECT_EQ(1, vec.size());
+ EXPECT_EQ(1u, vec.size());
EXPECT_EQ("en", vec[0]);
_config->Set("Acquire::Languages", "de");
env[0] = "C";
vec = APT::Configuration::getLanguages(false, false, env);
- EXPECT_EQ(1, vec.size());
+ EXPECT_EQ(1u, vec.size());
EXPECT_EQ("de", vec[0]);
_config->Set("Acquire::Languages", "fr");
env[0] = "ast_DE.UTF-8";
vec = APT::Configuration::getLanguages(false, false, env);
- EXPECT_EQ(1, vec.size());
+ EXPECT_EQ(1u, vec.size());
EXPECT_EQ("fr", vec[0]);
_config->Set("Acquire::Languages", "environment,en");
env[0] = "de_DE.UTF-8";
vec = APT::Configuration::getLanguages(false, false, env);
- EXPECT_EQ(3, vec.size());
+ EXPECT_EQ(3u, vec.size());
EXPECT_EQ("de_DE", vec[0]);
EXPECT_EQ("de", vec[1]);
EXPECT_EQ("en", vec[2]);
@@ -127,7 +127,7 @@ TEST(LanguagesTest,Environment)
_config->Set("Acquire::Languages::2", "en");
env[0] = "de_DE.UTF-8";
vec = APT::Configuration::getLanguages(false, false, env);
- EXPECT_EQ(3, vec.size());
+ EXPECT_EQ(3u, vec.size());
EXPECT_EQ("de_DE", vec[0]);
EXPECT_EQ("de", vec[1]);
EXPECT_EQ("en", vec[2]);
@@ -135,7 +135,7 @@ TEST(LanguagesTest,Environment)
_config->Set("Acquire::Languages::3", "de");
env[0] = "de_DE.UTF-8";
vec = APT::Configuration::getLanguages(false, false, env);
- EXPECT_EQ(3, vec.size());
+ EXPECT_EQ(3u, vec.size());
EXPECT_EQ("de_DE", vec[0]);
EXPECT_EQ("de", vec[1]);
EXPECT_EQ("en", vec[2]);
@@ -169,7 +169,7 @@ TEST(LanguagesTest,TranslationFiles)
_config->Set("Dir::State::lists", tempdir);
std::vector<std::string> vec = APT::Configuration::getLanguages(true, false, env);
- EXPECT_EQ(8, vec.size());
+ EXPECT_EQ(8u, vec.size());
EXPECT_EQ("de_DE", vec[0]);
EXPECT_EQ("de", vec[1]);
EXPECT_EQ("en", vec[2]);
@@ -187,7 +187,7 @@ TEST(LanguagesTest,TranslationFiles)
_config->Set("Acquire::Languages", "none");
vec = APT::Configuration::getLanguages(true, false, env);
- EXPECT_EQ(1, vec.size());
+ EXPECT_EQ(1u, vec.size());
EXPECT_EQ("none", vec[0]);
_config->Set("Acquire::Languages", "");
@@ -198,7 +198,7 @@ TEST(LanguagesTest,TranslationFiles)
EXPECT_TRUE(vec.empty());
env[0] = "de_DE.UTF-8";
vec = APT::Configuration::getLanguages(true, false, env);
- EXPECT_EQ(2, vec.size());
+ EXPECT_EQ(2u, vec.size());
EXPECT_EQ("en", vec[0]);
EXPECT_EQ("de", vec[1]);
@@ -206,13 +206,13 @@ TEST(LanguagesTest,TranslationFiles)
_config->Set("Acquire::Languages", "de_DE");
env[0] = "de_DE.UTF-8";
vec = APT::Configuration::getLanguages(false, false, env);
- EXPECT_EQ(1, vec.size());
+ EXPECT_EQ(1u, vec.size());
EXPECT_EQ("de_DE", vec[0]);
_config->Set("Acquire::Languages", "none");
env[0] = "de_DE.UTF-8";
vec = APT::Configuration::getLanguages(true, false, env);
- EXPECT_EQ(1, vec.size());
+ EXPECT_EQ(1u, vec.size());
EXPECT_EQ("none", vec[0]);
_error->PushToStack();
@@ -221,13 +221,13 @@ TEST(LanguagesTest,TranslationFiles)
_config->Set("APT::Acquire::Translation", "ast_DE");
env[0] = "de_DE.UTF-8";
vec = APT::Configuration::getLanguages(true, false, env);
- EXPECT_EQ(2, vec.size());
+ EXPECT_EQ(2u, vec.size());
EXPECT_EQ("ast_DE", vec[0]);
EXPECT_EQ("en", vec[1]);
_config->Set("APT::Acquire::Translation", "none");
env[0] = "de_DE.UTF-8";
vec = APT::Configuration::getLanguages(true, false, env);
- EXPECT_EQ(1, vec.size());
+ EXPECT_EQ(1u, vec.size());
EXPECT_EQ("en", vec[0]);
// discard the deprecation warning for APT::Acquire::Translation