A handful of build system fixes:
authorMorgan Deters <mdeters@gmail.com>
Thu, 8 Apr 2010 20:49:11 +0000 (20:49 +0000)
committerMorgan Deters <mdeters@gmail.com>
Thu, 8 Apr 2010 20:49:11 +0000 (20:49 +0000)
* (test/unit/Makefile.am) libtool was being passed relative paths of
  sources in .cpp, confusing lcov if -b wasn't given.  Fixed.
  Closes bug #102.

* (configure.ac) --enable-coverage now implies --enable-static
  --enable-static-binary --disable-shared.

* (configure.ac) Create top-level config.status for informational and
  re-configuration purposes.

* (configure.ac) Remove -fvisibility=hidden for debug builds.
  Closes bug #104.

* (test/unit/Makefile.am) Build unit tests with -Wall.

* (various unit tests) Fixed trivially-fixable warnings in building
  unit tests.  (Signedness in comparison, unused variables, etc.)

* (Makefile.builds.in) Copy the binary correctly if it is static.
  (It was failing, but only with --enable-static --enable-shared
  --enable-static-binary.)  Closes bug #103.

* (src/parser/Makefile.am) libcvc4parser.so now links with libcvc4.so.

* Other minor cleanups to the build system.

16 files changed:
Makefile.builds.in
configure.ac
src/Makefile.am
test/unit/Makefile.am
test/unit/context/cdlist_black.h
test/unit/context/context_mm_black.h
test/unit/expr/attribute_white.h
test/unit/expr/node_black.h
test/unit/expr/node_builder_black.h
test/unit/expr/node_manager_black.h
test/unit/expr/node_white.h
test/unit/theory/theory_black.h
test/unit/theory/theory_uf_white.h
test/unit/util/integer_black.h
test/unit/util/integer_white.h
test/unit/util/rational_white.h

index 1cf9c1a52131d872c18b95b52bff5c3e62c9d8b3..9dd9a314a6fbd9503676b745ed97cc1f1a9d8438 100644 (file)
@@ -30,10 +30,11 @@ bindir = @bindir@
 libdir = @libdir@
 abs_builddir = @abs_builddir@
 
-# Are we building static/dynamic libraries?  One or the other can be
+# Are we building static/dynamic libraries/binaries?  One or the other can be
 # on, or both.
 BUILDING_STATIC = @BUILDING_STATIC@
 BUILDING_SHARED = @BUILDING_SHARED@
+STATIC_BINARY = @STATIC_BINARY@
 
 .PHONY: _default_build_ all
 _default_build_: all
@@ -51,8 +52,8 @@ all:
        $(CURRENT_BUILD)/libtool --mode=install install -v \
                $(CURRENT_BUILD)/src/parser/libcvc4parser.la \
                "$(abs_builddir)$(libdir)"
-ifeq ($(BUILDING_SHARED),1)
-#      if we're building shared libs, relink
+ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10)
+#      if we're building shared libs and the binary is not static, relink
        thelibdir="$(abs_builddir)$(libdir)"; \
        progdir="$(abs_builddir)$(bindir)"; file=cvc4; \
                eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/cvc4 | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
@@ -72,8 +73,8 @@ endif
        $(CURRENT_BUILD)/libtool --mode=install install -v $(CURRENT_BUILD)/src/libcvc4.la "`pwd`$(libdir)"
 #      install libcvc4parser
        $(CURRENT_BUILD)/libtool --mode=install install -v $(CURRENT_BUILD)/src/parser/libcvc4parser.la "`pwd`$(libdir)"
-ifeq ($(BUILDING_SHARED),1)
-#      if we're building shared libs, relink
+ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10)
+#      if we're building shared libs and the binary is not static, relink
        thelibdir="`pwd`$(libdir)"; progdir="`pwd`$(bindir)"; file=cvc4; \
                eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/cvc4 | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
                eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"
index d23cf4a6d5d295afa67e2dd48242fa224c364ccd..a44dc4b66c773573bda936a68f60bbf65d679213 100644 (file)
@@ -50,6 +50,10 @@ CVC4_PARSER_LIBRARY_VERSION=$CVC4_MAJOR:$CVC4_MINOR:$CVC4_RELEASE
 # some things.)
 config_cmdline="$@"
 
+# remember if the user set these explicitly (or whether autoconf does)
+user_specified_enable_or_disable_static=${enable_static+yes}
+user_specified_enable_or_disable_shared=${enable_shared+yes}
+
 # turn off static lib building by default
 AC_ENABLE_SHARED
 AC_DISABLE_STATIC
@@ -157,7 +161,24 @@ elif test -e src/include/cvc4_public.h; then
   cd "builds/$target/$build_type"
   CVC4_CONFIGURE_IN_BUILDS=yes; export CVC4_CONFIGURE_IN_BUILDS
   echo ../../../configure $config_cmdline
-  exec ../../../configure $config_cmdline
+  `pwd`/../../../configure $config_cmdline
+  exitval=$?
+  cd ../../..
+  if test $exitval -eq 0; then
+    cat >config.status <<EOF
+#!/bin/sh -ex
+# Generated by configure, `date`
+# This script part of CVC4.
+
+target='$target'
+build_type='$build_type'
+
+cd "builds/$target/$build_type"
+./config.status "\$@"
+EOF
+    chmod +x config.status
+  fi
+  exit $exitval
 else
   AC_MSG_RESULT([this one (user-specified)])
 fi
@@ -174,6 +195,7 @@ case "$with_build" in
     CVC4CXXFLAGS=
     CVC4CFLAGS=
     CVC4LDFLAGS=
+    FLAG_VISIBILITY_HIDDEN='-fvisibility=hidden'
     if test -z "${OPTLEVEL+set}"            ; then OPTLEVEL=3                       ; fi
     if test -z "${enable_optimized+set}"    ; then enable_optimized=yes             ; fi
     if test -z "${enable_debug_symbols+set}"; then enable_debug_symbols=yes         ; fi
@@ -186,6 +208,7 @@ case "$with_build" in
     CVC4CXXFLAGS='-fno-inline'
     CVC4CFLAGS='-fno-inline'
     CVC4LDFLAGS=
+    FLAG_VISIBILITY_HIDDEN=
     if test -z "${enable_optimized+set}"    ; then enable_optimized=no              ; fi
     if test -z "${enable_debug_symbols+set}"; then enable_debug_symbols=yes         ; fi
     if test -z "${enable_assertions+set}"   ; then enable_assertions=yes            ; fi
@@ -197,6 +220,7 @@ case "$with_build" in
     CVC4CXXFLAGS=
     CVC4CFLAGS=
     CVC4LDFLAGS=
+    FLAG_VISIBILITY_HIDDEN='-fvisibility=hidden'
     if test -z "${OPTLEVEL+set}"            ; then OPTLEVEL=2                       ; fi
     if test -z "${enable_optimized+set}"    ; then enable_optimized=yes             ; fi
     if test -z "${enable_debug_symbols+set}"; then enable_debug_symbols=yes         ; fi
@@ -209,6 +233,7 @@ case "$with_build" in
     CVC4CXXFLAGS='-funroll-all-loops -fexpensive-optimizations -fno-enforce-eh-specs'
     CVC4CFLAGS='-funroll-all-loops -fexpensive-optimizations -fno-enforce-eh-specs'
     CVC4LDFLAGS=
+    FLAG_VISIBILITY_HIDDEN='-fvisibility=hidden'
     if test -z "${OPTLEVEL+set}"            ; then OPTLEVEL=9                       ; fi
     if test -z "${enable_optimized+set}"    ; then enable_optimized=yes             ; fi
     if test -z "${enable_debug_symbols+set}"; then enable_debug_symbols=no          ; fi
@@ -225,12 +250,12 @@ esac
 AC_MSG_CHECKING([whether to build a static binary])
 AC_ARG_ENABLE([static-binary],
      [AS_HELP_STRING([--enable-static-binary],
-                     [build a statically-linked binary [default=no]])])
+                     [build a fully statically-linked binary [default=no]])])
 if test -z "${enable_static_binary+set}"; then
   enable_static_binary=no
 fi
 AC_MSG_RESULT([$enable_static_binary])
-if test "${enable_static_binary}" = yes -a "${enable_static}" != yes; then
+if test "$enable_static_binary" = yes -a "$enable_static" != yes; then
   enable_static=yes
   AC_MSG_WARN([forcing static-library building, --enable-static-binary given])
 fi
@@ -248,11 +273,11 @@ fi
 AC_MSG_RESULT([$enable_optimized])
 
 if test "$enable_optimized" = yes; then
-  CVC4CXXFLAGS="$CVC4CXXFLAGS -O$OPTLEVEL"
-  CVC4CFLAGS="$CVC4CFLAGS -O$OPTLEVEL"
+  CVC4CXXFLAGS="${CVC4CXXFLAGS:+$CVC4CXXFLAGS }-O$OPTLEVEL"
+  CVC4CFLAGS="${CVC4CFLAGS:+$CVC4CFLAGS }-O$OPTLEVEL"
 else
-  CVC4CXXFLAGS="$CVC4CXXFLAGS -O0"
-  CVC4CFLAGS="$CVC4CFLAGS -O0"
+  CVC4CXXFLAGS="${CVC4CXXFLAGS:+$CVC4CXXFLAGS }-O0"
+  CVC4CFLAGS="${CVC4CFLAGS:+$CVC4CFLAGS }-O0"
 fi
 
 AC_MSG_CHECKING([whether to include debugging symbols in libcvc4])
@@ -268,8 +293,8 @@ fi
 AC_MSG_RESULT([$enable_debug_symbols])
 
 if test "$enable_debug_symbols" = yes; then
-  CVC4CXXFLAGS="$CVC4CXXFLAGS -ggdb3"
-  CVC4CFLAGS="$CVC4CFLAGS -ggdb3"
+  CVC4CXXFLAGS="${CVC4CXXFLAGS:+$CVC4CXXFLAGS }-ggdb3"
+  CVC4CFLAGS="${CVC4CFLAGS:+$CVC4CFLAGS }-ggdb3"
 fi
 
 AC_MSG_CHECKING([whether to include assertions in build])
@@ -285,7 +310,7 @@ fi
 AC_MSG_RESULT([$enable_assertions])
 
 if test "$enable_assertions" = yes; then
-  CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_ASSERTIONS"
+  CVC4CPPFLAGS="${CVC4CPPFLAGS:+$CVC4CPPFLAGS }-DCVC4_ASSERTIONS"
 fi
 
 AC_MSG_CHECKING([whether to do a traceable build of CVC4])
@@ -300,7 +325,7 @@ fi
 AC_MSG_RESULT([$enable_tracing])
 
 if test "$enable_tracing" = yes; then
-  CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_TRACING"
+  CVC4CPPFLAGS="${CVC4CPPFLAGS:+$CVC4CPPFLAGS }-DCVC4_TRACING"
 fi
 
 AC_MSG_CHECKING([whether to do a muzzled build of CVC4])
@@ -315,7 +340,7 @@ fi
 AC_MSG_RESULT([$enable_muzzle])
 
 if test "$enable_muzzle" = yes; then
-  CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_MUZZLE"
+  CVC4CPPFLAGS="${CVC4CPPFLAGS:+$CVC4CPPFLAGS }-DCVC4_MUZZLE"
 fi
 
 AC_MSG_CHECKING([whether to do a gcov-enabled build of CVC4])
@@ -330,16 +355,38 @@ fi
 AC_MSG_RESULT([$enable_coverage])
 
 if test "$enable_coverage" = yes; then
-dnl TODO: Is there someway to detect if enable_shared is set by default,
-dnl so that we can automatically disable shared and enable static?
-  if test "$enable_shared" = yes; then
-    AC_MSG_ERROR([Gcov requires static libraries. Use --disable-shared.])
+  # For coverage testing, we prefer:
+  #     --enable-static --disable-shared --disable-static-binary
+  # If the user didn't specify these, we force them here.  If the
+  # user specified them in opposite phase, give warnings that they
+  # shouldn't do that, or bomb out.
+  if test "$user_specified_enable_or_disable_shared" != yes; then
+    enable_shared=no
+    AC_MSG_WARN([turning off shared library building due to --enable-coverage])
+  elif test "$enable_shared" = yes; then
+    AC_MSG_WARN([])
+    AC_MSG_WARN([It is not recommended to configure with --enable-coverage --enable-shared])
+    AC_MSG_WARN([gcov does not support shared libraries, so only your static libraries will be coverage-testable.])
+    AC_MSG_WARN([Your cvc4 driver and testing binaries will not be coverage-testable.])
+    AC_MSG_WARN([])
+  fi
+  if test "${enable_static_binary+set}" = set -a "$enable_static_binary" = yes; then
+    AC_MSG_WARN([])
+    AC_MSG_WARN([It is not recommended to configure with --enable-coverage --enable-static-binary])
+    AC_MSG_WARN([Your cvc4 driver and testing binaries will be fully-statically linked and may not be coverage-testable.])
+    AC_MSG_WARN([])
+  fi
+  if test "$user_specified_enable_or_disable_static" != yes; then
+    enable_static=yes
+    AC_MSG_WARN([turning on static library building due to --enable-coverage])
+  elif test "$enable_static" != yes; then
+    AC_MSG_ERROR([--enable-coverage and --disable-static are incompatible; gcov only supports static libraries.])
   fi
 
-  CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_COVERAGE"
-  CVC4CXXFLAGS="$CVC4CXXFLAGS --coverage"
-  CVC4CFLAGS="$CVC4CFLAGS --coverage"
-  CVC4LDFLAGS="$CVC4LDFLAGS --coverage"
+  CVC4CPPFLAGS="${CVC4CPPFLAGS:+$CVC4CPPFLAGS }-DCVC4_COVERAGE"
+  CVC4CXXFLAGS="${CVC4CXXFLAGS:+$CVC4CXXFLAGS }--coverage"
+  CVC4CFLAGS="${CVC4CFLAGS:+$CVC4CFLAGS }--coverage"
+  CVC4LDFLAGS="${CVC4LDFLAGS:+$CVC4LDFLAGS }--coverage"
 fi
 
 AC_MSG_CHECKING([whether to do a profiling-enabled build of CVC4])
@@ -355,10 +402,10 @@ fi
 AC_MSG_RESULT([$enable_profiling])
 
 if test "$enable_profiling" = yes; then
-  CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_PROFILING"
-  CVC4CXXFLAGS="$CVC4CXXFLAGS -pg"
-  CVC4CFLAGS="$CVC4CFLAGS -pg"
-  CVC4LDFLAGS="$CVC4LDFLAGS -pg"
+  CVC4CPPFLAGS="${CVC4CPPFLAGS:+$CVC4CPPFLAGS }-DCVC4_PROFILING"
+  CVC4CXXFLAGS="${CVC4CXXFLAGS:+$CVC4CXXFLAGS }-pg"
+  CVC4CFLAGS="${CVC4CFLAGS:+$CVC4CFLAGS }-pg"
+  CVC4LDFLAGS="${CVC4LDFLAGS:+$CVC4LDFLAGS }-pg"
 fi
 
 AM_INIT_AUTOMAKE([1.11 no-define])
@@ -462,10 +509,12 @@ AC_TYPE_SIZE_T
 
 # Prepare configure output
 
-if test "$enable_shared" = yes; then BUILDING_SHARED=1; fi
-if test "$enable_static" = yes; then BUILDING_STATIC=1; fi
+if test "$enable_shared" = yes; then BUILDING_SHARED=1; else BUILDING_SHARED=0; fi
+if test "$enable_static" = yes; then BUILDING_STATIC=1; else BUILDING_STATIC=0; fi
+if test "$enable_static_binary" = yes; then STATIC_BINARY=1; else STATIC_BINARY=0; fi
 AC_SUBST(BUILDING_SHARED)
 AC_SUBST(BUILDING_STATIC)
+AC_SUBST(STATIC_BINARY)
 AM_CONDITIONAL([STATIC_BINARY], [test "$enable_static_binary" = yes])
 
 AC_SUBST(CVC4_LIBRARY_VERSION)
@@ -481,7 +530,6 @@ CXXFLAGS="${CXXFLAGS:+$CXXFLAGS }$CVC4CXXFLAGS -Wno-deprecated"
 CFLAGS="${CFLAGS:+$CFLAGS }$CVC4CFLAGS -Wno-deprecated -fexceptions"
 LDFLAGS="${LDFLAGS:+$LDFLAGS }$CVC4LDFLAGS"
 
-FLAG_VISIBILITY_HIDDEN='-fvisibility=hidden'
 AC_SUBST(FLAG_VISIBILITY_HIDDEN)
 
 # mk_include
@@ -520,10 +568,7 @@ if test "$custom_build_profile" = yes; then
   if test "$with_build" = default; then
     with_build=custom
   else
-    AC_MSG_WARN([])
-    AC_MSG_WARN([This is a customized $with_build build profile.])
-    AC_MSG_WARN([])
-    with_build="$with_build-custom"
+    with_build="$with_build (customized)"
   fi
 fi
 
index 593499c9b015599eb1d9355f04ca279edf690857..cb529dcdeb94c82e09ea819149537ec815094816 100644 (file)
@@ -55,7 +55,3 @@ install-data-local: $(publicheaders)
                echo $(INSTALL_DATA) "$(srcdir)/$$f" "$(DESTDIR)/$(includedir)/cvc4"; \
                $(INSTALL_DATA) "$(srcdir)/$$f" "$(DESTDIR)/$(includedir)/cvc4"; \
        done
-
-include/cvc4.h: smt/smt_engine.h
-       @srcdir@/headergen.pl $< $@
-include/cvc4_expr.h: expr/expr.h
index 4ff65a67236e21480f1c4ba045e5578f44531b90..c52ac5d1c005ffcad3afe021cf9c880617d16668 100644 (file)
@@ -48,7 +48,7 @@ if HAVE_CXXTESTGEN
 AM_CPPFLAGS = \
        -I. "-I@CXXTEST@" "-I@top_srcdir@/src/include" "-I@top_srcdir@/src" \
        $(TEST_CPPFLAGS)
-AM_CXXFLAGS = $(TEST_CXXFLAGS)
+AM_CXXFLAGS = -Wall $(TEST_CXXFLAGS)
 AM_LDFLAGS = $(TEST_LDFLAGS)
 
 AM_CXXFLAGS_WHITE = -fno-access-control -D__BUILDING_CVC4LIB_UNIT_TEST -D__BUILDING_CVC4PARSERLIB_UNIT_TEST
@@ -85,13 +85,13 @@ $(UNIT_TESTS:%=%.cpp): %.cpp: %.h
        $(AM_V_at)mkdir -p `dirname "$@"`
        $(AM_V_GEN)$(CXXTESTGEN) --have-eh --have-std --error-printer -o "$@" "$<"
 $(WHITE_TESTS): %_white: %_white.cpp $(TEST_DEPS)
-       $(AM_V_CXX)$(LTCXXCOMPILE) $(AM_CXXFLAGS_WHITE) -c -o $@.lo $<
+       $(AM_V_CXX)$(LTCXXCOMPILE) $(AM_CXXFLAGS_WHITE) -c -o $@.lo @abs_builddir@/$<
        $(AM_V_CXXLD)$(unit_LINK) $(AM_LDFLAGS_WHITE) $@.lo
 $(BLACK_TESTS): %_black: %_black.cpp $(TEST_DEPS)
-       $(AM_V_CXX)$(LTCXXCOMPILE) $(AM_CXXFLAGS_BLACK) -c -o $@.lo $<
+       $(AM_V_CXX)$(LTCXXCOMPILE) $(AM_CXXFLAGS_BLACK) -c -o $@.lo @abs_builddir@/$<
        $(AM_V_CXXLD)$(unit_LINK) $(AM_LDFLAGS_BLACK) $@.lo
 $(PUBLIC_TESTS): %_public: %_public.cpp $(TEST_DEPS)
-       $(AM_V_CXX)$(LTCXXCOMPILE) $(AM_CXXFLAGS_PUBLIC) -c -o $@.lo $<
+       $(AM_V_CXX)$(LTCXXCOMPILE) $(AM_CXXFLAGS_PUBLIC) -c -o $@.lo @abs_builddir@/$<
        $(AM_V_CXXLD)$(unit_LINK) $(AM_LDFLAGS_PUBLIC) $@.lo
 
 else
index b083f4794e979c98df2351b235919e83c2823df2..f31d5f27387b349830b9f769dc84423c45e99329 100644 (file)
@@ -48,21 +48,21 @@ public:
 
     TS_ASSERT(list.empty());
     for(int i = 0; i < N; ++i) {
-      TS_ASSERT(list.size() == i);
+      TS_ASSERT_EQUALS(list.size(), unsigned(i));
       list.push_back(i);
       TS_ASSERT(!list.empty());
-      TS_ASSERT(list.back() == i);
+      TS_ASSERT_EQUALS(list.back(), i);
       int i2 = 0;
       for(CDList<int>::const_iterator j = list.begin();
           j != list.end();
           ++j) {
-        TS_ASSERT(*j == i2++);
+        TS_ASSERT_EQUALS(*j, i2++);
       }
     }
-    TS_ASSERT(list.size() == N);
+    TS_ASSERT_EQUALS(list.size(), unsigned(N));
 
     for(int i = 0; i < N; ++i) {
-      TS_ASSERT(list[i] == i);
+      TS_ASSERT_EQUALS(list[i], i);
     }
   }
 
index bda1cb14137a4cabe8b0f2f35201a6d1a6c8ea41..e25d1f33631095b2f158d27cd8813b6642d829cd 100644 (file)
@@ -10,7 +10,7 @@
  ** See the file COPYING in the top-level source directory for licensing
  ** information.
  **
- ** Black box testing of CVC4::Node.
+ ** Black box testing of CVC4::context::ContextMemoryManager.
  **/
 
 #include <cxxtest/TestSuite.h>
@@ -40,23 +40,24 @@ public:
     // Push, then allocate, then pop
     // We make sure that we don't allocate too much so that all the regions
     // should be reclaimed
-    int chunkSizeBytes = 16384;
-    int maxFreeChunks = 100;
-    int piecesPerChunk = 13;
-    int len = chunkSizeBytes / piecesPerChunk; // Length of the individual block
-    int N = maxFreeChunks*piecesPerChunk;
-    for (int p = 0; p < 5; ++ p) {
+    unsigned chunkSizeBytes = 16384;
+    unsigned maxFreeChunks = 100;
+    unsigned piecesPerChunk = 13;
+    unsigned len = chunkSizeBytes / piecesPerChunk; // Length of the individual block
+    unsigned N = maxFreeChunks*piecesPerChunk;
+    for(unsigned p = 0; p < 5; ++ p) {
       d_cmm->push();
-      for (int i = 0; i < N; ++i) {
+      for(unsigned i = 0; i < N; ++i) {
         char* newMem = (char*)d_cmm->newData(len);
         // We only setup the memory in the first run, the others should
         // reclaim the same memory
-        if (p == 0) {
-          for(int k = 0; k < len - 1; k ++)
+        if(p == 0) {
+          for(unsigned k = 0; k < len - 1; k ++) {
             newMem[k] = 'a';
+          }
           newMem[len-1] = 0;
         }
-        if (strlen(newMem) != len - 1) {
+        if(strlen(newMem) != len - 1) {
           cout << strlen(newMem) << " : " << len - 1 << endl;
         }
         TS_ASSERT(strlen(newMem) == len - 1);
@@ -64,22 +65,23 @@ public:
       d_cmm->pop();
     }
 
-    int factor = 3;
-    N = 16384/factor;
+    unsigned factor = 3;
+    N = 16384 / factor;
 
     // Push, then allocate, then pop all at once
-    for (int p = 0; p < 5; ++ p) {
+    for(unsigned p = 0; p < 5; ++ p) {
       d_cmm->push();
-      for (int i = 1; i < N; ++i) {
-        int len = i*factor;
+      for(unsigned i = 1; i < N; ++i) {
+        unsigned len = i * factor;
         char* newMem = (char*)d_cmm->newData(len);
-        for(int k = 0; k < len - 1; k ++)
+        for(unsigned k = 0; k < len - 1; k ++) {
           newMem[k] = 'a';
+        }
         newMem[len-1] = 0;
         TS_ASSERT(strlen(newMem) == len - 1);
       }
     }
-    for (int p = 0; p < 5; ++ p) {
+    for(unsigned p = 0; p < 5; ++ p) {
       d_cmm->pop();
     }
 
index e0d9d6bf46b4b55842aaab245058982bc7090b1a..e3b7811a4c3366771cc901d00981a4bafefb1578 100644 (file)
@@ -149,8 +149,6 @@ public:
   }
 
   void testCDAttributes() {
-    AttributeManager& am = d_nm->d_attrManager;
-
     //Debug.on("boolattr");
 
     Node a = d_nm->mkVar(d_booleanType);
@@ -279,8 +277,6 @@ public:
   }
 
   void testAttributes() {
-    AttributeManager& am = d_nm->d_attrManager;
-
     //Debug.on("boolattr");
 
     Node a = d_nm->mkVar(d_booleanType);
index 17657683d38e5023c4acf4e6500dca4e953aa88f..23d1daf4e2c0713c854ae18cdf9be7eee1abaa39 100644 (file)
@@ -423,10 +423,10 @@ public:
 #endif /* CVC4_ASSERTIONS */
   }
 
-  void testNaryExpForSize(Kind k, int N) {
+  void testNaryExpForSize(Kind k, unsigned N) {
     NodeBuilder<> nbz(k);
     Node trueNode = d_nodeManager->mkConst(true);
-    for(int i = 0; i < N; ++i) {
+    for(unsigned i = 0; i < N; ++i) {
       nbz << trueNode;
     }
     Node result = nbz;
@@ -452,7 +452,7 @@ public:
     srand(0);
     int trials = 500;
     for(int i = 0; i < trials; ++i) {
-      int N = rand() % 1000 + 2;
+      unsigned N = rand() % 1000 + 2;
       testNaryExpForSize(AND, N);
     }
 
index eec6949f08019d9b546e2bd8d3970b6934d49a4c..4521f3bf639576fe197ef46eeac5de02491f9671 100644 (file)
@@ -64,8 +64,8 @@ public:
     }
   }
 
-#define K 30
-#define LARGE_K UINT_MAX/40
+#define K 30u
+#define LARGE_K UINT_MAX / 40
 
   Kind specKind;
 
@@ -84,23 +84,23 @@ public:
     /* default size tests */
     NodeBuilder<> def;
     TS_ASSERT_EQUALS(def.getKind(), UNDEFINED_KIND);
-    TS_ASSERT_EQUALS(def.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(def.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(def.begin(), def.end());
 
     NodeBuilder<> spec(specKind);
     TS_ASSERT_EQUALS(spec.getKind(), specKind);
-    TS_ASSERT_EQUALS(spec.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(spec.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(spec.begin(), spec.end());
 
 
     NodeBuilder<> from_nm(d_nm);
     TS_ASSERT_EQUALS(from_nm.getKind(), UNDEFINED_KIND);
-    TS_ASSERT_EQUALS(from_nm.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(from_nm.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(from_nm.begin(), from_nm.end());
 
     NodeBuilder<> from_nm_kind(d_nm, specKind);
     TS_ASSERT_EQUALS(from_nm_kind.getKind(), specKind);
-    TS_ASSERT_EQUALS(from_nm_kind.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(from_nm_kind.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(from_nm_kind.begin(), from_nm_kind.end());
 
 
@@ -108,23 +108,23 @@ public:
 
     NodeBuilder<K> ws;
     TS_ASSERT_EQUALS(ws.getKind(), UNDEFINED_KIND);
-    TS_ASSERT_EQUALS(ws.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(ws.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(ws.begin(), ws.end());
 
     NodeBuilder<K> ws_kind(specKind);
     TS_ASSERT_EQUALS(ws_kind.getKind(), specKind);
-    TS_ASSERT_EQUALS(ws_kind.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(ws_kind.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(ws_kind.begin(), ws_kind.end());
 
 
     NodeBuilder<K> ws_from_nm(d_nm);
     TS_ASSERT_EQUALS(ws_from_nm.getKind(), UNDEFINED_KIND);
-    TS_ASSERT_EQUALS(ws_from_nm.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(ws_from_nm.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(ws_from_nm.begin(), ws_from_nm.end());
 
     NodeBuilder<K> ws_from_nm_kind(d_nm, specKind);
     TS_ASSERT_EQUALS(ws_from_nm_kind.getKind(), specKind);
-    TS_ASSERT_EQUALS(ws_from_nm_kind.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(ws_from_nm_kind.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(ws_from_nm_kind.begin(), ws_from_nm_kind.end());
 
 
@@ -137,23 +137,23 @@ public:
 
     NodeBuilder<> copy(def);
     TS_ASSERT_EQUALS(copy.getKind(), UNDEFINED_KIND);
-    TS_ASSERT_EQUALS(copy.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(copy.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(copy.begin(), copy.end());
 
     NodeBuilder<K> cp_ws(ws);
     TS_ASSERT_EQUALS(cp_ws.getKind(), UNDEFINED_KIND);
-    TS_ASSERT_EQUALS(cp_ws.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(cp_ws.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(cp_ws.begin(), cp_ws.end());
 
 
     NodeBuilder<K-10> cp_from_larger(ws);
     TS_ASSERT_EQUALS(cp_from_larger.getKind(), UNDEFINED_KIND);
-    TS_ASSERT_EQUALS(cp_from_larger.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(cp_from_larger.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(cp_from_larger.begin(), cp_from_larger.end());
 
     NodeBuilder<K+10> cp_from_smaller(ws);
     TS_ASSERT_EQUALS(cp_from_smaller.getKind(), UNDEFINED_KIND);
-    TS_ASSERT_EQUALS(cp_from_smaller.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(cp_from_smaller.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(cp_from_smaller.begin(), cp_from_smaller.end());
 
   }
@@ -174,14 +174,14 @@ public:
     TS_ASSERT_DIFFERS(ws.begin(), ws.end());
 
     NodeBuilder<K>::iterator iter = ws.begin();
-    for(int i = 0; i < K; ++i){
+    for(unsigned i = 0; i < K; ++i){
       TS_ASSERT_DIFFERS(iter, ws.end());
       ++iter;
     }
     TS_ASSERT_EQUALS(iter, ws.end());
 
     NodeBuilder<K>::const_iterator citer = ws.begin();
-    for(int i = 0; i < K; ++i){
+    for(unsigned i = 0; i < K; ++i){
       TS_ASSERT_DIFFERS(citer, ws.end());
       ++citer;
     }
@@ -196,14 +196,14 @@ public:
     TS_ASSERT_DIFFERS(smaller.begin(), smaller.end());
 
     NodeBuilder<>::iterator smaller_iter = smaller.begin();
-    for(int i = 0; i < K; ++i){
+    for(unsigned i = 0; i < K; ++i){
       TS_ASSERT_DIFFERS(smaller_iter, smaller.end());
       ++smaller_iter;
     }
     TS_ASSERT_EQUALS(iter, ws.end());
 
     NodeBuilder<>::const_iterator smaller_citer = smaller.begin();
-    for(int i = 0; i < K; ++i){
+    for(unsigned i = 0; i < K; ++i){
       TS_ASSERT_DIFFERS(smaller_citer, smaller.end());
       ++smaller_citer;
     }
@@ -261,24 +261,24 @@ public:
     /* unsigned getNumChildren() const; */
 
     NodeBuilder<> noKind;
-    TS_ASSERT_EQUALS(noKind.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(noKind.getNumChildren(), 0u);
     push_back(noKind, K);
 
     TS_ASSERT_EQUALS(noKind.getNumChildren(), K);
 
     push_back(noKind, K);
-    TS_ASSERT_EQUALS(noKind.getNumChildren(), K+K);
+    TS_ASSERT_EQUALS(noKind.getNumChildren(), K + K);
 
     noKind << AND;// avoid exception on marking it used
     Node n = noKind;// avoid warning on clear()
     noKind.clear();
-    TS_ASSERT_EQUALS(noKind.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(noKind.getNumChildren(), 0u);
     push_back(noKind, K);
 
     TS_ASSERT_EQUALS(noKind.getNumChildren(), K);
 
     push_back(noKind, K);
-    TS_ASSERT_EQUALS(noKind.getNumChildren(), K+K);
+    TS_ASSERT_EQUALS(noKind.getNumChildren(), K + K);
 
 #ifdef CVC4_ASSERTIONS
     noKind << specKind;
@@ -320,7 +320,7 @@ public:
 
     TS_ASSERT_EQUALS(arr[0], i_0);
     TS_ASSERT_EQUALS(arr[2], i_2);
-    for(int i = 3; i < K; ++i) {
+    for(unsigned i = 3; i < K; ++i) {
       TS_ASSERT_EQUALS(arr[i], d_nm->mkConst(true));
     }
 
@@ -328,7 +328,7 @@ public:
 
     TS_ASSERT_EQUALS(arr[0], i_0);
     TS_ASSERT_EQUALS(arr[2], i_2);
-    for(int i = 3; i < K; ++i) {
+    for(unsigned i = 3; i < K; ++i) {
       TS_ASSERT_EQUALS(arr[i], d_nm->mkConst(true));
     }
     TS_ASSERT_EQUALS(arr[K], i_K);
@@ -344,7 +344,7 @@ public:
     NodeBuilder<> nb;
 
     TS_ASSERT_EQUALS(nb.getKind(), UNDEFINED_KIND);
-    TS_ASSERT_EQUALS(nb.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(nb.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(nb.begin(), nb.end());
 
     nb << specKind;
@@ -358,7 +358,7 @@ public:
     nb.clear();
 
     TS_ASSERT_EQUALS(nb.getKind(), UNDEFINED_KIND);
-    TS_ASSERT_EQUALS(nb.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(nb.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(nb.begin(), nb.end());
 
     nb << specKind;
@@ -372,7 +372,7 @@ public:
     nb.clear(specKind);
 
     TS_ASSERT_EQUALS(nb.getKind(), specKind);
-    TS_ASSERT_EQUALS(nb.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(nb.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(nb.begin(), nb.end());
 
     push_back(nb, K);
@@ -380,7 +380,7 @@ public:
     nb.clear();
 
     TS_ASSERT_EQUALS(nb.getKind(), UNDEFINED_KIND);
-    TS_ASSERT_EQUALS(nb.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(nb.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(nb.begin(), nb.end());
 
   }
@@ -437,7 +437,7 @@ public:
     /* NodeBuilder& operator<<(const Node& n); */
     NodeBuilder<K> nb(specKind);
     TS_ASSERT_EQUALS(nb.getKind(), specKind);
-    TS_ASSERT_EQUALS(nb.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(nb.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(nb.begin(), nb.end());
     push_back(nb,K);
     TS_ASSERT_EQUALS(nb.getKind(), specKind);
@@ -451,13 +451,13 @@ public:
 
     NodeBuilder<> overflow(specKind);
     TS_ASSERT_EQUALS(overflow.getKind(), specKind);
-    TS_ASSERT_EQUALS(overflow.getNumChildren(), 0);
+    TS_ASSERT_EQUALS(overflow.getNumChildren(), 0u);
     TS_ASSERT_EQUALS(overflow.begin(), overflow.end());
 
     push_back(overflow,5*K+1);
 
     TS_ASSERT_EQUALS(overflow.getKind(), specKind);
-    TS_ASSERT_EQUALS(overflow.getNumChildren(), 5*K+1);
+    TS_ASSERT_EQUALS(overflow.getNumChildren(), 5 * K + 1);
     TS_ASSERT_DIFFERS(overflow.begin(), overflow.end());
 
   }
@@ -598,16 +598,16 @@ public:
     Node f = d_nm->mkVar(d_booleanType);
 
     Node m = a && b;
-    Node n = a && b || c;
+    Node n = (a && b) || c;
     Node o = d + e - b;
-    Node p = a && o || c;
+    Node p = (a && o) || c;
 
     Node x = d + e + o - m;
     Node y = f - a - c + e;
 
     Node q = a && b && c;
 
-    Node r = e && d && b && a || x && y || f || q && a;
+    Node r = (e && d && b && a) || (x && y) || f || (q && a);
 
     TS_ASSERT_EQUALS(m, d_nm->mkNode(AND, a, b));
     TS_ASSERT_EQUALS(n, d_nm->mkNode(OR, m, c));
index 3e65be0b797f65a983f835ce9ed42642584a1ad3..e059fa50951ed616ad73aa49e639f5f9e16b0313 100644 (file)
@@ -52,7 +52,7 @@ public:
   void testMkNode1() {
     Node x = d_nodeManager->mkVar("x",d_nodeManager->booleanType());
     Node n = d_nodeManager->mkNode(NOT, x);
-    TS_ASSERT_EQUALS( n.getNumChildren(), 1 );
+    TS_ASSERT_EQUALS( n.getNumChildren(), 1u );
     TS_ASSERT_EQUALS( n.getKind(), NOT);
     TS_ASSERT_EQUALS( n[0], x);
   }
@@ -61,7 +61,7 @@ public:
     Node x = d_nodeManager->mkVar("x",d_nodeManager->booleanType());
     Node y = d_nodeManager->mkVar("y",d_nodeManager->booleanType());
     Node n = d_nodeManager->mkNode(IMPLIES, x, y);
-    TS_ASSERT_EQUALS( n.getNumChildren(), 2 );
+    TS_ASSERT_EQUALS( n.getNumChildren(), 2u );
     TS_ASSERT_EQUALS( n.getKind(), IMPLIES);
     TS_ASSERT_EQUALS( n[0], x);
     TS_ASSERT_EQUALS( n[1], y);
@@ -72,7 +72,7 @@ public:
     Node y = d_nodeManager->mkVar("y",d_nodeManager->booleanType());
     Node z = d_nodeManager->mkVar("z",d_nodeManager->booleanType());
     Node n = d_nodeManager->mkNode(AND, x, y, z);
-    TS_ASSERT_EQUALS( n.getNumChildren(), 3 );
+    TS_ASSERT_EQUALS( n.getNumChildren(), 3u );
     TS_ASSERT_EQUALS( n.getKind(), AND);
     TS_ASSERT_EQUALS( n[0], x);
     TS_ASSERT_EQUALS( n[1], y);
@@ -85,12 +85,12 @@ public:
     Node x3 = d_nodeManager->mkVar("x3",d_nodeManager->booleanType());
     Node x4 = d_nodeManager->mkVar("x4",d_nodeManager->booleanType());
     Node n = d_nodeManager->mkNode(AND, x1, x2, x3, x4);
-    TS_ASSERT_EQUALS( n.getNumChildren(), 4 );
-    TS_ASSERT_EQUALS( n.getKind(), AND);
-    TS_ASSERT_EQUALS( n[0], x1);
-    TS_ASSERT_EQUALS( n[1], x2);
-    TS_ASSERT_EQUALS( n[2], x3);
-    TS_ASSERT_EQUALS( n[3], x4);
+    TS_ASSERT_EQUALS( n.getNumChildren(), 4u );
+    TS_ASSERT_EQUALS( n.getKind(), AND );
+    TS_ASSERT_EQUALS( n[0], x1 );
+    TS_ASSERT_EQUALS( n[1], x2 );
+    TS_ASSERT_EQUALS( n[2], x3 );
+    TS_ASSERT_EQUALS( n[3], x4 );
   }
 
   void testMkNode5() {
@@ -100,7 +100,7 @@ public:
     Node x4 = d_nodeManager->mkVar("x4",d_nodeManager->booleanType());
     Node x5 = d_nodeManager->mkVar("x5",d_nodeManager->booleanType());
     Node n = d_nodeManager->mkNode(AND, x1, x2, x3, x4, x5);
-    TS_ASSERT_EQUALS( n.getNumChildren(), 5 );
+    TS_ASSERT_EQUALS( n.getNumChildren(), 5u );
     TS_ASSERT_EQUALS( n.getKind(), AND);
     TS_ASSERT_EQUALS( n[0], x1);
     TS_ASSERT_EQUALS( n[1], x2);
@@ -120,7 +120,7 @@ public:
     Node n = d_nodeManager->mkNode(AND, args);
     TS_ASSERT_EQUALS( n.getNumChildren(), args.size() );
     TS_ASSERT_EQUALS( n.getKind(), AND);
-    for( int i=0; i < args.size(); ++i ) {
+    for( unsigned i = 0; i < args.size(); ++i ) {
       TS_ASSERT_EQUALS( n[i], args[i]);
     }
   }
@@ -136,7 +136,7 @@ public:
     Node n = d_nodeManager->mkNode(AND, args);
     TS_ASSERT_EQUALS( n.getNumChildren(), args.size() );
     TS_ASSERT_EQUALS( n.getKind(), AND);
-    for( int i=0; i < args.size(); ++i ) {
+    for( unsigned i = 0; i < args.size(); ++i ) {
       TS_ASSERT_EQUALS( n[i], args[i]);
     }
   }
@@ -145,7 +145,7 @@ public:
     Type* booleanType = d_nodeManager->booleanType();
     Node x = d_nodeManager->mkVar(booleanType);
     TS_ASSERT_EQUALS(x.getKind(),VARIABLE);
-    TS_ASSERT_EQUALS(x.getNumChildren(),0);
+    TS_ASSERT_EQUALS(x.getNumChildren(),0u);
     TS_ASSERT_EQUALS(x.getType(),booleanType);
   }
 
@@ -153,7 +153,7 @@ public:
     Type* booleanType = d_nodeManager->booleanType();
     Node x = d_nodeManager->mkVar("x", booleanType);
     TS_ASSERT_EQUALS(x.getKind(),VARIABLE);
-    TS_ASSERT_EQUALS(x.getNumChildren(),0);
+    TS_ASSERT_EQUALS(x.getNumChildren(),0u);
     TS_ASSERT_EQUALS(x.getAttribute(VarNameAttr()),"x");
     TS_ASSERT_EQUALS(x.getType(),booleanType);
   }
@@ -219,7 +219,7 @@ public:
     TS_ASSERT( t->isFunction() );
 
     FunctionType* ft = (FunctionType*)t;
-    TS_ASSERT_EQUALS(ft->getArgTypes().size(), 1);
+    TS_ASSERT_EQUALS(ft->getArgTypes().size(), 1u);
     TS_ASSERT_EQUALS(ft->getArgTypes()[0], booleanType);
     TS_ASSERT_EQUALS(ft->getRangeType(), booleanType);
 
index 28dbde93358f1c4667cd1fe5391f85db9f4165d5..9facd00f66c7bfa273eb81946af8fbc138b6c975 100644 (file)
@@ -51,7 +51,7 @@ public:
   }
 
   void testNull() {
-    Node::s_null;
+    TS_ASSERT_EQUALS(Node::null(), Node::s_null);
   }
 
   void testCopyCtor() {
index 905294c275fcc7f8f83ee2836c2aec88bd4bb31f..24c8e407c9afe28484d4d23e3414e4021006e0b9 100644 (file)
@@ -228,7 +228,7 @@ public:
 
     TS_ASSERT_EQUALS(got, f_x_eq_x);
 
-    TS_ASSERT_EQUALS(5, d_dummy->d_registered.size());
+    TS_ASSERT_EQUALS(5u, d_dummy->d_registered.size());
     TS_ASSERT(d_dummy->d_registered.find(x) != d_dummy->d_registered.end());
     TS_ASSERT(d_dummy->d_registered.find(f) != d_dummy->d_registered.end());
     TS_ASSERT(d_dummy->d_registered.find(f_x) != d_dummy->d_registered.end());
index 369be5a16407fd0a9a89cf641271cda11eafeb42..c02214a2591fe6ce2ba9e119606d1be54f42a148 100644 (file)
@@ -145,7 +145,7 @@ public:
     d_euf->assertFact( f5_x_eq_x );
     d_euf->check(d_level);
 
-    TS_ASSERT_EQUALS(1, d_outputChannel.getNumCalls());
+    TS_ASSERT_EQUALS(1u, d_outputChannel.getNumCalls());
     TS_ASSERT_EQUALS(CONFLICT, d_outputChannel.getIthCallType(0));
     Node realConflict = d_outputChannel.getIthNode(0);
     TS_ASSERT_EQUALS(expectedConflict, realConflict);
index afd2145e31727b8524b17e9656838f44f9129a3f..c09db220767252f4c5f5056aeec53dedd13d28d8 100644 (file)
@@ -45,16 +45,16 @@ public:
     TS_ASSERT_EQUALS(z4.getLong(), 0);
 
     Integer z5("7896890");
-    TS_ASSERT_EQUALS(z5.getUnsignedLong(), 7896890);
+    TS_ASSERT_EQUALS(z5.getUnsignedLong(), 7896890ul);
 
     Integer z6(z5);
-    TS_ASSERT_EQUALS(z5.getUnsignedLong(), 7896890);
-    TS_ASSERT_EQUALS(z6.getUnsignedLong(), 7896890);
+    TS_ASSERT_EQUALS(z5.getUnsignedLong(), 7896890ul);
+    TS_ASSERT_EQUALS(z6.getUnsignedLong(), 7896890ul);
 
 
     string bigValue("1536729");
     Integer z7(bigValue);
-    TS_ASSERT_EQUALS(z7.getUnsignedLong(), 1536729);
+    TS_ASSERT_EQUALS(z7.getUnsignedLong(), 1536729ul);
   }
 
   void testOperatorAssign(){
@@ -62,24 +62,24 @@ public:
     Integer y(79);
     Integer z(45789);
 
-    TS_ASSERT_EQUALS(x.getUnsignedLong(), 0);
-    TS_ASSERT_EQUALS(y.getUnsignedLong(), 79);
-    TS_ASSERT_EQUALS(z.getUnsignedLong(), 45789);
+    TS_ASSERT_EQUALS(x.getUnsignedLong(), 0ul);
+    TS_ASSERT_EQUALS(y.getUnsignedLong(), 79ul);
+    TS_ASSERT_EQUALS(z.getUnsignedLong(), 45789ul);
 
     x = y = z;
 
-    TS_ASSERT_EQUALS(x.getUnsignedLong(), 45789);
-    TS_ASSERT_EQUALS(y.getUnsignedLong(), 45789);
-    TS_ASSERT_EQUALS(z.getUnsignedLong(), 45789);
+    TS_ASSERT_EQUALS(x.getUnsignedLong(), 45789ul);
+    TS_ASSERT_EQUALS(y.getUnsignedLong(), 45789ul);
+    TS_ASSERT_EQUALS(z.getUnsignedLong(), 45789ul);
 
     Integer a(2);
 
     y = a;
 
-    TS_ASSERT_EQUALS(a.getUnsignedLong(), 2);
-    TS_ASSERT_EQUALS(y.getUnsignedLong(), 2);
-    TS_ASSERT_EQUALS(x.getUnsignedLong(), 45789);
-    TS_ASSERT_EQUALS(z.getUnsignedLong(), 45789);
+    TS_ASSERT_EQUALS(a.getUnsignedLong(), 2ul);
+    TS_ASSERT_EQUALS(y.getUnsignedLong(), 2ul);
+    TS_ASSERT_EQUALS(x.getUnsignedLong(), 45789ul);
+    TS_ASSERT_EQUALS(z.getUnsignedLong(), 45789ul);
   }
 
   void testOperatorEquals(){
index ef0e0b92fdee9dc14ebd19e4f14870b47f06ce2d..3a86289a38102e8983c239fde466aa01c0e41ad7 100644 (file)
@@ -33,9 +33,9 @@ public:
     Integer fits_in_16_bytes("7890D789D33234027890D789D3323402", 16);
 
 
-    TS_ASSERT_THROWS_NOTHING(size_t res0 = zero.hash());
-    TS_ASSERT_THROWS_NOTHING(size_t res1 = fits_in_2_bytes.hash());
-    TS_ASSERT_THROWS_NOTHING(size_t res2 = fits_in_16_bytes.hash());
-    TS_ASSERT_THROWS_NOTHING(size_t res3 = large.hash());
+    TS_ASSERT_THROWS_NOTHING(zero.hash());
+    TS_ASSERT_THROWS_NOTHING(fits_in_2_bytes.hash());
+    TS_ASSERT_THROWS_NOTHING(fits_in_16_bytes.hash());
+    TS_ASSERT_THROWS_NOTHING(large.hash());
   }
 };
index 559b457cbdd90770a443e5018ee093e4e0fa05f5..8a7f04fd3b4dbbd489c5b572f98a48cd047e422a 100644 (file)
@@ -104,26 +104,26 @@ public:
     Rational y(78,6);
     Rational z(45789,1);
 
-    TS_ASSERT_EQUALS(x.getNumerator().getUnsignedLong(), 0);
-    TS_ASSERT_EQUALS(y.getNumerator().getUnsignedLong(), 13);
-    TS_ASSERT_EQUALS(z.getNumerator().getUnsignedLong(), 45789);
+    TS_ASSERT_EQUALS(x.getNumerator().getUnsignedLong(), 0ul);
+    TS_ASSERT_EQUALS(y.getNumerator().getUnsignedLong(), 13ul);
+    TS_ASSERT_EQUALS(z.getNumerator().getUnsignedLong(), 45789ul);
 
     x = y = z;
 
-    TS_ASSERT_EQUALS(x.getNumerator().getUnsignedLong(), 45789);
-    TS_ASSERT_EQUALS(y.getNumerator().getUnsignedLong(), 45789);
-    TS_ASSERT_EQUALS(z.getNumerator().getUnsignedLong(), 45789);
+    TS_ASSERT_EQUALS(x.getNumerator().getUnsignedLong(), 45789ul);
+    TS_ASSERT_EQUALS(y.getNumerator().getUnsignedLong(), 45789ul);
+    TS_ASSERT_EQUALS(z.getNumerator().getUnsignedLong(), 45789ul);
 
     Rational a(78,91);
 
     y = a;
 
-    TS_ASSERT_EQUALS(a.getNumerator().getUnsignedLong(), 6);
-    TS_ASSERT_EQUALS(a.getDenominator().getUnsignedLong(), 7);
-    TS_ASSERT_EQUALS(y.getNumerator().getUnsignedLong(), 6);
-    TS_ASSERT_EQUALS(y.getDenominator().getUnsignedLong(), 7);
-    TS_ASSERT_EQUALS(x.getNumerator().getUnsignedLong(), 45789);
-    TS_ASSERT_EQUALS(z.getNumerator().getUnsignedLong(), 45789);
+    TS_ASSERT_EQUALS(a.getNumerator().getUnsignedLong(), 6ul);
+    TS_ASSERT_EQUALS(a.getDenominator().getUnsignedLong(), 7ul);
+    TS_ASSERT_EQUALS(y.getNumerator().getUnsignedLong(), 6ul);
+    TS_ASSERT_EQUALS(y.getDenominator().getUnsignedLong(), 7ul);
+    TS_ASSERT_EQUALS(x.getNumerator().getUnsignedLong(), 45789ul);
+    TS_ASSERT_EQUALS(z.getNumerator().getUnsignedLong(), 45789ul);
   }
 
   void testToStringStuff(){
@@ -416,8 +416,8 @@ public:
     Rational one_word(75890L,590L);
     Rational two_words("7890D789D33234027890D789D3323402", 16);
 
-    TS_ASSERT_EQUALS(zero.hash(), 1);
-    TS_ASSERT_EQUALS(one_word.hash(), 7589 xor 59);
+    TS_ASSERT_EQUALS(zero.hash(), 1u);
+    TS_ASSERT_EQUALS(one_word.hash(), 7589u xor 59u);
     TS_ASSERT_EQUALS(two_words.hash(),
                     (two_words.getNumerator().hash()) xor 1);
     TS_ASSERT_EQUALS(large.hash(),