Java unique_ptr test ownership enhancement to test

Make sure the object is owned before releasing ownership
and passing ownership to unique_ptr instance.
This commit is contained in:
William S Fulton 2022-07-17 12:46:16 +01:00
commit 8bd9eb3f16
2 changed files with 19 additions and 0 deletions

View file

@ -63,6 +63,10 @@ bool is_nullptr(Klass *p) {
return p == nullptr;
}
Klass *get_not_owned_ptr(Klass *p) {
return p;
}
std::unique_ptr<Klass> makeKlassUniquePtr(const char* label) {
return std::unique_ptr<Klass>(new Klass(label));
}