From ee8072e7d5a267dd8e2ea80a1b1afdeb0ca8d071 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 15 Dec 2016 16:25:56 +0000 Subject: Dump DB before doing assertions so you have some hope of diagnosing problems --- gentoobrowse-api/unittests/testMaintenance.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gentoobrowse-api/unittests/testMaintenance.cpp b/gentoobrowse-api/unittests/testMaintenance.cpp index 6439923..e77837f 100644 --- a/gentoobrowse-api/unittests/testMaintenance.cpp +++ b/gentoobrowse-api/unittests/testMaintenance.cpp @@ -38,6 +38,8 @@ class SampleData { BOOST_FIXTURE_TEST_SUITE(tp, TestClient) +void dumpDb(DB::ConnectionPtr db); + 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, int64_t ebus, @@ -49,6 +51,7 @@ doRefreshPackageTree(SampleData & sd, DB::ConnectionPtr db, const std::string & } m->refreshPackageTree(); sd.clean(); + dumpDb(db); SQL_REQUIRE_EQUAL("SELECT COUNT(*) FROM gentoobrowse.files", int64_t, files); SQL_REQUIRE_EQUAL("SELECT COUNT(*) FROM gentoobrowse.categories", int64_t, cats); @@ -102,11 +105,9 @@ BOOST_AUTO_TEST_CASE( refreshPackageTree ) doRefreshPackageTree(sd, db, "4156eb45cf3b0ce1d7125b84efd8688c2d6e831d", "gentoo", m, 2080, 5, 1, 482, 981, 3626, 4593, 501, 393, 238, 50, 1573, 2008, 1543, 81, 152); - dumpDb(db); doRefreshPackageTree(sd, db, "756569aa764177340726dd3d40b41d89b11b20c7", "gentoo", m, 2083, 5, 1, 484, 982, 3638, 4599, 503, 393, 238, 50, 1573, 2009, 1546, 79, 152); - dumpDb(db); doRefreshPackageTree(sd, db, "", "gentoo", m, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); -- cgit v1.2.3