summaryrefslogtreecommitdiff
path: root/test/unit/context
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-04-08 20:49:11 +0000
committerMorgan Deters <mdeters@gmail.com>2010-04-08 20:49:11 +0000
commitc3a6ff8c6e4a0c743cd33eb29931f837eeb2959e (patch)
treedf8d8a97baebea55aaf94cc816974a86475c3a4b /test/unit/context
parentde2b6c4ee9c2ecad88bddd0a60f10e94d6f8c71f (diff)
A handful of build system fixes:
* (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.
Diffstat (limited to 'test/unit/context')
-rw-r--r--test/unit/context/cdlist_black.h10
-rw-r--r--test/unit/context/context_mm_black.h38
2 files changed, 25 insertions, 23 deletions
diff --git a/test/unit/context/cdlist_black.h b/test/unit/context/cdlist_black.h
index b083f4794..f31d5f273 100644
--- a/test/unit/context/cdlist_black.h
+++ b/test/unit/context/cdlist_black.h
@@ -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);
}
}
diff --git a/test/unit/context/context_mm_black.h b/test/unit/context/context_mm_black.h
index bda1cb141..e25d1f336 100644
--- a/test/unit/context/context_mm_black.h
+++ b/test/unit/context/context_mm_black.h
@@ -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();
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback