summaryrefslogtreecommitdiff
path: root/test/libapt/getlanguages_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/libapt/getlanguages_test.cc')
-rw-r--r--test/libapt/getlanguages_test.cc68
1 files changed, 34 insertions, 34 deletions
diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc
index f3629df68..fd3c8269f 100644
--- a/test/libapt/getlanguages_test.cc
+++ b/test/libapt/getlanguages_test.cc
@@ -1,7 +1,7 @@
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/configuration.h>
-#include <assert.h>
+#include "assert.h"
#include <string>
#include <vector>
@@ -17,75 +17,75 @@ void dumpVector(std::vector<std::string> vec) {
int main(int argc,char *argv[])
{
std::vector<std::string> vec = APT::Configuration::getLanguages(false, false, "de_DE.UTF-8");
- assert(vec.size() == 2);
- assert(vec[0] == "de");
- assert(vec[1] == "en");
+ equals(vec.size(), 2);
+ equals(vec[0], "de");
+ equals(vec[1], "en");
// Special: Check if the cache is actually in use
vec = APT::Configuration::getLanguages(false, true, "en_GB.UTF-8");
- assert(vec.size() == 2);
- assert(vec[0] == "de");
- assert(vec[1] == "en");
+ equals(vec.size(), 2);
+ equals(vec[0], "de");
+ equals(vec[1], "en");
vec = APT::Configuration::getLanguages(false, false, "en_GB.UTF-8");
- assert(vec.size() == 2);
- assert(vec[0] == "en_GB");
- assert(vec[1] == "en");
+ equals(vec.size(), 2);
+ equals(vec[0], "en_GB");
+ equals(vec[1], "en");
vec = APT::Configuration::getLanguages(false, false, "pt_PR.UTF-8");
- assert(vec.size() == 3);
- assert(vec[0] == "pt_PR");
- assert(vec[1] == "pt");
- assert(vec[2] == "en");
+ equals(vec.size(), 3);
+ equals(vec[0], "pt_PR");
+ equals(vec[1], "pt");
+ equals(vec[2], "en");
vec = APT::Configuration::getLanguages(false, false, "ast_DE.UTF-8"); // bogus, but syntactical correct
- assert(vec.size() == 2);
- assert(vec[0] == "ast");
- assert(vec[1] == "en");
+ equals(vec.size(), 2);
+ equals(vec[0], "ast");
+ equals(vec[1], "en");
vec = APT::Configuration::getLanguages(false, false, "C");
- assert(vec.size() == 1);
- assert(vec[0] == "en");
+ equals(vec.size(), 1);
+ equals(vec[0], "en");
_config->Set("Acquire::Languages::1", "environment");
_config->Set("Acquire::Languages::2", "en");
vec = APT::Configuration::getLanguages(false, false, "de_DE.UTF-8");
- assert(vec.size() == 2);
- assert(vec[0] == "de");
- assert(vec[1] == "en");
+ equals(vec.size(), 2);
+ equals(vec[0], "de");
+ equals(vec[1], "en");
_config->Set("Acquire::Languages::3", "de");
vec = APT::Configuration::getLanguages(false, false, "de_DE.UTF-8");
- assert(vec.size() == 2);
- assert(vec[0] == "de");
- assert(vec[1] == "en");
+ equals(vec.size(), 2);
+ equals(vec[0], "de");
+ equals(vec[1], "en");
_config->Set("Acquire::Languages::1", "none");
vec = APT::Configuration::getLanguages(false, false, "de_DE.UTF-8");
- assert(vec.size() == 0);
+ equals(vec.size(), 0);
vec = APT::Configuration::getLanguages(true, false, "de_DE.UTF-8");
- assert(vec[0] == "en");
- assert(vec[1] == "de");
+ equals(vec[0], "en");
+ equals(vec[1], "de");
_config->Set("Acquire::Languages::1", "fr");
_config->Set("Acquire::Languages", "de_DE");
vec = APT::Configuration::getLanguages(false, false, "de_DE.UTF-8");
- assert(vec.size() == 1);
- assert(vec[0] == "de_DE");
+ equals(vec.size(), 1);
+ equals(vec[0], "de_DE");
_config->Set("Acquire::Languages", "none");
vec = APT::Configuration::getLanguages(true, false, "de_DE.UTF-8");
- assert(vec.size() == 0);
+ equals(vec.size(), 0);
_config->Set("Acquire::Languages", "");
//FIXME: Remove support for this deprecated setting
_config->Set("APT::Acquire::Translation", "ast_DE");
vec = APT::Configuration::getLanguages(true, false, "de_DE.UTF-8");
- assert(vec.size() == 1);
- assert(vec[0] == "ast_DE");
+ equals(vec.size(), 1);
+ equals(vec[0], "ast_DE");
_config->Set("APT::Acquire::Translation", "none");
vec = APT::Configuration::getLanguages(true, false, "de_DE.UTF-8");
- assert(vec.size() == 0);
+ equals(vec.size(), 0);
return 0;
}