auto_ptr and unique_ptr test tweaks

This commit is contained in:
William S Fulton 2022-08-03 20:32:58 +01:00
commit a741c7dbcf
14 changed files with 30 additions and 16 deletions

View file

@ -53,8 +53,8 @@ public class cpp11_std_unique_ptr_runme {
using (Klass kin = new Klass("KlassInput")) {
bool exception_thrown = false;
Klass notowned = cpp11_std_unique_ptr.get_not_owned_ptr(kin);
try {
Klass notowned = cpp11_std_unique_ptr.get_not_owned_ptr(kin);
cpp11_std_unique_ptr.takeKlassUniquePtr(notowned);
} catch (ApplicationException e) {
if (!e.Message.Contains("Cannot release ownership as memory is not owned"))
@ -63,6 +63,7 @@ public class cpp11_std_unique_ptr_runme {
}
if (!exception_thrown)
throw new ApplicationException("Should have thrown 'Cannot release ownership as memory is not owned' error");
checkCount(1);
}
checkCount(0);