--- /dev/null
+/*
+The software in this package is distributed under the GNU General
+Public License version 2 (with a special exception described below).
+
+A copy of GNU General Public License (GPL) is included in this distribution,
+in the file COPYING.GPL.
+
+As a special exception, if other files instantiate templates or use macros
+or inline functions from this file, or you compile this file and link it
+with other works to produce a work based on this file, this file
+does not by itself cause the resulting work to be covered
+by the GNU General Public License.
+
+However the source code for this file must still be made available
+in accordance with section (3) of the GNU General Public License.
+
+This exception does not invalidate any other reasons why a work based
+on this file might be covered by the GNU General Public License.
+*/
+/** @file
+ * test cases for Tribool
+ *
+ * (c) Copyright 2012 by Intra2net AG
+ */
+
+//#define NOISEDEBUG
+
+#include <string>
+#include <iostream>
+#include <sstream>
+#include <exception>
+
+#define BOOST_TEST_DYN_LINK
+#include <boost/test/unit_test.hpp>
+
+#include <tribool.hpp>
+
+#ifdef NOISEDEBUG
+#define DOUT(msg) std::cout << msg << std::endl
+#else
+#define DOUT(msg) do {} while (0)
+#endif
+
+using namespace I2n;
+using namespace std;
+
+class TestTriboolFixture
+{
+public:
+ TestTriboolFixture()
+ {
+ }
+
+ ~TestTriboolFixture()
+ {
+ }
+};
+
+BOOST_FIXTURE_TEST_SUITE(TestTriool, TestTriboolFixture)
+
+BOOST_AUTO_TEST_CASE(CompareTribool1)
+{
+ Tribool a, b;
+
+ a=Tribool::True;
+ b=Tribool::True;
+
+ BOOST_CHECK_EQUAL(a, b);
+}
+
+BOOST_AUTO_TEST_CASE(CompareTribool2)
+{
+ Tribool a, b;
+
+ a=Tribool::False;
+ b=Tribool::False;
+
+ BOOST_CHECK_EQUAL(a, b);
+}
+
+BOOST_AUTO_TEST_CASE(CompareTribool3)
+{
+ Tribool a, b;
+
+ a=Tribool::Undef;
+ b=Tribool::Undef;
+
+ BOOST_CHECK_EQUAL(a, b);
+}
+
+BOOST_AUTO_TEST_CASE(CompareTribool4)
+{
+ Tribool a, b;
+
+ a=Tribool::True;
+ b=Tribool::Undef;
+
+ BOOST_CHECK(a != b);
+}
+
+BOOST_AUTO_TEST_CASE(CompareTribool5)
+{
+ Tribool a, b;
+
+ a=Tribool::False;
+ b=Tribool::Undef;
+
+ BOOST_CHECK(a != b);
+}
+
+BOOST_AUTO_TEST_CASE(IsExact1)
+{
+ Tribool a=Tribool::False;
+
+ BOOST_CHECK_EQUAL(a.is_exact(false),true);
+}
+
+BOOST_AUTO_TEST_CASE(IsExact2)
+{
+ Tribool a=Tribool::True;
+
+ BOOST_CHECK_EQUAL(a.is_exact(true),true);
+}
+
+BOOST_AUTO_TEST_CASE(IsExact3)
+{
+ Tribool a=Tribool::True;
+
+ BOOST_CHECK_EQUAL(a.is_exact(false),false);
+}
+
+BOOST_AUTO_TEST_CASE(IsExact4)
+{
+ Tribool a=Tribool::Undef;
+
+ BOOST_CHECK_EQUAL(a.is_exact(false),false);
+}
+
+BOOST_AUTO_TEST_CASE(IsExact5)
+{
+ Tribool a=Tribool::Undef;
+
+ BOOST_CHECK_EQUAL(a.is_exact(true),false);
+}
+
+BOOST_AUTO_TEST_CASE(OStream)
+{
+ Tribool a=Tribool::True;
+ Tribool b=Tribool::False;
+ Tribool c=Tribool::Undef;
+
+ stringstream os;
+
+ os << a << b << c;
+
+ BOOST_CHECK_EQUAL(os.str(), "10?");
+}
+
+BOOST_AUTO_TEST_SUITE_END()