@@ -2681,17 +2681,18 @@ TEST(FunctionReflectionTest, DestructArray) {
26812681 output.clear ();
26822682
26832683 // deallocate since we call the destructor withFree = false
2684- Cpp::Deallocate (scope, where, 5 );
2684+ Cpp::Deallocate (scope, where, a );
26852685
26862686 // perform the same withFree=true
2687- where = Cpp::Allocate (scope, a);
2688- EXPECT_TRUE (where == Cpp::Construct (scope, where, a));
2687+ where = nullptr ;
2688+ where = Cpp::Construct (scope, nullptr , a);
2689+ EXPECT_TRUE (where);
26892690 testing::internal::CaptureStdout ();
2690- // FIXME : This should work with the array of objects as well
2691- // Cpp::Destruct(where, scope, true, 5);
2692- EXPECT_TRUE (Cpp::Destruct (where, scope, true ));
2691+ EXPECT_TRUE (Cpp::Destruct (where, scope, true , a));
26932692 output = testing::internal::GetCapturedStdout ();
2694- EXPECT_EQ (output, " \n Destructor Executed\n " );
2693+ EXPECT_EQ (output,
2694+ " \n Destructor Executed\n\n Destructor Executed\n\n Destructor "
2695+ " Executed\n\n Destructor Executed\n\n Destructor Executed\n " );
26952696 output.clear ();
26962697}
26972698
0 commit comments