From 598d8b03f18ad4018a45f4300f650a59cddd3901 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 25 Apr 2016 01:22:12 +0100 Subject: Adds count assertions --- gentoobrowse-api/unittests/testMaintenance.cpp | 14 ++++++++++---- 1 file 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(); } -- cgit v1.2.3