mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
addresses #223
git-svn-id: file:///svn/tokudb@1421 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
ebc4d21a8f
commit
3296a92f9c
1 changed files with 8 additions and 2 deletions
|
@ -6,12 +6,18 @@
|
|||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/stat.h>
|
||||
#include <db.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) {
|
||||
return ((u_int64_t)gbytes << 30) + bytes;
|
||||
}
|
||||
|
@ -42,9 +48,9 @@ void test_cachesize() {
|
|||
r = env->get_cachesize(env, &gbytes, &bytes, &ncache); assert(r == 0);
|
||||
assert(ncache == 1);
|
||||
if (s <= minsize)
|
||||
assert(minsize == size_from(gbytes, bytes));
|
||||
expect_eq(minsize, size_from(gbytes, bytes));
|
||||
else
|
||||
assert(s == size_from(gbytes, bytes));
|
||||
expect_eq(s, size_from(gbytes, bytes));
|
||||
s *= 2; size_to(s, &gbytes, &bytes);
|
||||
}
|
||||
r = env->close(env, 0); assert(r == 0);
|
||||
|
|
Loading…
Add table
Reference in a new issue