diff options
author | Max Horn | 2008-03-29 00:08:56 +0000 |
---|---|---|
committer | Max Horn | 2008-03-29 00:08:56 +0000 |
commit | f93c076a7b9d59afa4c80ab4241af7fbf252a0ab (patch) | |
tree | ddcbf12c1e2b33c4e402ac70172e970d83af4d2e /test/common | |
parent | 1092b87cd7f4b73d896db3aca031e50a84a43565 (diff) | |
download | scummvm-rg350-f93c076a7b9d59afa4c80ab4241af7fbf252a0ab.tar.gz scummvm-rg350-f93c076a7b9d59afa4c80ab4241af7fbf252a0ab.tar.bz2 scummvm-rg350-f93c076a7b9d59afa4c80ab4241af7fbf252a0ab.zip |
Document SharedPtr bool conversion operator; added test cases for it; also added two test cases for the comparision operators, which currently fail
svn-id: r31299
Diffstat (limited to 'test/common')
-rw-r--r-- | test/common/ptr.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/common/ptr.h b/test/common/ptr.h index b6f2e950ca..7102a819cf 100644 --- a/test/common/ptr.h +++ b/test/common/ptr.h @@ -33,4 +33,20 @@ class PtrTestSuite : public CxxTest::TestSuite TS_ASSERT_EQUALS(*p1, 0); TS_ASSERT(p1.unique()); } + + void test_compare() { + Common::SharedPtr<int> p1(new int(1)); + Common::SharedPtr<int> p2; + + TS_ASSERT(p1); + TS_ASSERT(!p2); + + TS_ASSERT(p1 != 0); + TS_ASSERT(p2 == 0); + + // Note: The following two currently do *not* work, contrary to + // what the Doxygen comments of SharedPtr claim. + TS_ASSERT(p1 != (int *)0); + TS_ASSERT(p2 == (int *)0); + } }; |