Add raw pointer handling test for virtual inheritance

This is a test added for D in previous commit, now expanded to all target languages.

Tidy up counting object instances.
This commit is contained in:
William S Fulton 2022-08-05 20:36:29 +01:00
commit d4b1152d4b
20 changed files with 236 additions and 224 deletions

View file

@ -93,17 +93,14 @@ void main() {
throw new Exception("wrong object label");
Klass k2 = makeKlassUniquePtr("second");
if (Klass.getTotal_count() != 2)
throw new Exception("number of objects should be 2");
checkCount(2);
k1.dispose();
if (Klass.getTotal_count() != 1)
throw new Exception("number of objects should be 1");
checkCount(1);
if (k2.getLabel() != "second")
throw new Exception("wrong object label");
k2.dispose();
if (Klass.getTotal_count() != 0)
throw new Exception("no objects should be left");
checkCount(0);
}