--------------------- PatchSet 404 Date: 2002/12/15 08:45:15 Author: rbcollins Branch: unify-io Tag: (none) Log: update tests Members: test-suite/refcount.cc:1.2->1.2.12.1 Index: squid3/test-suite/refcount.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/test-suite/refcount.cc,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -u -r1.2 -r1.2.12.1 --- squid3/test-suite/refcount.cc 22 Nov 2002 03:12:51 -0000 1.2 +++ squid3/test-suite/refcount.cc 15 Dec 2002 08:45:15 -0000 1.2.12.1 @@ -1,6 +1,6 @@ /* - * $Id: refcount.cc,v 1.2 2002/11/22 03:12:51 squidadm Exp $ + * $Id: refcount.cc,v 1.2.12.1 2002/12/15 08:45:15 rbcollins Exp $ * * DEBUG: section xx Refcount allocator * AUTHOR: Robert Collins @@ -52,6 +52,12 @@ /* Must be zero at the end for the test to pass. */ int _ToRefCount::Instances = 0; +class AlsoRefCountable : public RefCountable, public _ToRefCount { + public: + typedef RefCount Pointer; + int doSomething() { if (!this) exit (1); return 1;} +}; + int main (int argc, char **argv) { @@ -113,5 +119,16 @@ _ToRefCount *aPointer = anObject.getRaw(); aPointer = NULL; } + /* Create a doubley inheriting refcount instance, + * cast to a single inheritance instance, + * then hope :} + */ + { + ToRefCount aBaseObject; + { + AlsoRefCountable::Pointer anObject (new AlsoRefCountable); + aBaseObject = anObject.getRaw(); + } + } return _ToRefCount::Instances == 0 ? 0 : 1; }