]> git.localhorst.tv Git - l2e.git/blobdiff - tests/math/RationalTest.h
added Rational template (for fractions)
[l2e.git] / tests / math / RationalTest.h
diff --git a/tests/math/RationalTest.h b/tests/math/RationalTest.h
new file mode 100644 (file)
index 0000000..e288160
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef TEST_MATH_RATIONALTEST_H_
+#define TEST_MATH_RATIONALTEST_H_
+
+#include "../../src/math/Rational.h"
+
+#include <cmath>
+#include <limits>
+#include <cppunit/extensions/HelperMacros.h>
+
+
+namespace test_math {
+
+class RationalTest
+: public CppUnit::TestFixture {
+
+CPPUNIT_TEST_SUITE(RationalTest);
+CPPUNIT_TEST(testConversion);
+CPPUNIT_TEST(testComparison);
+CPPUNIT_TEST(testSum);
+CPPUNIT_TEST(testProduct);
+CPPUNIT_TEST_SUITE_END();
+
+public:
+       void setUp();
+       void tearDown();
+
+       void testConversion();
+       void testComparison();
+       void testSum();
+       void testProduct();
+       void testModulo();
+
+};
+
+}
+
+#endif