mariadb/storage/tokudb/tests/sint_test.cc
Rich Prohaska d44fbafb48 refs #5254 merge fast upserts to mainline. enabled on mysql 5.6 only for now.
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@50363 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-17 00:02:16 -04:00

27 lines
630 B
C++

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