]> git.saurik.com Git - apt.git/blobdiff - test/libapt/cdromfindpackages_test.cc
support arch:all data e.g. in separate Packages file
[apt.git] / test / libapt / cdromfindpackages_test.cc
index 719dd8f63c8b0063c5099f7749206f689eee061e..6121d32b6c7fe6690b251c339841ef7b467c7119 100644 (file)
@@ -46,7 +46,7 @@ TEST(CDROMTest,FindPackages)
    createDirectory(path, "dists/stable/main/binary-i386");
    createDirectory(path, "dists/stable/main/source");
    createDirectory(path, "dists/stable/contrib/binary-amd64");
    createDirectory(path, "dists/stable/main/binary-i386");
    createDirectory(path, "dists/stable/main/source");
    createDirectory(path, "dists/stable/contrib/binary-amd64");
-   createDirectory(path, "dists/stable/contrib/binary-all");
+   createDirectory(path, "dists/stable/non-free/binary-all");
    createDirectory(path, "dists/unstable/main/binary-i386");
    createDirectory(path, "dists/unstable/main/i18n");
    createDirectory(path, "dists/unstable/main/source");
    createDirectory(path, "dists/unstable/main/binary-i386");
    createDirectory(path, "dists/unstable/main/i18n");
    createDirectory(path, "dists/unstable/main/source");
@@ -57,7 +57,7 @@ TEST(CDROMTest,FindPackages)
    createFile(path, "dists/stable/main/source/Sources.xz");
    createFile(path, "dists/stable/contrib/binary-amd64/Packages");
    createFile(path, "dists/stable/contrib/binary-amd64/Packages.gz");
    createFile(path, "dists/stable/main/source/Sources.xz");
    createFile(path, "dists/stable/contrib/binary-amd64/Packages");
    createFile(path, "dists/stable/contrib/binary-amd64/Packages.gz");
-   createFile(path, "dists/stable/contrib/binary-all/Packages");
+   createFile(path, "dists/stable/non-free/binary-all/Packages");
    createFile(path, "dists/unstable/main/binary-i386/Packages.xz");
    createFile(path, "dists/unstable/main/binary-i386/Packages.lzma");
    createFile(path, "dists/unstable/main/i18n/Translation-en");
    createFile(path, "dists/unstable/main/binary-i386/Packages.xz");
    createFile(path, "dists/unstable/main/binary-i386/Packages.lzma");
    createFile(path, "dists/unstable/main/i18n/Translation-en");
@@ -74,11 +74,12 @@ TEST(CDROMTest,FindPackages)
    std::vector<std::string> Packages, Sources, Signatur, Translation;
    std::string InfoDir;
    EXPECT_TRUE(cd.FindPackages(path, Packages, Sources, Signatur, Translation, InfoDir));
    std::vector<std::string> Packages, Sources, Signatur, Translation;
    std::string InfoDir;
    EXPECT_TRUE(cd.FindPackages(path, Packages, Sources, Signatur, Translation, InfoDir));
-   EXPECT_EQ(4, Packages.size());
+   EXPECT_EQ(5, Packages.size());
    EXPECT_EQ(path + "/dists/sid/main/binary-i386/", Packages[0]);
    EXPECT_EQ(path + "/dists/stable/contrib/binary-amd64/", Packages[1]);
    EXPECT_EQ(path + "/dists/stable/main/binary-i386/", Packages[2]);
    EXPECT_EQ(path + "/dists/sid/main/binary-i386/", Packages[0]);
    EXPECT_EQ(path + "/dists/stable/contrib/binary-amd64/", Packages[1]);
    EXPECT_EQ(path + "/dists/stable/main/binary-i386/", Packages[2]);
-   EXPECT_EQ(path + "/dists/unstable/main/binary-i386/", Packages[3]);
+   EXPECT_EQ(path + "/dists/stable/non-free/binary-all/", Packages[3]);
+   EXPECT_EQ(path + "/dists/unstable/main/binary-i386/", Packages[4]);
    EXPECT_EQ(3, Sources.size());
    EXPECT_EQ(path + "/dists/sid/main/source/", Sources[0]);
    EXPECT_EQ(path + "/dists/stable/main/source/", Sources[1]);
    EXPECT_EQ(3, Sources.size());
    EXPECT_EQ(path + "/dists/sid/main/source/", Sources[0]);
    EXPECT_EQ(path + "/dists/stable/main/source/", Sources[1]);
@@ -103,10 +104,11 @@ TEST(CDROMTest,FindPackages)
    _error->DumpErrors();
    cd.DropRepeats(Translation, "");
 
    _error->DumpErrors();
    cd.DropRepeats(Translation, "");
 
-   EXPECT_EQ(3, Packages.size());
+   EXPECT_EQ(4, Packages.size());
    EXPECT_EQ(path + "/dists/stable/contrib/binary-amd64/", Packages[0]);
    EXPECT_EQ(path + "/dists/stable/main/binary-i386/", Packages[1]);
    EXPECT_EQ(path + "/dists/stable/contrib/binary-amd64/", Packages[0]);
    EXPECT_EQ(path + "/dists/stable/main/binary-i386/", Packages[1]);
-   EXPECT_EQ(path + "/dists/unstable/main/binary-i386/", Packages[2]);
+   EXPECT_EQ(path + "/dists/stable/non-free/binary-all/", Packages[2]);
+   EXPECT_EQ(path + "/dists/unstable/main/binary-i386/", Packages[3]);
    EXPECT_EQ(2, Sources.size());
    EXPECT_EQ(path + "/dists/stable/main/source/", Sources[0]);
    EXPECT_EQ(path + "/dists/unstable/main/source/", Sources[1]);
    EXPECT_EQ(2, Sources.size());
    EXPECT_EQ(path + "/dists/stable/main/source/", Sources[0]);
    EXPECT_EQ(path + "/dists/unstable/main/source/", Sources[1]);