From 8e8a67e6dfb3d73e0c354af64f9d912e6b27ceb8 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 17 Sep 2015 19:39:34 +0200 Subject: [PATCH] test fixes up to (not including) the iteration scope bracketing ...since for the latter I'll actually chose quite another approach, based on the HierarchyOrientationIndicator --- src/lib/diff/record.hpp | 4 ++-- tests/library/diff/gen-node-basic-test.cpp | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lib/diff/record.hpp b/src/lib/diff/record.hpp index e9db705a7..6c086417d 100644 --- a/src/lib/diff/record.hpp +++ b/src/lib/diff/record.hpp @@ -535,13 +535,13 @@ namespace diff{ explicit operator bool() const { - return empty(); + return bool(record_); } bool empty() const { - return bool(record_); + return ! bool(record_); } /** target is accessed by cast diff --git a/tests/library/diff/gen-node-basic-test.cpp b/tests/library/diff/gen-node-basic-test.cpp index 056fb8432..e26ba6292 100644 --- a/tests/library/diff/gen-node-basic-test.cpp +++ b/tests/library/diff/gen-node-basic-test.cpp @@ -237,7 +237,8 @@ namespace test{ CHECK (ref2.idi == ham.idi); // can stand-in for the original Record... - CHECK (isSameObject (ham, ref2.data.get())); + Rec& hamRef = ham.data.get(); + CHECK (isSameObject (hamRef, ref2.data.get())); VERIFY_ERROR (BOTTOM_VALUE, ref1.data.get()); RecRef rr1 = ref1.data.get(); @@ -246,8 +247,8 @@ namespace test{ CHECK ( isnil(rr1)); CHECK (!isnil(rr2)); Rec& ham_ref = rr2; - CHECK (isSameObject(ham, ham_ref)); - CHECK (isSameObject(&ham, rr2.get())); + CHECK (isSameObject(hamRef, ham_ref)); + CHECK (isSameObject(hamRef, *rr2.get())); // pre-defined special ref-tokens CHECK ("_END_" == name(Ref::END)); @@ -291,7 +292,7 @@ namespace test{ ++iter; CHECK ("hasSpam" == iter->idi.getSym()); // delve into the contents, starting with the attribute(s) CHECK (true == iter->data.get()); - CHECK ("GenNode-ID(\"hasSpam\")-DataCap|«bool»|true)" == string(*iter)); + CHECK ("GenNode-ID(\"hasSpam\")-DataCap|«bool»|1" == string(*iter)); ++iter; CHECK (!iter->isNamed()); // contents of the object's scope