35 assert(i != apt.
end());
38 for (; i != apt.
end(); ++i)
49 std::copy(apt.
begin(), apt.
end(), inserter(packages, packages.begin()));
51 assert(packages.find(
"libsp1") != packages.end());
55 assert(packages.find(
"") == packages.end());
69 assert(!apt.
isValid(
"this-package-does-not-really-exists"));
75 std::string pkg(
"apt");
80 assert(ver.isValid());
83 assert(ver.isValid());
85 std::string pkg1(
"this-package-does-not-really-exists");
87 assert(!ver.isValid());
90 assert(!ver.isValid());
93 assert(!ver.isValid());
102 ver =
Version(
"this-package-does-not-really-exists",
"0.1");
103 assert(!apt.
validate(ver).isValid());
105 ver =
Version(
"apt",
"0.31415");
106 assert(!apt.
validate(ver).isValid());
118 assert(record.find(
"Package: sp") != string::npos);
119 assert(record.find(
"Section: text") != string::npos);
122 assert_eq(record,
string());
134 s = apt.
state(
"this-package-does-not-really-exists");
135 assert(!s.isValid());
145 assert((*i).size() > 8);
146 assert_eq((*i).substr(0, 8),
"Package:");
159 assert(i->size() > 8);
160 assert_eq(i->substr(0, 8),
"Package:");
170 std::copy(apt.
begin(), apt.
end(), back_inserter(out));
Definition: apt.test.h:28
bool isValid() const
Definition: apt.h:91
Test state()
Definition: apt.test.h:128
void checkCacheUpdates()
Check if the cache has been changed by another process, and reopen it if that is the case...
Definition: apt.cc:637
record_iterator recordBegin() const
Definition: apt.cc:456
Test timestamp()
Definition: apt.test.h:59
Test validity()
Definition: apt.test.h:66
Definition: packagerecord.test.h:22
PackageState state(const std::string &pkg) const
Return state information on a package.
Definition: apt.cc:530
bool isValid(const std::string &pkg) const
Validate a package name, returning trye if it exists in the APT database, or false if it does not...
Definition: apt.cc:476
bool isValid() const
Return true if this package contains a valid value.
Definition: version.h:77
Test versionValidity()
Definition: apt.test.h:97
std::string validate(const std::string &pkg) const
Validate a package name, returning it if it exists in the APT database, or returning the empty string...
Definition: apt.h:222
Test iterators()
Definition: apt.test.h:32
Version installedVersion(const std::string &pkg) const
Return the installed version for a package.
Definition: apt.cc:505
High-level access to the Apt cache, as a data provider for the ept framework.
Definition: apt.h:127
Test recordIteration()
Definition: apt.test.h:139
time_t timestamp()
Timestamp of when the apt index was last modified.
Definition: apt.cc:471
iterator end() const
Definition: apt.cc:451
Test stlIteration()
Definition: apt.test.h:167
Version candidateVersion(const std::string &pkg) const
Return the candidate version for a package.
Definition: apt.cc:496
High-level front-end to libapt-pkg, as a data provider for the ept framework.
void invalidateTimestamp()
Invalidate the cache timestamp used to track cache updates.
Definition: apt.cc:647
iterator begin() const
Definition: apt.cc:444
record_iterator recordEnd() const
Definition: apt.cc:461
Apt apt
Definition: apt.test.h:29
Test checkUpdates()
Definition: apt.test.h:181
Test rawRecord()
Definition: apt.test.h:110
Test stlRecordIteration()
Definition: apt.test.h:174
std::string rawRecord(const std::string &pkg) const
Perform a package search.
Definition: apt.cc:577
Test aptExists()
Definition: apt.test.h:45
Test versions()
Definition: apt.test.h:73
Version anyVersion(const std::string &pkg) const
Return the candidate version for a package, if available, or the installed version otherwise...
Definition: apt.cc:515
bool isInstalled() const
Definition: apt.h:93
Lightweight Version class that represent a package with a version, with very cheap value copy operati...
Definition: version.h:40
Test recordIteration2()
Definition: apt.test.h:153