summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-04-25 01:22:12 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-04-25 21:38:49 +0100
commit0a2ea85e3ca42b6561c93666dc488b01e4a5e34f (patch)
treea09f075c34c463fae340954241e10fd7053bcb1f
parentUpdate package urls (diff)
downloadgentoobrowse-api-0a2ea85e3ca42b6561c93666dc488b01e4a5e34f.tar.bz2
gentoobrowse-api-0a2ea85e3ca42b6561c93666dc488b01e4a5e34f.tar.xz
gentoobrowse-api-0a2ea85e3ca42b6561c93666dc488b01e4a5e34f.zip
Adds count assertions
-rw-r--r--gentoobrowse-api/unittests/testMaintenance.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/gentoobrowse-api/unittests/testMaintenance.cpp b/gentoobrowse-api/unittests/testMaintenance.cpp
index 8a3a70f..b6f50da 100644
--- a/gentoobrowse-api/unittests/testMaintenance.cpp
+++ b/gentoobrowse-api/unittests/testMaintenance.cpp
@@ -44,7 +44,8 @@ BOOST_FIXTURE_TEST_SUITE(tp, TestClient)
void
doRefreshPackageTree(SampleData & sd, DB::ConnectionPtr db, const std::string & archive, const std::string & dir,
- Gentoo::MaintenancePrx m, int64_t files, int64_t cats, int64_t devvcs, int64_t pkgs, int64_t ebs)
+ Gentoo::MaintenancePrx m, int64_t files, int64_t cats, int64_t devvcs, int64_t pkgs, int64_t ebs, int64_t ebus,
+ int64_t ebas, int64_t pus)
{
if (!archive.empty()) {
sd.extract(archive, dir);
@@ -57,6 +58,9 @@ doRefreshPackageTree(SampleData & sd, DB::ConnectionPtr db, const std::string &
SQL_REQUIRE_EQUAL("SELECT COUNT(*) FROM gentoobrowse.categories WHERE name = 'dev-vcs'", int64_t, devvcs);
SQL_REQUIRE_EQUAL("SELECT COUNT(*) FROM gentoobrowse.packages", int64_t, pkgs);
SQL_REQUIRE_EQUAL("SELECT COUNT(*) FROM gentoobrowse.ebuilds", int64_t, ebs);
+ SQL_REQUIRE_EQUAL("SELECT COUNT(*) FROM gentoobrowse.ebuild_uses", int64_t, ebus);
+ SQL_REQUIRE_EQUAL("SELECT COUNT(*) FROM gentoobrowse.ebuild_archs", int64_t, ebas);
+ SQL_REQUIRE_EQUAL("SELECT COUNT(*) FROM gentoobrowse.package_urls", int64_t, pus);
}
BOOST_AUTO_TEST_CASE( refreshPackageTree )
@@ -69,25 +73,27 @@ BOOST_AUTO_TEST_CASE( refreshPackageTree )
insRepo->execute();
doRefreshPackageTree(sd, db, "4156eb45cf3b0ce1d7125b84efd8688c2d6e831d", "gentoo",
- m, 2084, 5, 1, 482, 981);
+ m, 2084, 5, 1, 482, 981, 3626, 4593, 507);
db->execute("COPY gentoobrowse.categories TO '/tmp/categories1.tsv'");
db->execute("COPY gentoobrowse.packages TO '/tmp/packages1.tsv'");
db->execute("COPY gentoobrowse.ebuilds TO '/tmp/ebuilds1.tsv'");
db->execute("COPY gentoobrowse.ebuild_uses TO '/tmp/ebuild_uses1.tsv'");
db->execute("COPY gentoobrowse.ebuild_archs TO '/tmp/ebuild_archs1.tsv'");
+ db->execute("COPY gentoobrowse.package_urls TO '/tmp/package_urls1.tsv'");
doRefreshPackageTree(sd, db, "756569aa764177340726dd3d40b41d89b11b20c7", "gentoo",
- m, 2087, 5, 1, 484, 982);
+ m, 2087, 5, 1, 484, 982, 3638, 4599, 510);
db->execute("COPY gentoobrowse.categories TO '/tmp/categories2.tsv'");
db->execute("COPY gentoobrowse.packages TO '/tmp/packages2.tsv'");
db->execute("COPY gentoobrowse.ebuilds TO '/tmp/ebuilds2.tsv'");
db->execute("COPY gentoobrowse.ebuild_uses TO '/tmp/ebuild_uses2.tsv'");
db->execute("COPY gentoobrowse.ebuild_archs TO '/tmp/ebuild_archs2.tsv'");
+ db->execute("COPY gentoobrowse.package_urls TO '/tmp/package_urls2.tsv'");
doRefreshPackageTree(sd, db, "", "gentoo",
- m, 0, 0, 0, 0, 0);
+ m, 0, 0, 0, 0, 0, 0, 0, 0);
m->refreshPackageTree();
}