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.
This commit is contained in:
Marijn Kruisselbrink 2022-12-29 15:34:11 -08:00 committed by Robin Gareus
parent b4169a0391
commit 185fe497c6
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -19,6 +19,8 @@
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#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;
};