summaryrefslogtreecommitdiff
path: root/test/effect_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-12-27 23:47:44 +0000
committerCarl Hetherington <cth@carlh.net>2014-12-27 23:47:44 +0000
commit95a8ed5f53bad3414ef2652f8b1e628e05c191c0 (patch)
treeaea9560d670f02457047d5bdc3c5b3ebd04b64ce /test/effect_test.cc
parent0a42284a3d1eb6d9fe6dfbdec02a702d7f613ae1 (diff)
More tests.
Diffstat (limited to 'test/effect_test.cc')
-rw-r--r--test/effect_test.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/effect_test.cc b/test/effect_test.cc
new file mode 100644
index 00000000..cd1a6c3c
--- /dev/null
+++ b/test/effect_test.cc
@@ -0,0 +1,37 @@
+/*
+ Copyright (C) 2014 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.
+
+*/
+
+#include "types.h"
+#include "exceptions.h"
+#include <boost/test/unit_test.hpp>
+
+/** Very simple tests of Effect-related stuff */
+BOOST_AUTO_TEST_CASE (effect_test)
+{
+ BOOST_CHECK_EQUAL (dcp::effect_to_string (dcp::NONE), "none");
+ BOOST_CHECK_EQUAL (dcp::effect_to_string (dcp::BORDER), "border");
+ BOOST_CHECK_EQUAL (dcp::effect_to_string (dcp::SHADOW), "shadow");
+
+ BOOST_CHECK_THROW (dcp::effect_to_string ((dcp::Effect) 42), dcp::MiscError);
+
+ BOOST_CHECK_EQUAL (dcp::string_to_effect ("none"), dcp::NONE);
+ BOOST_CHECK_EQUAL (dcp::string_to_effect ("border"), dcp::BORDER);
+ BOOST_CHECK_EQUAL (dcp::string_to_effect ("shadow"), dcp::SHADOW);
+ BOOST_CHECK_THROW (dcp::string_to_effect ("fish"), dcp::DCPReadError);
+}