[glom/glom-1-20] test_load_and_change(): Test removal of a relationship.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/glom-1-20] test_load_and_change(): Test removal of a relationship.
- Date: Mon, 5 Dec 2011 15:12:52 +0000 (UTC)
commit 137379c4c4ffcd99301a3897de09e8700908ab89
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Nov 30 10:18:14 2011 +0100
test_load_and_change(): Test removal of a relationship.
* tests/test_document_load_and_change.cc: Test Document::remove_relationship().
ChangeLog | 6 ++++++
tests/test_document_load_and_change.cc | 11 ++++++++++-
2 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9be7c9e..67f4820 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2011-11-30 Murray Cumming <murrayc murrayc com>
+ test_load_and_change(): Test removal of a relationship.
+
+ * tests/test_document_load_and_change.cc: Test Document::remove_relationship().
+
+2011-11-30 Murray Cumming <murrayc murrayc com>
+
test_document_load: Test field formatting.
* tests/test_document_load.cc: Also use a different example, to
diff --git a/tests/test_document_load_and_change.cc b/tests/test_document_load_and_change.cc
index bc357ab..a9c46e0 100644
--- a/tests/test_document_load_and_change.cc
+++ b/tests/test_document_load_and_change.cc
@@ -110,7 +110,7 @@ int main()
}
//Check that the original field name is no longer used in the relationship:
- const Glom::sharedptr<const Glom::Relationship> relationship = document.get_relationship("invoice_lines", "products");
+ Glom::sharedptr<const Glom::Relationship> relationship = document.get_relationship("invoice_lines", "products");
if(!relationship)
{
std::cerr << "Failure: The relationship could not be found in the document." << std::endl;
@@ -138,6 +138,15 @@ int main()
std::cerr << "Failure: The removed field name is still used on a layout." << std::endl;
return false;
}
+
+ //Remove a relationship:
+ document.remove_relationship(relationship);
+ relationship = document.get_relationship("invoice_lines", "products");
+ if(relationship)
+ {
+ std::cerr << "Failure: The removed relationship still exists." << std::endl;
+ return false;
+ }
Glom::libglom_deinit();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]