63 for (uint i=0; i<siz; ++i)
64 checksum_ += (crap_[i] = rand() % 128);
69 for (uint i=0; i<siz; ++i)
70 checksum_ -= crap_[i];
93 CHECK (0 == checksum_);
99 CHECK (
sizeof(DummyObj<1>) !=
sizeof(DummyObj<22>));
102 PD1 pD11 = allocator.create<DummyObj<1> >();
103 PD1 pD12 = allocator.create<DummyObj<1> >();
104 PD22 pD21 = allocator.create<DummyObj<22>>();
105 PD22 pD22 = allocator.create<DummyObj<22>>();
110 CHECK (1 == pD11.use_count());
111 CHECK (1 == pD12.use_count());
112 CHECK (1 == pD21.use_count());
113 CHECK (1 == pD22.use_count());
114 CHECK (!isSameObject (*pD11, *pD12));
115 CHECK (!isSameObject (*pD11, *pD21));
116 CHECK (!isSameObject (*pD11, *pD22));
117 CHECK (!isSameObject (*pD12, *pD21));
118 CHECK (!isSameObject (*pD12, *pD22));
119 CHECK (!isSameObject (*pD21, *pD22));
123 CHECK (2 == pD21.use_count());
124 CHECK (2 == pD2x.use_count());
125 CHECK (isSameObject (*pD21, *pD2x));
127 CHECK (2 == allocator.numSlots<DummyObj<1> >());
128 CHECK (2 == allocator.numSlots<DummyObj<22>>());
130 CHECK (0 == allocator.numSlots<
long>());
133 CHECK (0 == allocator.numSlots<DummyObj<1> >());
134 CHECK (0 == allocator.numSlots<DummyObj<22>>());
135 CHECK (0 == checksum_);
Abstract foundation for building custom allocation managers.
Implementation namespace for support and library code.
Yet-another ctor/dtor-tracking test dummy object....
Simple test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Foundation for a custom allocation manager, tracking the created objects by smart-ptrs.
bool isSameObject(A const &a, B const &b)
compare plain object identity, bypassing any custom comparison operators.