]>
Commit | Line | Data |
---|---|---|
453b82a3 DK |
1 | #include <config.h> |
2 | ||
3152f4aa DK |
3 | #include <apt-pkg/aptconfiguration.h> |
4 | #include <apt-pkg/configuration.h> | |
5 | ||
3152f4aa DK |
6 | #include <string> |
7 | #include <vector> | |
8 | ||
453b82a3 | 9 | #include "assert.h" |
3152f4aa | 10 | |
65512241 | 11 | int main() |
3152f4aa DK |
12 | { |
13 | std::vector<std::string> vec; | |
14 | ||
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"); | |
21 | ||
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"); | |
27 | ||
28 | _config->Set("APT::Architectures::2", ""); | |
29 | vec = APT::Configuration::getArchitectures(false); | |
30 | equals(vec.size(), 1); | |
31 | equals(vec[0], "i386"); | |
32 | ||
33 | _config->Set("APT::Architecture", "armel"); | |
34 | vec = APT::Configuration::getArchitectures(false); | |
35 | equals(vec.size(), 2); | |
c3182c82 DK |
36 | equals(vec[0], "armel"); |
37 | equals(vec[1], "i386"); | |
38 | ||
39 | _config->Set("APT::Architectures::2", "armel"); | |
40 | vec = APT::Configuration::getArchitectures(false); | |
41 | equals(vec.size(), 2); | |
3152f4aa DK |
42 | equals(vec[0], "i386"); |
43 | equals(vec[1], "armel"); | |
44 | ||
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"); | |
59 | ||
60 | return 0; | |
61 | } |