[SCM] polybori: Polynomials over Boolean Rings branch, upstream-hg, updated. b4a5cffaa908c53e1d958a42110f8c4dad853aa3

Alexander Dreyer adreyer at gmx.de
Fri Mar 23 08:01:27 UTC 2012


The following commit has been merged in the upstream-hg branch:
commit 700de23d3171fb12a6ee006aabf9d1ba18262e7b
Author: Alexander Dreyer <adreyer at gmx.de>
Date:   Sat Feb 25 00:50:25 2012 +0100

    ADD DelayedLongProductTest

diff --git a/SConstruct b/SConstruct
index b8d1108..d73d908 100644
--- a/SConstruct
+++ b/SConstruct
@@ -965,7 +965,7 @@ env.Clean(DocPath('c++'), docutarget)
 testclasses = Split("""GroebnerStrategy spoly term_accumulate CStringLiteral BooleEnv BooleSet BooleConstant BoolePolyRing BooleExponent BooleVariable BooleMonomial BoolePolynomial PBoRiError CCuddDDFacade DegRevLexAscOrder DegLexOrder
 BlockDegRevLexAscOrder BlockDegLexOrder  LexOrder 
 CFactoryBase MonomialFactory PolynomialFactory VariableFactory SetFactory
-weak_pointers FGLMStrategy""")
+weak_pointers FGLMStrategy DelayedLongProduct""")
 
 # Note: use custom TEST_CPPPATH settings for testing header installation, if any
 try:
diff --git a/testsuite/src/DelayedLongProductTest.cc b/testsuite/src/DelayedLongProductTest.cc
new file mode 100644
index 0000000..a986c66
--- /dev/null
+++ b/testsuite/src/DelayedLongProductTest.cc
@@ -0,0 +1,69 @@
+// -*- c++ -*-
+//*****************************************************************************
+/** @file DelayedLongProductTest.cc
+ *
+ * @author Alexander Dreyer
+ * @date 2012-02-24
+ *
+ * boost/test-driven unit test
+ * 
+ * @par Copyright:
+ *   (c) 2012 by The PolyBoRi Team
+ *
+ **/
+//*****************************************************************************
+
+
+#include <boost/test/unit_test.hpp>
+#include <boost/test/output_test_stream.hpp> 
+using boost::test_tools::output_test_stream;
+
+#include <polybori/groebner/DelayedLongProduct.h>
+#include <polybori/groebner/LongLongConstant.h>
+USING_NAMESPACE_PBORI
+USING_NAMESPACE_PBORIGB
+
+struct Fdelayedlongprod {
+  Fdelayedlongprod() {
+
+    BOOST_TEST_MESSAGE( "setup fixture" );
+  }
+
+  ~Fdelayedlongprod() { BOOST_TEST_MESSAGE( "teardown fixture" ); }
+};
+
+
+BOOST_FIXTURE_TEST_SUITE(DelayedLongProductTest, Fdelayedlongprod)
+
+BOOST_AUTO_TEST_CASE(test_less) {
+
+  BOOST_TEST_MESSAGE( "operator<..." );
+
+  BOOST_CHECK_EQUAL((DelayedLongProduct((unsigned long)(-1), 
+					(unsigned long)(-1)) >
+		     LongLongConstant<(unsigned long)(-1), (unsigned long)(-1)>()), false);
+
+  BOOST_CHECK_EQUAL((DelayedLongProduct((unsigned long)(-1), 
+					(unsigned long)(-1)) >
+		     LongLongConstant<(unsigned long)(-1), 0>()), false);
+
+  BOOST_CHECK_EQUAL((DelayedLongProduct((unsigned long)(-1), 
+					(unsigned long)(-1)) >
+		     LongLongConstant<(unsigned long)(-1)/2, 
+		     (unsigned long)(-1)>()), true);
+
+  BOOST_CHECK_EQUAL((DelayedLongProduct((unsigned long)(2)<<(sizeof(long)*4),
+					(unsigned long)(2)<<(sizeof(long)*4)) >
+		     LongLongConstant<3,(unsigned long)(-1)>()), true);
+
+  BOOST_CHECK_EQUAL((DelayedLongProduct((unsigned long)(2)<<(sizeof(long)*4),
+					(unsigned long)(2)<<(sizeof(long)*4)) >
+		    LongLongConstant<4,0>()), false);
+
+  BOOST_CHECK_EQUAL((DelayedLongProduct((unsigned long)(2)<<(sizeof(long)*4),
+					(unsigned long)(2)<<(sizeof(long)*4) )>
+		    LongLongConstant<4,1>()), false);
+
+}
+
+BOOST_AUTO_TEST_SUITE_END()

-- 
polybori: Polynomials over Boolean Rings



More information about the debian-science-commits mailing list