32 #define NUMBER_OF_TESTS 100
35 RecordTable recordTable;
36 const Tuple<RamDomain, 3> tuple = {{1, 2, 3}};
42 for (
size_t i = 0;
i < 3; ++
i) {
51 constexpr
size_t tupleSize = 3;
52 using tupleType = Tuple<RamDomain, tupleSize>;
54 RecordTable recordTable;
57 std::default_random_engine randomGenerator(3);
58 std::uniform_int_distribution<RamDomain> distribution(
59 std::numeric_limits<RamDomain>::lowest(), std::numeric_limits<RamDomain>::max());
61 auto random = std::bind(distribution, randomGenerator);
71 toPack[
i] = {{random(), random(), random()}};
72 tupleRef[
i] =
pack(recordTable, toPack[
i]);
77 auto unpacked = recordTable.unpack(tupleRef[
i], tupleSize);
78 tupleType cmp = {unpacked[0], unpacked[1], unpacked[2]};
86 TEST(PackUnpack, Vector) {
87 constexpr
size_t vectorSize = 10;
89 RecordTable recordTable;
99 toPack[
i] = testutil::generateRandomVector<RamDomain>(10);
100 tupleRef[
i] = recordTable.pack(toPack[
i].
data(), vectorSize);
101 std::cerr <<
"Ref: " << tupleRef[
i] << std::endl;
106 const RamDomain* unpacked{recordTable.unpack(tupleRef[
i], vectorSize)};
107 for (
size_t j = 0;
j < vectorSize; ++
j) {