summaryrefslogtreecommitdiff
path: root/libs/ardour/test
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2013-08-10 18:56:59 +1000
committerTim Mayberry <mojofunk@gmail.com>2013-10-11 22:36:19 +1000
commit2e91da8a26809717284a06364d4354d037013fde (patch)
tree4ea148f58c8b035a99da74182e1fc4f130a110bf /libs/ardour/test
parent42b475069bf96a97f07a1f88b39a51ff8a5b77d4 (diff)
Write state data from automation list test to check why test is failing
Diffstat (limited to 'libs/ardour/test')
-rw-r--r--libs/ardour/test/automation_list_property_test.cc26
1 files changed, 22 insertions, 4 deletions
diff --git a/libs/ardour/test/automation_list_property_test.cc b/libs/ardour/test/automation_list_property_test.cc
index 073fcf4b09..e5a74cad2f 100644
--- a/libs/ardour/test/automation_list_property_test.cc
+++ b/libs/ardour/test/automation_list_property_test.cc
@@ -33,6 +33,16 @@ using namespace PBD;
using namespace ARDOUR;
void
+write_automation_list_xml (XMLNode* node, std::string filename)
+{
+ // use the same output dir for all of them
+ static std::string test_output_dir = new_test_output_dir ("automation_list_property");
+ std::string output_file = Glib::build_filename (test_output_dir, filename);
+
+ CPPUNIT_ASSERT (write_ref (node, output_file));
+}
+
+void
AutomationListPropertyTest::basicTest ()
{
list<string> ignore_properties;
@@ -56,14 +66,17 @@ AutomationListPropertyTest::basicTest ()
/* Now it has changed */
CPPUNIT_ASSERT_EQUAL (true, property.changed());
- std::string test_data_file1 = Glib::build_filename (test_search_path().front(), "automation_list_property_test1.ref");
+ std::string test_data_filename = "automation_list_property_test1.ref";
+ std::string test_data_file1 = Glib::build_filename (test_search_path().front(), test_data_filename);
CPPUNIT_ASSERT (Glib::file_test (test_data_file1, Glib::FILE_TEST_EXISTS));
XMLNode* foo = new XMLNode ("test");
property.get_changes_as_xml (foo);
+ write_automation_list_xml (foo, test_data_filename);
check_xml (foo, test_data_file1, ignore_properties);
- std::string test_data_file2 = Glib::build_filename (test_search_path().front(), "automation_list_property_test2.ref");
+ test_data_filename = "automation_list_property_test2.ref";
+ std::string test_data_file2 = Glib::build_filename (test_search_path().front(), test_data_filename);
CPPUNIT_ASSERT (Glib::file_test (test_data_file2, Glib::FILE_TEST_EXISTS));
/* Do some more */
@@ -74,6 +87,7 @@ AutomationListPropertyTest::basicTest ()
CPPUNIT_ASSERT_EQUAL (true, property.changed());
foo = new XMLNode ("test");
property.get_changes_as_xml (foo);
+ write_automation_list_xml (foo, test_data_filename);
check_xml (foo, test_data_file2, ignore_properties);
}
@@ -129,17 +143,21 @@ AutomationListPropertyTest::undoTest ()
sheila->_jim->add (7, 8);
StatefulDiffCommand sdc (sheila);
- std::string test_data_file3 = Glib::build_filename (test_search_path().front(), "automation_list_property_test3.ref");
+ std::string test_data_filename = "automation_list_property_test3.ref";
+ std::string test_data_file3 = Glib::build_filename (test_search_path().front(), test_data_filename);
CPPUNIT_ASSERT (Glib::file_test (test_data_file3, Glib::FILE_TEST_EXISTS));
/* Undo */
sdc.undo ();
+ write_automation_list_xml (&sheila->get_state(), test_data_filename);
check_xml (&sheila->get_state(), test_data_file3, ignore_properties);
- std::string test_data_file4 = Glib::build_filename (test_search_path().front(), "automation_list_property_test4.ref");
+ test_data_filename = "automation_list_property_test4.ref";
+ std::string test_data_file4 = Glib::build_filename (test_search_path().front(), test_data_filename);
CPPUNIT_ASSERT (Glib::file_test (test_data_file4, Glib::FILE_TEST_EXISTS));
/* Redo */
sdc.redo ();
+ write_automation_list_xml (&sheila->get_state(), test_data_filename);
check_xml (&sheila->get_state(), test_data_file4, ignore_properties);
}