]>
git.saurik.com Git - apt.git/blob - test/libapt/getarchitectures_test.cc
3 #include <apt-pkg/aptconfiguration.h>
4 #include <apt-pkg/configuration.h>
13 std::vector
<std::string
> vec
;
15 _config
->Set("APT::Architectures::1", "i386");
16 _config
->Set("APT::Architectures::2", "amd64");
17 vec
= APT::Configuration::getArchitectures(false);
18 equals(vec
.size(), 2);
19 equals(vec
[0], "i386");
20 equals(vec
[1], "amd64");
22 _config
->Set("APT::Architecture", "i386");
23 vec
= APT::Configuration::getArchitectures(false);
24 equals(vec
.size(), 2);
25 equals(vec
[0], "i386");
26 equals(vec
[1], "amd64");
28 _config
->Set("APT::Architectures::2", "");
29 vec
= APT::Configuration::getArchitectures(false);
30 equals(vec
.size(), 1);
31 equals(vec
[0], "i386");
33 _config
->Set("APT::Architecture", "armel");
34 vec
= APT::Configuration::getArchitectures(false);
35 equals(vec
.size(), 2);
36 equals(vec
[0], "armel");
37 equals(vec
[1], "i386");
39 _config
->Set("APT::Architectures::2", "armel");
40 vec
= APT::Configuration::getArchitectures(false);
41 equals(vec
.size(), 2);
42 equals(vec
[0], "i386");
43 equals(vec
[1], "armel");
45 _config
->Set("APT::Architectures::2", "amd64");
46 _config
->Set("APT::Architectures::3", "i386");
47 _config
->Set("APT::Architectures::4", "armel");
48 _config
->Set("APT::Architectures::5", "i386");
49 _config
->Set("APT::Architectures::6", "amd64");
50 _config
->Set("APT::Architectures::7", "armel");
51 _config
->Set("APT::Architectures::8", "armel");
52 _config
->Set("APT::Architectures::9", "amd64");
53 _config
->Set("APT::Architectures::10", "amd64");
54 vec
= APT::Configuration::getArchitectures(false);
55 equals(vec
.size(), 3);
56 equals(vec
[0], "i386");
57 equals(vec
[1], "amd64");
58 equals(vec
[2], "armel");