Skip to content

Commit f10fcd2

Browse files
authored
Merge branch 'main' into cppinterop-out
2 parents 5760b41 + 9c7118b commit f10fcd2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

unittests/CppInterOp/FunctionReflectionTest.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,17 +2715,18 @@ TEST(FunctionReflectionTest, DestructArray) {
27152715
output.clear();
27162716

27172717
// deallocate since we call the destructor withFree = false
2718-
Cpp::Deallocate(scope, where, 5);
2718+
Cpp::Deallocate(scope, where, a);
27192719

27202720
// perform the same withFree=true
2721-
where = Cpp::Allocate(scope, a);
2722-
EXPECT_TRUE(where == Cpp::Construct(scope, where, a));
2721+
where = nullptr;
2722+
where = Cpp::Construct(scope, nullptr, a);
2723+
EXPECT_TRUE(where);
27232724
testing::internal::CaptureStdout();
2724-
// FIXME : This should work with the array of objects as well
2725-
// Cpp::Destruct(where, scope, true, 5);
2726-
EXPECT_TRUE(Cpp::Destruct(where, scope, true));
2725+
EXPECT_TRUE(Cpp::Destruct(where, scope, true, a));
27272726
output = testing::internal::GetCapturedStdout();
2728-
EXPECT_EQ(output, "\nDestructor Executed\n");
2727+
EXPECT_EQ(output,
2728+
"\nDestructor Executed\n\nDestructor Executed\n\nDestructor "
2729+
"Executed\n\nDestructor Executed\n\nDestructor Executed\n");
27292730
output.clear();
27302731
}
27312732

0 commit comments

Comments
 (0)