X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/41a658f873a36e2f8507a84fb40f0632e2a62b15..173fa882cf3396ab6d2a9be53c6ea23eda225a1d:/test/libapt/indexcopytosourcelist_test.cc diff --git a/test/libapt/indexcopytosourcelist_test.cc b/test/libapt/indexcopytosourcelist_test.cc index bec87601f..eb6d49edf 100644 --- a/test/libapt/indexcopytosourcelist_test.cc +++ b/test/libapt/indexcopytosourcelist_test.cc @@ -9,16 +9,16 @@ #include -class NoCopy : public IndexCopy { +class NoCopy : private IndexCopy { public: - std::string ConvertToSourceList(std::string CD,std::string Path) { + std::string ConvertToSourceList(std::string const &CD,std::string &&Path) { IndexCopy::ConvertToSourceList(CD, Path); return Path; } - bool GetFile(std::string &/*Filename*/, unsigned long long &/*Size*/) { return false; } - bool RewriteEntry(FILE * /*Target*/, std::string /*File*/) { return false; } - const char *GetFileName() { return NULL; } - const char *Type() { return NULL; } + bool GetFile(std::string &/*Filename*/, unsigned long long &/*Size*/) APT_OVERRIDE { return false; } + bool RewriteEntry(FileFd & /*Target*/, std::string const &/*File*/) APT_OVERRIDE { return false; } + const char *GetFileName() APT_OVERRIDE { return NULL; } + const char *Type() APT_OVERRIDE { return NULL; } }; @@ -44,13 +44,20 @@ TEST(IndexCopyTest, ConvertToSourceList) std::string const S = Path + "source/"; std::string const List = std::string(*Release) + " " + *Component; + { + SCOPED_TRACE("no archs configured"); _config->Clear("APT"); + _config->Set("APT::Architecture", "all"); + _config->Set("APT::Architectures::", "all"); APT::Configuration::getArchitectures(false); EXPECT_EQ(A, ic.ConvertToSourceList("/media/cdrom/", CD + A)); EXPECT_EQ(B, ic.ConvertToSourceList("/media/cdrom/", CD + B)); EXPECT_EQ(C, ic.ConvertToSourceList("/media/cdrom/", CD + C)); EXPECT_EQ(List, ic.ConvertToSourceList("/media/cdrom/", CD + S)); + } + { + SCOPED_TRACE("mips configured"); _config->Clear("APT"); _config->Set("APT::Architecture", "mips"); _config->Set("APT::Architectures::", "mips"); @@ -59,7 +66,10 @@ TEST(IndexCopyTest, ConvertToSourceList) EXPECT_EQ(List, ic.ConvertToSourceList("/media/cdrom/", CD + B)); EXPECT_EQ(C, ic.ConvertToSourceList("/media/cdrom/", CD + C)); EXPECT_EQ(List, ic.ConvertToSourceList("/media/cdrom/", CD + S)); + } + { + SCOPED_TRACE("kfreebsd-mips configured"); _config->Clear("APT"); _config->Set("APT::Architecture", "kfreebsd-mips"); _config->Set("APT::Architectures::", "kfreebsd-mips"); @@ -68,7 +78,10 @@ TEST(IndexCopyTest, ConvertToSourceList) EXPECT_EQ(B, ic.ConvertToSourceList("/media/cdrom/", CD + B)); EXPECT_EQ(List, ic.ConvertToSourceList("/media/cdrom/", CD + C)); EXPECT_EQ(List, ic.ConvertToSourceList("/media/cdrom/", CD + S)); + } + { + SCOPED_TRACE("armel configured"); _config->Clear("APT"); _config->Set("APT::Architecture", "armel"); _config->Set("APT::Architectures::", "armel"); @@ -77,7 +90,10 @@ TEST(IndexCopyTest, ConvertToSourceList) EXPECT_EQ(B, ic.ConvertToSourceList("/media/cdrom/", CD + B)); EXPECT_EQ(C, ic.ConvertToSourceList("/media/cdrom/", CD + C)); EXPECT_EQ(List, ic.ConvertToSourceList("/media/cdrom/", CD + S)); + } + { + SCOPED_TRACE("armel+mips configured"); _config->Clear("APT"); _config->Set("APT::Architecture", "armel"); _config->Set("APT::Architectures::", "armel"); @@ -87,6 +103,7 @@ TEST(IndexCopyTest, ConvertToSourceList) EXPECT_EQ(List, ic.ConvertToSourceList("/media/cdrom/", CD + B)); EXPECT_EQ(C, ic.ConvertToSourceList("/media/cdrom/", CD + C)); EXPECT_EQ(List, ic.ConvertToSourceList("/media/cdrom/", CD + S)); + } } } }