43 : odsd( TEST_ENV_DIR
"popcon" ),
44 odid( TEST_ENV_DIR
"popcon" ),
45 odusd( TEST_ENV_DIR
"popcon" ),
46 oduid( TEST_ENV_DIR
"popcon" ),
47 local( TEST_ENV_DIR
"popcon/popularity-contest" )
53 assert(local.
score(
"apt") > 0);
54 assert(local.
tfidf(popcon,
"apt") > 0);
57 #if 0 // mornfall: apparently left out by enrico, leaving as it is 62 for (
size_t i = 0; i < popcon.
size(); ++i)
65 assert(popcon.
score(i) > 0);
74 for (Apt::iterator i = apt.begin(); i != apt.end(); ++i)
76 float score = popcon.
score(*i);
88 assert(popcon[
"apt"] > popcon[
"libapt-pkg-dev"]);
104 assert(empty.
size() == 0);
105 assert(empty.
score(
"apt") == 0.0);
Definition: popcon/maint/path.h:66
Definition: popcon/maint/path.h:96
Popcon popcon
Definition: local.test.h:39
Path::OverridePopconSourceDir odsd
Definition: local.test.h:34
Local local
Definition: local.test.h:40
Maps Packages to IDs and vice-versa.
Definition: popcon.h:72
size_t size() const
Get the number of packages in the index.
Definition: popcon.h:105
Definition: packagerecord.test.h:22
-*- C++ -*- (c) 2006, 2007 Petr Rockai me@mornfall.net
Definition: apt.cc:43
Path::OverridePopconUserIndexDir oduid
Definition: local.test.h:37
Definition: popcon/maint/path.h:86
Test basicAccess()
Definition: local.test.h:51
Path::OverridePopconUserSourceDir odusd
Definition: local.test.h:36
bool hasData() const
Return true if this data source has data, false if it's empty.
Definition: popcon.h:99
float score(size_t idx) const
Get the score by index.
Definition: popcon.h:137
Access the results of the local daily popcon scan.
Definition: local.h:39
Path::OverridePopconIndexDir odid
Definition: local.test.h:35
time_t timestamp() const
Get the timestamp of when the index was last updated.
Definition: popcon.h:96
Definition: popcon/maint/path.h:76
Definition: local.test.h:32
TestPopconLocal()
Definition: local.test.h:42
float tfidf(const Popcon &popcon, const std::string &pkg) const
Return the TFIDF score of the package computed against the popcon information.
Definition: local.cc:125
float score(const std::string &pkg) const
Return the local score of the package.
Definition: local.cc:112