author | Nicola Baldo <nbaldo@cttc.es> |
Fri, 22 Mar 2013 13:14:38 +0100 | |
changeset 9266 | d26408b17360 |
parent 9079 | 1e5921e6507d |
child 9895 | 7a448f745b9d |
permissions | -rw-r--r-- |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
2 |
/* |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
3 |
* Copyright (c) 2005,2006 INRIA |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
4 |
* |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
8 |
* |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
13 |
* |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
17 |
* |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
18 |
* Author: Mathieu Lacage <[email protected]> |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
19 |
*/ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
20 |
|
6821
203367ae7433
merge src/simulator into src/core; move src/core to new module layout
Tom Henderson <tomh@tomh.org>
parents:
6775
diff
changeset
|
21 |
#include "ns3/test.h" |
203367ae7433
merge src/simulator into src/core; move src/core to new module layout
Tom Henderson <tomh@tomh.org>
parents:
6775
diff
changeset
|
22 |
#include "ns3/ptr.h" |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
23 |
|
9079
1e5921e6507d
Clean up core, network, internet, point-to-point tests that don't access private class attributes and methods in accordance to sample-test-suite.cc.
Vedran Miletić <rivanvx@gmail.com>
parents:
7169
diff
changeset
|
24 |
using namespace ns3; |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
25 |
|
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
26 |
class PtrTestCase; |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
27 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
28 |
class Base |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
29 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
30 |
public: |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
31 |
Base (); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
32 |
virtual ~Base (); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
33 |
void Ref (void) const; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
34 |
void Unref (void) const; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
35 |
private: |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
36 |
mutable uint32_t m_count; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
37 |
}; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
38 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
39 |
class NoCount : public Base |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
40 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
41 |
public: |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
42 |
NoCount (PtrTestCase *test); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
43 |
~NoCount (); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
44 |
void Nothing (void) const; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
45 |
private: |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
46 |
PtrTestCase *m_test; |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
47 |
}; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
48 |
|
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
49 |
|
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
50 |
class PtrTestCase : public TestCase |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
51 |
{ |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
52 |
public: |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
53 |
PtrTestCase (); |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
54 |
void DestroyNotify (void); |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
55 |
private: |
6775
0783f42a364b
Make test cases not return bool valuesMake all TestSuite instances be static
Mitch Watrous <watrous@u.washington.edu>
parents:
5344
diff
changeset
|
56 |
virtual void DoRun (void); |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
57 |
Ptr<NoCount> CallTest (Ptr<NoCount> p); |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
58 |
Ptr<NoCount> const CallTestConst (Ptr<NoCount> const p); |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
59 |
uint32_t m_nDestroyed; |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
60 |
}; |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
61 |
|
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
62 |
|
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
63 |
Base::Base () |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
64 |
: m_count (1) |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
65 |
{ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
66 |
} |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
67 |
Base::~Base () |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
68 |
{ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
69 |
} |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
70 |
void |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
71 |
Base::Ref (void) const |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
72 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
73 |
m_count++; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
74 |
} |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
75 |
void |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
76 |
Base::Unref (void) const |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
77 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
78 |
m_count--; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
79 |
if (m_count == 0) |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
80 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
81 |
delete this; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
82 |
} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
83 |
} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
84 |
|
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
85 |
NoCount::NoCount (PtrTestCase *test) |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
86 |
: m_test (test) |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
87 |
{ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
88 |
} |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
89 |
NoCount::~NoCount () |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
90 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
91 |
m_test->DestroyNotify (); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
92 |
} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
93 |
void |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
94 |
NoCount::Nothing () const |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
95 |
{} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
96 |
|
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
97 |
|
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
98 |
|
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
99 |
PtrTestCase::PtrTestCase (void) |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
100 |
: TestCase ("Sanity checking of Ptr<>") |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
101 |
{ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
102 |
} |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
103 |
void |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
104 |
PtrTestCase::DestroyNotify (void) |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
105 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
106 |
m_nDestroyed++; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
107 |
} |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
108 |
Ptr<NoCount> |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
109 |
PtrTestCase::CallTest (Ptr<NoCount> p) |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
110 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
111 |
return p; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
112 |
} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
113 |
|
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
114 |
Ptr<NoCount> const |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
115 |
PtrTestCase::CallTestConst (Ptr<NoCount> const p) |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
116 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
117 |
return p; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
118 |
} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
119 |
|
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
120 |
|
6775
0783f42a364b
Make test cases not return bool valuesMake all TestSuite instances be static
Mitch Watrous <watrous@u.washington.edu>
parents:
5344
diff
changeset
|
121 |
void |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
122 |
PtrTestCase::DoRun (void) |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
123 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
124 |
m_nDestroyed = false; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
125 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
126 |
Ptr<NoCount> p = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
127 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
128 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
129 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
130 |
m_nDestroyed = 0; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
131 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
132 |
Ptr<NoCount> p; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
133 |
p = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
134 |
p = p; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
135 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
136 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
137 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
138 |
m_nDestroyed = 0; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
139 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
140 |
Ptr<NoCount> p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
141 |
p1 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
142 |
Ptr<NoCount> p2 = p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
143 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
144 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
145 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
146 |
m_nDestroyed = 0; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
147 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
148 |
Ptr<NoCount> p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
149 |
p1 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
150 |
Ptr<NoCount> p2; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
151 |
p2 = p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
152 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
153 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
154 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
155 |
m_nDestroyed = 0; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
156 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
157 |
Ptr<NoCount> p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
158 |
p1 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
159 |
Ptr<NoCount> p2 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
160 |
p2 = p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
161 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
162 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 2, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
163 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
164 |
m_nDestroyed = 0; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
165 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
166 |
Ptr<NoCount> p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
167 |
p1 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
168 |
Ptr<NoCount> p2; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
169 |
p2 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
170 |
p2 = p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
171 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
172 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 2, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
173 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
174 |
m_nDestroyed = 0; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
175 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
176 |
Ptr<NoCount> p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
177 |
p1 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
178 |
p1 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
179 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
180 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 2, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
181 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
182 |
m_nDestroyed = 0; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
183 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
184 |
Ptr<NoCount> p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
185 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
186 |
Ptr<NoCount> p2; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
187 |
p1 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
188 |
p2 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
189 |
p2 = p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
190 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
191 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
192 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
193 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 2, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
194 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
195 |
m_nDestroyed = 0; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
196 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
197 |
Ptr<NoCount> p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
198 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
199 |
Ptr<NoCount> p2; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
200 |
p1 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
201 |
p2 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
202 |
p2 = CallTest (p1); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
203 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
204 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
205 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
206 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 2, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
207 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
208 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
209 |
Ptr<NoCount> p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
210 |
Ptr<NoCount> const p2 = CallTest (p1); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
211 |
Ptr<NoCount> const p3 = CallTestConst (p1); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
212 |
Ptr<NoCount> p4 = CallTestConst (p1); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
213 |
Ptr<NoCount const> p5 = p4; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
214 |
//p4 = p5; You cannot make a const pointer be a non-const pointer. |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
215 |
// but if you use ConstCast, you can. |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
216 |
p4 = ConstCast<NoCount> (p5); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
217 |
p5 = p1; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
218 |
Ptr<NoCount> p; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
219 |
if (p == 0) |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
220 |
{} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
221 |
if (p != 0) |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
222 |
{} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
223 |
if (0 == p) |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
224 |
{} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
225 |
if (0 != p) |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
226 |
{} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
227 |
if (p) |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
228 |
{} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
229 |
if (!p) |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
230 |
{} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
231 |
} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
232 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
233 |
m_nDestroyed = 0; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
234 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
235 |
NoCount *raw; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
236 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
237 |
Ptr<NoCount> p = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
238 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
239 |
Ptr<NoCount const> p1 = p; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
240 |
} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
241 |
raw = GetPointer (p); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
242 |
p = 0; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
243 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
244 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 0, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
245 |
delete raw; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
246 |
} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
247 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
248 |
m_nDestroyed = 0; |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
249 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
250 |
Ptr<NoCount> p = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
251 |
const NoCount *v1 = PeekPointer (p); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
252 |
NoCount *v2 = PeekPointer (p); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
253 |
v1->Nothing (); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
254 |
v2->Nothing (); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
255 |
} |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
256 |
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1, "XXX"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
257 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
258 |
{ |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
259 |
Ptr<Base> p0 = Create<NoCount> (this); |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
260 |
Ptr<NoCount> p1 = Create<NoCount> (this); |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
261 |
NS_TEST_EXPECT_MSG_EQ ((p0 == p1), false, "operator == failed"); |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
262 |
NS_TEST_EXPECT_MSG_EQ ((p0 != p1), true, "operator != failed"); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
263 |
} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
264 |
} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
265 |
|
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
266 |
static class PtrTestSuite : public TestSuite |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
267 |
{ |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
268 |
public: |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
269 |
PtrTestSuite () |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
270 |
: TestSuite ("ptr", UNIT) |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
271 |
{ |
9266
d26408b17360
bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents:
9079
diff
changeset
|
272 |
AddTestCase (new PtrTestCase (), TestCase::QUICK); |
5344
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
273 |
} |
dfc1815a6d3e
actually port the ptr test code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
274 |
} g_ptrTestSuite; |