summaryrefslogtreecommitdiff
path: root/asdcplib/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-17 17:25:18 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-17 17:25:18 +0100
commit1c22ef308a1d62b4c6935ede8233b1fea082b0ca (patch)
treec3d8e8321e4b1aa09cce056d5a35da908a0ae3d9 /asdcplib/src
parent0e7591e3bf95d4abe08d854850b6fc4e411586b0 (diff)
Various test hackery.
Diffstat (limited to 'asdcplib/src')
-rwxr-xr-xasdcplib/src/KM_prng.cpp2
-rwxr-xr-xasdcplib/src/KM_prng.h2
-rwxr-xr-xasdcplib/src/KM_util.cpp11
-rwxr-xr-xasdcplib/src/KM_util.h2
4 files changed, 12 insertions, 5 deletions
diff --git a/asdcplib/src/KM_prng.cpp b/asdcplib/src/KM_prng.cpp
index 3c64bdcc..e7526da1 100755
--- a/asdcplib/src/KM_prng.cpp
+++ b/asdcplib/src/KM_prng.cpp
@@ -48,8 +48,6 @@ using namespace Kumu;
const char* DEV_URANDOM = "/dev/urandom";
#endif // KM_WIN32
-bool Kumu::libdcp_test = false;
-
const ui32_t RNG_KEY_SIZE = 512UL;
const ui32_t RNG_KEY_SIZE_BITS = 256UL;
const ui32_t RNG_BLOCK_SIZE = 16UL;
diff --git a/asdcplib/src/KM_prng.h b/asdcplib/src/KM_prng.h
index a1f23288..4d7ab2b7 100755
--- a/asdcplib/src/KM_prng.h
+++ b/asdcplib/src/KM_prng.h
@@ -50,8 +50,6 @@ namespace Kumu
// key_len must be <= 64 (larger values will be truncated)
void Gen_FIPS_186_Value(const byte_t* key_in, ui32_t key_len, byte_t* buf, ui32_t buf_len);
-
- extern bool libdcp_test;
} // namespace Kumu
diff --git a/asdcplib/src/KM_util.cpp b/asdcplib/src/KM_util.cpp
index 325bd2da..23e8a1a6 100755
--- a/asdcplib/src/KM_util.cpp
+++ b/asdcplib/src/KM_util.cpp
@@ -40,6 +40,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <map>
#include <string>
+bool Kumu::libdcp_test = false;
+
const char*
Kumu::Version()
{
@@ -688,7 +690,14 @@ Kumu::write_BER(byte_t* buf, ui64_t val, ui32_t ber_len)
//
Kumu::Timestamp::Timestamp() : m_TZOffsetMinutes(0) {
- m_Timestamp.now();
+ if (libdcp_test)
+ {
+ m_Timestamp.x = 42;
+ }
+ else
+ {
+ m_Timestamp.now();
+ }
}
Kumu::Timestamp::Timestamp(const Timestamp& rhs) {
diff --git a/asdcplib/src/KM_util.h b/asdcplib/src/KM_util.h
index 78f07398..892670e6 100755
--- a/asdcplib/src/KM_util.h
+++ b/asdcplib/src/KM_util.h
@@ -41,6 +41,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Kumu
{
+ extern bool libdcp_test;
+
// The version number declaration and explanation are in ../configure.ac
const char* Version();