@@ -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, " \n Destructor Executed\n " );
2727+ EXPECT_EQ (output,
2728+ " \n Destructor Executed\n\n Destructor Executed\n\n Destructor "
2729+ " Executed\n\n Destructor Executed\n\n Destructor Executed\n " );
27292730 output.clear ();
27302731}
27312732
0 commit comments