Hopefully make all tests stable enough to be run with --random,
[libdcp.git] / test / test.cc
index 3933e4304a5889982a91042ec9103aff974b02bd..b5b2535f2f6052c4425e14d2c9551bb7819f3d92 100644 (file)
@@ -35,6 +35,8 @@
 #define BOOST_TEST_MODULE libdcp_test
 #include "util.h"
 #include "test.h"
+#include <asdcp/KM_util.h>
+#include <asdcp/KM_prng.h>
 #include <libxml++/libxml++.h>
 #include <boost/test/unit_test.hpp>
 #include <cstdio>
@@ -174,4 +176,18 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check)
        fclose (check_file);
 }
 
+
+RNGFixer::RNGFixer ()
+{
+       Kumu::cth_test = true;
+       Kumu::FortunaRNG().Reset();
+}
+
+
+RNGFixer::~RNGFixer ()
+{
+       Kumu::cth_test = false;
+}
+
+
 BOOST_GLOBAL_FIXTURE (TestConfig);