Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <ept/debtags/maint/pkgid.h>
00023 #include <ept/debtags/maint/path.h>
00024 #include <ept/debtags/debtags.h>
00025 #include <set>
00026
00027 #include <ept/test.h>
00028
00029 using namespace std;
00030 using namespace ept;
00031 using namespace ept::debtags;
00032
00033 struct TestPkgid : DebtagsTestEnvironment
00034 {
00035 Debtags debtags;
00036 PkgId& pkgid;
00037
00038 TestPkgid()
00039 : pkgid(debtags.pkgid())
00040 {
00041 }
00042
00043
00044 Test _1()
00045 {
00046
00047 for (Debtags::const_iterator i = debtags.begin();
00048 i != debtags.end(); ++i)
00049 {
00050 int id = pkgid.byName(i->first);
00051 std::string pkg = pkgid.byID(id);
00052 assert(i->first == pkg);
00053
00054
00055
00056
00057
00058 }
00059 }
00060
00061
00062 Test _2()
00063 {
00064 using namespace std;
00065
00066 size_t count = 0;
00067 set<int> ids;
00068 for (Debtags::const_iterator i = debtags.begin(); i != debtags.end(); ++i, ++count)
00069 ids.insert(pkgid.byName(i->first));
00070 assert_eq(ids.size(), count);
00071 }
00072
00073 };
00074
00075