Lines Matching refs:oset
85 void example1singleset(OSet* oset, char *descr) in example1singleset() argument
94 vg_assert( ! VG_(OSetGen_Contains)(oset, &v) ); in example1singleset()
95 vg_assert( ! VG_(OSetGen_Lookup)(oset, &v) ); in example1singleset()
96 vg_assert( ! VG_(OSetGen_Remove)(oset, &v) ); in example1singleset()
97 vg_assert( ! VG_(OSetGen_Next)(oset) ); in example1singleset()
98 vg_assert( 0 == VG_(OSetGen_Size)(oset) ); in example1singleset()
103 vs[i] = VG_(OSetGen_AllocNode)(oset, sizeof(Word)); in example1singleset()
118 VG_(OSetGen_Insert)(oset, vs[i]); in example1singleset()
122 vg_assert( NN == VG_(OSetGen_Size)(oset) ); in example1singleset()
126 assert( VG_(OSetGen_Contains)(oset, vs[i]) ); in example1singleset()
139 VG_(OSetGen_ResetIterAt) (oset, &k); in example1singleset()
142 pval = VG_(OSetGen_Next)(oset); in example1singleset()
149 VG_(OSetGen_ResetIterAt) (oset, &k); in example1singleset()
152 pval = VG_(OSetGen_Next)(oset); in example1singleset()
160 VG_(OSetGen_ResetIterAt) (oset, &k); in example1singleset()
163 pval = VG_(OSetGen_Next)(oset); in example1singleset()
168 pval = VG_(OSetGen_Next)(oset); in example1singleset()
177 assert( ! VG_(OSetGen_Contains)(oset, &v) ); in example1singleset()
180 assert( ! VG_(OSetGen_Contains)(oset, &v) ); in example1singleset()
183 assert( ! VG_(OSetGen_Contains)(oset, &v) ); in example1singleset()
188 assert( vs[i] == VG_(OSetGen_Lookup)(oset, vs[i]) ); in example1singleset()
196 VG_(OSetGen_ResetIter)(oset); in example1singleset()
197 while ( (pv = VG_(OSetGen_Next)(oset)) ) { in example1singleset()
204 vg_assert( ! VG_(OSetGen_Next)(oset) ); in example1singleset()
205 vg_assert( ! VG_(OSetGen_Next)(oset) ); in example1singleset()
210 assert( pv = VG_(OSetGen_Remove)(oset, vs[i]) ); in example1singleset()
215 vg_assert( NN/2 == VG_(OSetGen_Size)(oset) ); in example1singleset()
219 assert( pv = VG_(OSetGen_LookupWithCmp)(oset, vs[i], NULL) ); in example1singleset()
225 assert( ! VG_(OSetGen_Contains)(oset, vs[i]) ); in example1singleset()
231 assert( pv = VG_(OSetGen_Remove)(oset, vs[i]) ); in example1singleset()
236 vg_assert( ! VG_(OSetGen_Contains)(oset, &v) ); in example1singleset()
237 vg_assert( ! VG_(OSetGen_Lookup)(oset, &v) ); in example1singleset()
238 vg_assert( ! VG_(OSetGen_Remove)(oset, &v) ); in example1singleset()
239 vg_assert( ! VG_(OSetGen_Next)(oset) ); in example1singleset()
240 vg_assert( 0 == VG_(OSetGen_Size)(oset) ); in example1singleset()
243 VG_(OSetGen_FreeNode)(oset, vs[0]); in example1singleset()
244 VG_(OSetGen_FreeNode)(oset, vs[1]); in example1singleset()
245 VG_(OSetGen_FreeNode)(oset, vs[2]); in example1singleset()
250 VG_(OSetGen_Insert)(oset, vs[i]); in example1singleset()
254 OSet_Print(oset, descr, wordToStr); in example1singleset()
260 OSet *oset, *oset_empty_clone; in example1() local
266 oset = VG_(OSetGen_Create)(0, in example1()
269 example1singleset(oset, "single oset, no pool allocator"); in example1()
272 VG_(OSetGen_Destroy)(oset); in example1()
275 oset = VG_(OSetGen_Create_With_Pool)(0, in example1()
280 example1singleset(oset, "single oset, pool allocator"); in example1()
283 VG_(OSetGen_Destroy)(oset); in example1()
287 oset = VG_(OSetGen_Create_With_Pool) in example1()
292 oset_empty_clone = VG_(OSetGen_EmptyClone) (oset); in example1()
293 example1singleset(oset, "oset, shared pool"); in example1()
298 VG_(OSetGen_Destroy)(oset); in example1()
310 OSet* oset = VG_(OSetWord_Create)(allocate_node, "oset_test.2", free_node); in example1b() local
313 vg_assert( ! VG_(OSetWord_Contains)(oset, v) ); in example1b()
314 vg_assert( ! VG_(OSetWord_Remove)(oset, v) ); in example1b()
315 vg_assert( ! VG_(OSetWord_Next)(oset, (UWord *)&v) ); in example1b()
316 vg_assert( 0 == VG_(OSetWord_Size)(oset) ); in example1b()
334 VG_(OSetWord_Insert)(oset, vs[i]); in example1b()
338 vg_assert( NN == VG_(OSetWord_Size)(oset) ); in example1b()
342 assert( VG_(OSetWord_Contains)(oset, vs[i]) ); in example1b()
348 assert( ! VG_(OSetWord_Contains)(oset, v) ); in example1b()
351 assert( ! VG_(OSetWord_Contains)(oset, v) ); in example1b()
354 assert( ! VG_(OSetWord_Contains)(oset, v) ); in example1b()
358 assert( VG_(OSetWord_Contains)(oset, vs[i]) ); in example1b()
365 VG_(OSetWord_ResetIter)(oset); in example1b()
366 while ( VG_(OSetWord_Next)(oset, (UWord *)&v) ) { in example1b()
376 vg_assert( ! VG_(OSetWord_Next)(oset, (UWord *)&v) ); in example1b()
377 vg_assert( ! VG_(OSetWord_Next)(oset, (UWord *)&v) ); in example1b()
381 assert( VG_(OSetWord_Remove)(oset, vs[i]) ); in example1b()
385 vg_assert( NN/2 == VG_(OSetWord_Size)(oset) ); in example1b()
389 assert( VG_(OSetWord_Contains)(oset, vs[i]) ); in example1b()
394 assert( ! VG_(OSetWord_Contains)(oset, vs[i]) ); in example1b()
399 assert( VG_(OSetWord_Remove)(oset, vs[i]) ); in example1b()
403 vg_assert( ! VG_(OSetWord_Contains)(oset, v) ); in example1b()
404 vg_assert( ! VG_(OSetWord_Remove)(oset, v) ); in example1b()
405 vg_assert( ! VG_(OSetWord_Next)(oset, (UWord *)&v) ); in example1b()
406 vg_assert( 0 == VG_(OSetWord_Size)(oset) ); in example1b()
411 VG_(OSetWord_Insert)(oset, vs[i]); in example1b()
415 OSet_Print(oset, "oset1b", wordToStr); in example1b()
418 VG_(OSetWord_Destroy)(oset); in example1b()
469 OSet* oset = VG_(OSetGen_Create)(offsetof(Block, first), in example2() local
474 vg_assert( ! VG_(OSetGen_Contains)(oset, &v) ); in example2()
475 vg_assert( ! VG_(OSetGen_Lookup)(oset, &v) ); in example2()
476 vg_assert( ! VG_(OSetGen_Remove)(oset, &v) ); in example2()
477 vg_assert( ! VG_(OSetGen_Next)(oset) ); in example2()
478 vg_assert( 0 == VG_(OSetGen_Size)(oset) ); in example2()
483 vs[i] = VG_(OSetGen_AllocNode)(oset, sizeof(Block)); in example2()
500 VG_(OSetGen_Insert)(oset, vs[i]); in example2()
504 vg_assert( NN == VG_(OSetGen_Size)(oset) ); in example2()
509 a = vs[i]->first + 0; assert( VG_(OSetGen_Contains)(oset, &a) ); in example2()
510 a = vs[i]->first + 1; assert( VG_(OSetGen_Contains)(oset, &a) ); in example2()
511 a = vs[i]->first + 2; assert( VG_(OSetGen_Contains)(oset, &a) ); in example2()
517 assert( ! VG_(OSetGen_Contains)(oset, &a) ); in example2()
519 a = vs[i]->first - 1; assert( ! VG_(OSetGen_Contains)(oset, &a) ); in example2()
520 a = vs[i]->first + 3; assert( ! VG_(OSetGen_Contains)(oset, &a) ); in example2()
526 a = vs[i]->first + 0; assert( vs[i] == VG_(OSetGen_Lookup)(oset, &a) ); in example2()
527 a = vs[i]->first + 1; assert( vs[i] == VG_(OSetGen_Lookup)(oset, &a) ); in example2()
528 a = vs[i]->first + 2; assert( vs[i] == VG_(OSetGen_Lookup)(oset, &a) ); in example2()
529 assert( vs[i] == VG_(OSetGen_LookupWithCmp)(oset, &a, blockCmp) ); in example2()
537 VG_(OSetGen_ResetIter)(oset); in example2()
538 while ( (pv = VG_(OSetGen_Next)(oset)) ) { in example2()
545 vg_assert( ! VG_(OSetGen_Next)(oset) ); in example2()
546 vg_assert( ! VG_(OSetGen_Next)(oset) ); in example2()
551 a = vs[i]->first; assert( vs[i] == VG_(OSetGen_Remove)(oset, &a) ); in example2()
555 vg_assert( NN/2 == VG_(OSetGen_Size)(oset) ); in example2()
559 a = vs[i]->first + 0; assert( vs[i] == VG_(OSetGen_Lookup)(oset, &a) ); in example2()
560 a = vs[i]->first + 1; assert( vs[i] == VG_(OSetGen_Lookup)(oset, &a) ); in example2()
561 a = vs[i]->first + 2; assert( vs[i] == VG_(OSetGen_Lookup)(oset, &a) ); in example2()
566 a = vs[i]->first + 0; assert( ! VG_(OSetGen_Contains)(oset, &a) ); in example2()
567 a = vs[i]->first + 1; assert( ! VG_(OSetGen_Contains)(oset, &a) ); in example2()
568 a = vs[i]->first + 2; assert( ! VG_(OSetGen_Contains)(oset, &a) ); in example2()
574 a = vs[i]->first; assert( vs[i] == VG_(OSetGen_Remove)(oset, &a) ); in example2()
578 vg_assert( ! VG_(OSetGen_Contains)(oset, &v) ); in example2()
579 vg_assert( ! VG_(OSetGen_Lookup)(oset, &v) ); in example2()
580 vg_assert( ! VG_(OSetGen_Remove)(oset, &v) ); in example2()
581 vg_assert( ! VG_(OSetGen_Next)(oset) ); in example2()
582 vg_assert( 0 == VG_(OSetGen_Size)(oset) ); in example2()
586 VG_(OSetGen_Insert)(oset, vs[i]); in example2()
590 VG_(OSetGen_Destroy)(oset); in example2()