From 185fe497c64d0a2fa4f04b99aab065bdeaf3a66f Mon Sep 17 00:00:00 2001 From: Marijn Kruisselbrink Date: Thu, 29 Dec 2022 15:34:11 -0800 Subject: [PATCH] Fix AutomationListPropertyTest These tests use reference files that were generated with a particular value for superclock_ticks_per_second. The default for that has changed since the last time the reference files were updated though, causing tests to fail. Rather than updating the reference files for the new default value, this makes the test not depend on the default value by hardcoding the value that was used to generate the reference files. --- libs/ardour/test/automation_list_property_test.cc | 6 ++++++ libs/ardour/test/automation_list_property_test.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/libs/ardour/test/automation_list_property_test.cc b/libs/ardour/test/automation_list_property_test.cc index 9813ee6648..35843dafbc 100644 --- a/libs/ardour/test/automation_list_property_test.cc +++ b/libs/ardour/test/automation_list_property_test.cc @@ -46,11 +46,17 @@ write_automation_list_xml (XMLNode* node, std::string filename) void AutomationListPropertyTest::setUp () { + // The reference files were created with this superclock ticks per second + // value. Setting this here makes sure we don't need to update all the + // reference files whenever the default value changes. + _saved_superclock_ticks_per_second = Temporal::superclock_ticks_per_second(); + Temporal::set_superclock_ticks_per_second(56448000); } void AutomationListPropertyTest::tearDown () { + Temporal::set_superclock_ticks_per_second(_saved_superclock_ticks_per_second); } void diff --git a/libs/ardour/test/automation_list_property_test.h b/libs/ardour/test/automation_list_property_test.h index 39a8466e57..172475b89a 100644 --- a/libs/ardour/test/automation_list_property_test.h +++ b/libs/ardour/test/automation_list_property_test.h @@ -19,6 +19,8 @@ #include #include +#include "temporal/superclock.h" + class AutomationListPropertyTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE (AutomationListPropertyTest); @@ -31,4 +33,7 @@ public: void tearDown (); void basicTest (); void undoTest (); + +private: + Temporal::superclock_t _saved_superclock_ticks_per_second; };