mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
compile fifo-test with icc, remove nested functions. addresses #1185
git-svn-id: file:///svn/tokudb.1131b+1080a+1185@6343 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
d8613b06c8
commit
78d8f02303
1 changed files with 13 additions and 16 deletions
|
@ -29,17 +29,18 @@ void test_fifo_enq(int n) {
|
||||||
|
|
||||||
char *thekey = 0; int thekeylen;
|
char *thekey = 0; int thekeylen;
|
||||||
char *theval = 0; int thevallen;
|
char *theval = 0; int thevallen;
|
||||||
|
|
||||||
void buildkey(int len) {
|
// this was a function but icc cant handle it
|
||||||
thekeylen = len;
|
#define buildkey(len) { \
|
||||||
thekey = realloc(thekey, thekeylen);
|
thekeylen = len; \
|
||||||
memset(thekey, len, thekeylen);
|
thekey = realloc(thekey, thekeylen); \
|
||||||
|
memset(thekey, len, thekeylen); \
|
||||||
}
|
}
|
||||||
|
|
||||||
void buildval(int len) {
|
#define buildval(len) { \
|
||||||
thevallen = len+1;
|
thevallen = len+1; \
|
||||||
theval = realloc(theval, thevallen);
|
theval = realloc(theval, thevallen); \
|
||||||
memset(theval, ~len, thevallen);
|
memset(theval, ~len, thevallen); \
|
||||||
}
|
}
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
@ -49,21 +50,17 @@ void test_fifo_enq(int n) {
|
||||||
r = toku_fifo_enq(f, thekey, thekeylen, theval, thevallen, i, (TXNID)i); assert(r == 0);
|
r = toku_fifo_enq(f, thekey, thekeylen, theval, thevallen, i, (TXNID)i); assert(r == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkit(bytevec key, ITEMLEN keylen, bytevec val, ITEMLEN vallen, int type, TXNID xid, void *arg) {
|
i = 0;
|
||||||
|
FIFO_ITERATE(f, key, keylen, val, vallen, type, xid, ({
|
||||||
if (verbose) printf("checkit %d %d\n", i, type);
|
if (verbose) printf("checkit %d %d\n", i, type);
|
||||||
assert(arg == 0);
|
|
||||||
buildkey(i);
|
buildkey(i);
|
||||||
buildval(i);
|
buildval(i);
|
||||||
assert((int) keylen == thekeylen); assert(memcmp(key, thekey, keylen) == 0);
|
assert((int) keylen == thekeylen); assert(memcmp(key, thekey, keylen) == 0);
|
||||||
assert((int) vallen == thevallen); assert(memcmp(val, theval, vallen) == 0);
|
assert((int) vallen == thevallen); assert(memcmp(val, theval, vallen) == 0);
|
||||||
assert(i % 256 == type);
|
assert(i % 256 == type);
|
||||||
assert((TXNID)i==xid);
|
assert((TXNID)i==xid);
|
||||||
|
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}));
|
||||||
|
|
||||||
i = 0;
|
|
||||||
toku_fifo_iterate(f, checkit, 0);
|
|
||||||
assert(i == n);
|
assert(i == n);
|
||||||
|
|
||||||
if (thekey) free(thekey);
|
if (thekey) free(thekey);
|
||||||
|
|
Loading…
Add table
Reference in a new issue