[glom/glom-1-20] test_document_load: Check reports too.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/glom-1-20] test_document_load: Check reports too.
- Date: Mon, 5 Dec 2011 15:26:44 +0000 (UTC)
commit df263b241f9fe3388466951be18571947bdff0ac
Author: Murray Cumming <murrayc murrayc com>
Date: Sat Dec 3 16:52:21 2011 +0100
test_document_load: Check reports too.
* tests/test_document_load.cc: Check some report names.
Conflicts:
tests/test_document_load.cc
ChangeLog | 6 ++++++
tests/test_document_load.cc | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8d0673f..126fac4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2011-12-03 Murray Cumming <murrayc murrayc com>
+ test_document_load: Check reports too.
+
+ * tests/test_document_load.cc: Check some report names.
+
+2011-12-03 Murray Cumming <murrayc murrayc com>
+
test_document_load: Check a table title and its singular title.
* tests/test_document_load.cc: Also test
diff --git a/tests/test_document_load.cc b/tests/test_document_load.cc
index da62ac6..d2ba126 100644
--- a/tests/test_document_load.cc
+++ b/tests/test_document_load.cc
@@ -273,6 +273,46 @@ int main()
return false;
}
+
+ const Glom::Document::type_listReports report_names =
+ document.get_report_names("contacts");
+ if(report_names.size() != 2)
+ {
+ std::cerr << "Failure: Unexpected number of reports." << std::endl;
+ return false;
+ }
+
+ if(!contains(report_names, "by_country"))
+ {
+ std::cerr << "Failure: Could not find the expected report name." << std::endl;
+ return false;
+ }
+
+ const Glom::sharedptr<const Glom::Report> report = document.get_report("contacts", "by_country_by_town");
+ if(!print_layout)
+ {
+ std::cerr << "Failure: Could not get an expected report." << std::endl;
+ return false;
+ }
+
+ if(report->get_title() != "By Country, By Town")
+ {
+ std::cerr << "Failure: Unexpected report title." << std::endl;
+ return false;
+ }
+
+ if(!report->m_layout_group)
+ {
+ std::cerr << "Failure: The report has no layout group." << std::endl;
+ return false;
+ }
+
+
+ //Test user groups:
+ Glom::Document::type_list_groups groups = document.get_groups();
+ g_assert(groups_contain_named(groups, "glom_developer"));
+ g_assert(groups_contain_named(groups, "accounts"));
+
//Test navigation:
if(!needs_navigation(document, "scenes", "location_id"))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]