diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-07-20 13:59:07 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-07-20 13:59:07 +0100 |
| commit | 7aaf59faf8bb0ff85a2f76f6569076790a124813 (patch) | |
| tree | f35c23fe5cbe709ffeea4584c9420795ef89ca5b /src/test_mode.cc | |
| parent | d92919284b25526581f5a3f461f1e06106b91a09 (diff) | |
Give access to git revision, and make test mode accessible.
Diffstat (limited to 'src/test_mode.cc')
| -rw-r--r-- | src/test_mode.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/test_mode.cc b/src/test_mode.cc new file mode 100644 index 00000000..2ff806fa --- /dev/null +++ b/src/test_mode.cc @@ -0,0 +1,40 @@ +/* + Copyright (C) 2012 Carl Hetherington <cth@carlh.net> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/** @file src/test_mode.cc + * @brief A method to enable test mode for libdcp. + */ + +#include "KM_prng.h" +#include "test_mode.h" +#include "metadata.h" + +/** Calling this will seed the random number generator used to + * generate UUIDs with a known value, and set the DCP issue + * date to 1st January 2012 at midnight. This means that + * two runs of libdcp with the same inputs will produce + * the same output. + */ + +void +libdcp::enable_test_mode () +{ + Kumu::libdcp_test = true; + Metadata::instance()->issue_date = "2012-01-01T00:00:00+00:00"; +} |
