Commit d0fd3042 authored by Rich Prohaska's avatar Rich Prohaska

addresses #223

git-svn-id: file:///svn/tokudb@1421 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6ea4819e
...@@ -6,12 +6,18 @@ ...@@ -6,12 +6,18 @@
#include <assert.h> #include <assert.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <db.h> #include <db.h>
#include "test.h" #include "test.h"
void expect_eq(u_int64_t a, u_int64_t b) {
if (a != b)
printf("WARNING: expect %" PRId64 " got %" PRId64 "\n", a, b);
}
u_int64_t size_from(u_int32_t gbytes, u_int32_t bytes) { u_int64_t size_from(u_int32_t gbytes, u_int32_t bytes) {
return ((u_int64_t)gbytes << 30) + bytes; return ((u_int64_t)gbytes << 30) + bytes;
} }
...@@ -42,9 +48,9 @@ void test_cachesize() { ...@@ -42,9 +48,9 @@ void test_cachesize() {
r = env->get_cachesize(env, &gbytes, &bytes, &ncache); assert(r == 0); r = env->get_cachesize(env, &gbytes, &bytes, &ncache); assert(r == 0);
assert(ncache == 1); assert(ncache == 1);
if (s <= minsize) if (s <= minsize)
assert(minsize == size_from(gbytes, bytes)); expect_eq(minsize, size_from(gbytes, bytes));
else else
assert(s == size_from(gbytes, bytes)); expect_eq(s, size_from(gbytes, bytes));
s *= 2; size_to(s, &gbytes, &bytes); s *= 2; size_to(s, &gbytes, &bytes);
} }
r = env->close(env, 0); assert(r == 0); r = env->close(env, 0); assert(r == 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment