From 491058e3570ec66769c4e7e9797f549c6d724848 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 13 Jan 2011 23:22:17 +0100 Subject: ignore non-regular files in GetListOfFilesInDir (Closes: #594694) --- test/libapt/run-tests | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/libapt') diff --git a/test/libapt/run-tests b/test/libapt/run-tests index f5fc03446..a66de386d 100755 --- a/test/libapt/run-tests +++ b/test/libapt/run-tests @@ -39,6 +39,11 @@ do "${tmppath}/invälid.conf" \ "${tmppath}/invalíd" \ "${tmppath}/01invalíd" + mkdir "${tmppath}/invaliddir" \ + "${tmppath}/directory.conf" \ + "${tmppath}/directory.list" \ + "${tmppath}/directory.wron" \ + "${tmppath}/directory.list.disabled" ln -s "${tmppath}/anormalfile" "${tmppath}/linkedfile.list" ln -s "${tmppath}/non-existing-file" "${tmppath}/brokenlink.list" elif [ $name = "getLanguages${EXT}" ]; then -- cgit v1.2.3 From ab53c018fbc7aa01c0d89586c0aa98bc944dd9e4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 28 Jan 2011 12:22:37 +0100 Subject: - download and use i18n/Index to choose which Translations to download * apt-pkg/aptconfiguration.cc: - remove the inbuilt Translation files whitelist --- test/libapt/getlanguages_test.cc | 71 ++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 31 deletions(-) (limited to 'test/libapt') diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc index 3559aae0c..707142aef 100644 --- a/test/libapt/getlanguages_test.cc +++ b/test/libapt/getlanguages_test.cc @@ -26,16 +26,18 @@ int main(int argc,char *argv[]) env[1] = ""; std::vector vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 2); - equals(vec[0], "de"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); // Special: Check if the cache is actually in use env[0] = "en_GB.UTF-8"; vec = APT::Configuration::getLanguages(false, true, env); - equals(vec.size(), 2); - equals(vec[0], "de"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); env[0] = "en_GB.UTF-8"; vec = APT::Configuration::getLanguages(false, false, env); @@ -52,19 +54,21 @@ int main(int argc,char *argv[]) env[0] = "tr_DE@euro"; vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 2); - equals(vec[0], "tr"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "tr_DE"); + equals(vec[1], "tr"); + equals(vec[2], "en"); env[0] = "de_NO"; - env[1] = "se_NO:en_GB:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en"; + 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); - equals(vec.size(), 5); - equals(vec[0], "de"); - equals(vec[1], "en_GB"); - equals(vec[2], "nb"); - equals(vec[3], "no"); - equals(vec[4], "en"); + equals(vec.size(), 6); + equals(vec[0], "de_NO"); + equals(vec[1], "de"); + equals(vec[2], "en_GB"); + equals(vec[3], "nb_NO"); + equals(vec[4], "nb"); + equals(vec[5], "en"); env[0] = "pt_PR.UTF-8"; env[1] = ""; @@ -76,9 +80,10 @@ int main(int argc,char *argv[]) env[0] = "ast_DE.UTF-8"; vec = APT::Configuration::getLanguages(false, false, env); // bogus, but syntactical correct - equals(vec.size(), 2); - equals(vec[0], "ast"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "ast_DE"); + equals(vec[1], "ast"); + equals(vec[2], "en"); env[0] = "C"; vec = APT::Configuration::getLanguages(false, false, env); @@ -113,25 +118,28 @@ int main(int argc,char *argv[]) _config->Set("Acquire::Languages::2", "en"); env[0] = "de_DE.UTF-8"; vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 2); - equals(vec[0], "de"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); _config->Set("Acquire::Languages::3", "de"); env[0] = "de_DE.UTF-8"; vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 2); - equals(vec[0], "de"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); _config->Set("Dir::State::lists", argv[1]); vec = APT::Configuration::getLanguages(true, false, env); - equals(vec.size(), 5); - equals(vec[0], "de"); - equals(vec[1], "en"); - equals(vec[2], "none"); - equals(vec[3], "pt"); - equals(vec[4], "tr"); + equals(vec.size(), 6); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); + equals(vec[3], "none"); + equals(vec[4], "pt"); + equals(vec[5], "tr"); _config->Set("Dir::State::lists", "/non-existing-dir"); _config->Set("Acquire::Languages::1", "none"); @@ -140,6 +148,7 @@ int main(int argc,char *argv[]) equals(vec.size(), 0); env[0] = "de_DE.UTF-8"; vec = APT::Configuration::getLanguages(true, false, env); + equals(vec.size(), 2); equals(vec[0], "en"); equals(vec[1], "de"); -- cgit v1.2.3