/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2016 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
#include <boost/test/unit_test.hpp>
#include "lib/util.h"
+#include "lib/raw_convert.h"
#include "lib/exceptions.h"
using std::string;
p.push_back ("test/data/md5.test2");
p.push_back ("test/data/md5.test4");
BOOST_CHECK_EQUAL (md5_digest_head_tail (p, 1024), "52ccf111e4e72b58bb7b2aaa6bd45ea5");
-
+
p.clear ();
p.push_back ("foobar");
BOOST_CHECK_THROW (md5_digest_head_tail (p, 1024), OpenFileError);
BOOST_CHECK_EQUAL (DCPTime (1).round_up (DCPTime::HZ / 2), DCPTime (2));
BOOST_CHECK_EQUAL (DCPTime (2).round_up (DCPTime::HZ / 2), DCPTime (2));
BOOST_CHECK_EQUAL (DCPTime (3).round_up (DCPTime::HZ / 2), DCPTime (4));
-
+
BOOST_CHECK_EQUAL (DCPTime (0).round_up (DCPTime::HZ / 42), DCPTime (0));
BOOST_CHECK_EQUAL (DCPTime (1).round_up (DCPTime::HZ / 42), DCPTime (42));
BOOST_CHECK_EQUAL (DCPTime (42).round_up (DCPTime::HZ / 42), DCPTime (42));
BOOST_CHECK_EQUAL (seconds_to_approximate_hms (3600 + 40 * 60), "1h 40m");
BOOST_CHECK_EQUAL (seconds_to_approximate_hms (13 * 3600 + 40 * 60), "14h");
}
+
+BOOST_AUTO_TEST_CASE (raw_convert_test)
+{
+ BOOST_CHECK_EQUAL (raw_convert<string> ("foo"), "foo");
+ BOOST_CHECK_EQUAL (raw_convert<string> ("foo bar"), "foo bar");
+}