19 #include <ndb_global.h>
21 #include "SimpleProperties.hpp"
27 int reader(Uint32 *, Uint32 len);
28 int unpack(Uint32 *, Uint32 len);
46 w.add(5,
"0123456789");
49 w.add(5,
"9876543210");
51 ndbout_c(
"WordsUsed = %d", w.getWordsUsed());
53 return w.getWordsUsed();
57 reader(Uint32 * pages, Uint32 len){
68 Test() : val1(0xFFFFFFFF), val7(0xFFFFFFFF) { sprintf(val3,
"bad");}
74 { 1, offsetof(
Test, val1), SimpleProperties::Uint32Value, 0, ~0 },
75 { 7, offsetof(
Test, val7), SimpleProperties::Uint32Value, 0, ~0 },
76 { 3, offsetof(
Test, val3), SimpleProperties::StringValue, 0,
sizeof(100) },
77 { 5, 0, SimpleProperties::InvalidValue, 0, 0 }
81 test_map_sz =
sizeof(test_map)/
sizeof(test_map[0]);
84 unpack(Uint32 * pages, Uint32 len){
88 while((status = SimpleProperties::unpack(it, &test, test_map, test_map_sz,
89 true,
false)) == SimpleProperties::Break){
90 ndbout <<
"test.val1 = " << test.val1 << endl;
91 ndbout <<
"test.val7 = " << test.val7 << endl;
92 ndbout <<
"test.val3 = " << test.val3 << endl;
95 assert(status == SimpleProperties::Eof);