| 151 | |
| 152 | |
| 153 | class F: public E {public: |
| 154 | /* A collectable class with clean-up, a base with clean-up, and a |
| 155 | member with clean-up. */ |
| 156 | |
| 157 | F() { |
| 158 | nAllocated++;} |
| 159 | ~F() { |
| 160 | nFreed++;} |
| 161 | static void Test() { |
| 162 | my_assert( nFreed >= .8 * nAllocated ); |
| 163 | my_assert( 2 * nFreed == E::nFreed );} |
| 164 | |
| 165 | E e; |
| 166 | static int nFreed; |
| 167 | static int nAllocated;}; |
| 168 | |
| 169 | int F::nFreed = 0; |
| 170 | int F::nAllocated = 0; |
nothing calls this directly
no outgoing calls
no test coverage detected