mariadb/storage/tokudb/tests/uint_test.cc
Rich Prohaska 9867e95233 refs #6184 turn up the warnings on the handlerton unit tests
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@54539 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-17 00:02:18 -04:00

29 lines
692 B
C++

#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdlib.h>
#include <assert.h>
#include <tokudb_math.h>
using namespace tokudb;
static void test(int length_bits) {
printf("%s %d\n", __FUNCTION__, length_bits);
uint64_t max = (1ULL << length_bits) - 1;
for (uint64_t x = 0; x <= max; x++) {
for (uint64_t y = 0; y <= max; y++) {
bool over;
uint64_t n = uint_add(x, y, max, &over);
printf("%"PRIu64" %"PRIu64" %"PRIu64"\n", x, y, n);
}
}
}
int main(int argc, char *argv[]) {
if (argc > 1) {
for (int i = 1; i < argc; i++) {
test(atoi(argv[i]));
}
}
return 0;
}