28 hashed_unique< tag<by_key>, member<test_size, uint64_t, &test_size::key>, std::hash<uint64_t>>
56 hashed_unique< tag<by_key>, member<test_size2, uint64_t, &test_size2::key>, std::hash<uint64_t>>,
68 BOOST_CHECK_EQUAL( storage.
index().size(), 1);
71 BOOST_CHECK_EQUAL( storage.
index().size(), 2);
74 BOOST_CHECK_EQUAL( storage.
index().size(), 3);
75 auto to_mod = storage.
find(1);
78 BOOST_CHECK_EQUAL( storage.
index().size(), 3);
83 BOOST_CHECK_EQUAL( storage.
index().size(), 3);
86 BOOST_CHECK_NO_THROW(storage.
erase(2));
94 tracked_storage1 storage1_1;
95 BOOST_CHECK_EQUAL( storage1_1.memory_size(), 0);
96 BOOST_CHECK_EQUAL( storage1_1.index().size(), 0);
101 storage1_1.write(out);
107 BOOST_CHECK_EQUAL( version, 5 );
108 auto ds = content.create_datastream();
109 tracked_storage1 storage1_2;
110 BOOST_CHECK(storage1_2.read(ds, 500));
111 BOOST_CHECK_EQUAL( storage1_2.index().size(), 0);
112 BOOST_CHECK_EQUAL( storage1_2.memory_size(), 0);
114 const auto tellp = content.tellp();
116 BOOST_CHECK_EQUAL( content.tellp(), tellp );
121 tracked_storage1 storage1_1;
123 BOOST_CHECK_EQUAL( storage1_1.memory_size(), 6);
124 BOOST_CHECK_EQUAL( storage1_1.index().size(), 1);
128 storage1_1.write(out);
134 BOOST_CHECK_EQUAL( version, 5 );
135 auto ds = content.create_datastream();
136 tracked_storage1 storage1_2;
137 BOOST_CHECK(storage1_2.read(ds, 500));
138 BOOST_CHECK_EQUAL( storage1_2.index().size(), 1);
139 const auto& primary_idx2 = storage1_2.index().get<by_key>();
140 auto itr2 = primary_idx2.cbegin();
141 BOOST_CHECK_EQUAL( itr2->key, 0);
142 BOOST_CHECK_EQUAL( itr2->s, 6);
143 BOOST_CHECK_EQUAL( storage1_2.memory_size(), 6);
145 const auto tellp = content.tellp();
147 BOOST_CHECK_EQUAL( content.tellp(), tellp );
152 tracked_storage1 storage1_1;
161 BOOST_CHECK_EQUAL( storage1_1.memory_size(), 40);
162 BOOST_CHECK_EQUAL( storage1_1.index().size(), 8);
167 storage1_1.write(out);
170 tracked_storage2 storage2_1;
173 BOOST_CHECK_EQUAL( storage2_1.memory_size(), 7);
174 BOOST_CHECK_EQUAL( storage2_1.index().size(), 1);
176 storage2_1.write(out);
183 BOOST_CHECK_EQUAL( version, 5 );
184 auto ds = content.create_datastream();
185 tracked_storage1 storage1_2;
186 BOOST_CHECK(storage1_2.read(ds, 500));
187 BOOST_CHECK_EQUAL( storage1_2.index().size(), 8);
188 const auto& primary_idx1_2 = storage1_2.index().get<by_key>();
189 auto itr2 = primary_idx1_2.cbegin();
190 BOOST_CHECK_EQUAL( itr2->key, 0);
191 BOOST_CHECK_EQUAL( itr2->s, 6);
192 BOOST_CHECK_EQUAL( (++itr2)->key, 3);
193 BOOST_CHECK_EQUAL( itr2->s, 7);
194 BOOST_CHECK_EQUAL( (++itr2)->key, 5);
195 BOOST_CHECK_EQUAL( itr2->s, 3);
196 BOOST_CHECK_EQUAL( (++itr2)->key, 9);
197 BOOST_CHECK_EQUAL( itr2->s, 4);
198 BOOST_CHECK_EQUAL( (++itr2)->key, 15);
199 BOOST_CHECK_EQUAL( itr2->s, 6);
200 BOOST_CHECK_EQUAL( (++itr2)->key, 16);
201 BOOST_CHECK_EQUAL( itr2->s, 4);
202 BOOST_CHECK_EQUAL( (++itr2)->key, 19);
203 BOOST_CHECK_EQUAL( itr2->s, 3);
204 BOOST_CHECK_EQUAL( (++itr2)->key, 25);
205 BOOST_CHECK_EQUAL( itr2->s, 7);
206 BOOST_CHECK_EQUAL( storage1_2.memory_size(), 40);
208 tracked_storage2 storage2_2;
209 BOOST_CHECK(storage2_2.read(ds, 500));
210 BOOST_CHECK_EQUAL( storage2_2.index().size(), 1);
211 const auto& primary_idx2_2 = storage2_2.index().get<by_key>();
212 auto itr3 = primary_idx2_2.cbegin();
213 BOOST_CHECK_EQUAL( itr3->key, 3);
214 BOOST_CHECK( itr3->time == now);
215 BOOST_CHECK_EQUAL( itr3->s, 7);
217 const auto tellp = content.tellp();
219 BOOST_CHECK_EQUAL( content.tellp(), tellp );
FC_REFLECT(test_size2,(key)(time)(s)) namespace fc typedef multi_index_container< test_size2, indexed_by< hashed_unique< tag< by_key >, member< test_size2, uint64_t, &test_size2::key >, std::hash< uint64_t > >, ordered_non_unique< tag< by_time >, member< test_size2, fc::time_point, &test_size2::time > > > > test_size2_container