From 4993f11bf464c9aee0e3fd5965f4a8258cbe8b30 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 31 Oct 2015 21:38:19 +0200 Subject: Bug fix in latest_packages() PostgreSQL function --- tests/loader/driver.cxx | 29 +++++++++++++++++++++++++++-- tests/loader/external/1/misc/packages | 8 ++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/loader/driver.cxx b/tests/loader/driver.cxx index 40d9b13..6d9b950 100644 --- a/tests/loader/driver.cxx +++ b/tests/loader/driver.cxx @@ -90,7 +90,7 @@ main (int argc, char* argv[]) transaction t (db.begin ()); assert (db.query ().size () == 3); - assert (db.query ().size () == 9); + assert (db.query ().size () == 10); shared_ptr sr (db.load ("cppget.org/stable")); shared_ptr mr (db.load ("cppget.org/math")); @@ -451,6 +451,10 @@ main (int argc, char* argv[]) db.load (package_id ("libfoo", version ("0.1")))); assert (check_location (fpv0)); + shared_ptr fpv6 ( + db.load (package_id ("libfoo", version ("1.2.4-2")))); + assert (check_location (fpv6)); + // Verify libbar package version. // // libbar-2.3.5 @@ -486,7 +490,7 @@ main (int argc, char* argv[]) assert (fpv0->email.empty ()); assert (!fpv0->package_email); - assert (fpv0->internal_repository.load () == nullptr); + assert (fpv0->internal_repository == nullptr); assert (fpv0->external_repositories.size () == 1); assert (fpv0->external_repositories[0].load () == cr); assert (fpv0->priority == priority::low); @@ -497,6 +501,27 @@ main (int argc, char* argv[]) assert (fpv0->dependencies.empty ()); assert (fpv0->requirements.empty ()); + // libfoo-1.2.4-2 + // + assert (fpv6->summary.empty ()); + assert (fpv6->tags.empty ()); + assert (!fpv6->description); + assert (fpv6->url.empty ()); + assert (!fpv6->package_url); + assert (fpv6->email.empty ()); + assert (!fpv6->package_email); + + assert (fpv6->internal_repository == nullptr); + assert (fpv6->external_repositories.size () == 1); + assert (fpv6->external_repositories[0].load () == cr); + assert (fpv6->priority == priority::low); + assert (fpv6->changes.empty ()); + + assert (fpv6->license_alternatives.empty ()); + + assert (fpv6->dependencies.empty ()); + assert (fpv6->requirements.empty ()); + // Change package summary, update the object persistent state, rerun // loader and ensure the model were not rebuilt. // diff --git a/tests/loader/external/1/misc/packages b/tests/loader/external/1/misc/packages index 77e10de..e47208d 100644 --- a/tests/loader/external/1/misc/packages +++ b/tests/loader/external/1/misc/packages @@ -37,3 +37,11 @@ license: MIT url: http://www.example.com/foo/ email: foo-users@example.com location: libfoo-1.2.4-1.tar.gz +: +name: libfoo +version: 1.2.4-2 +summary: Foo Library +license: MIT +url: http://www.example.com/foo/ +email: foo-users@example.com +location: libfoo-1.2.4-2.tar.gz -- cgit v1.1