Commit 8c69f8495de1791decff3ae37f1da2383415c144
1 parent
646f3bc0
Add getRefcount to PointerHolder test
Showing
2 changed files
with
8 additions
and
0 deletions
libtests/pointer_holder.cc
| ... | ... | @@ -63,10 +63,14 @@ int main(int argc, char* argv[]) |
| 63 | 63 | std::cout << "hello" << std::endl; |
| 64 | 64 | Object* o1 = new Object; |
| 65 | 65 | ObjectHolder oh1(o1); |
| 66 | + std::cout << "oh1 refcount = " << oh1.getRefcount() << std::endl; | |
| 66 | 67 | ObjectHolder oh2(oh1); |
| 68 | + std::cout << "oh1 refcount = " << oh1.getRefcount() << std::endl; | |
| 69 | + std::cout << "oh2 refcount = " << oh2.getRefcount() << std::endl; | |
| 67 | 70 | ObjectHolder oh3(new Object); |
| 68 | 71 | ObjectHolder oh4; |
| 69 | 72 | ObjectHolder oh5; |
| 73 | + std::cout << "oh5 refcount = " << oh5.getRefcount() << std::endl; | |
| 70 | 74 | if (oh4 == oh5) |
| 71 | 75 | { |
| 72 | 76 | std::cout << "nulls equal" << std::endl; | ... | ... |