Add testing of new[]/delete[] (test_cpp)
authorIvan Maidanski <ivmai@mail.ru>
Tue, 15 Nov 2016 22:13:30 +0000 (01:13 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 15 Nov 2016 22:13:30 +0000 (01:13 +0300)
* tests/test_cpp.cc (main): Add test case for new[] and delete[].

tests/test_cpp.cc

index 16b2d73..a8df17f 100644 (file)
@@ -284,7 +284,10 @@ void* Undisguise( GC_word i ) {
             d = ::new (USE_GC, D::CleanUp, (void*)(GC_word)i) D( i );
             (void)d;
             f = new F;
-            (void)f;
+            F** fa = new F*[1];
+            fa[0] = f;
+            (void)fa;
+            delete[] fa;
             if (0 == i % 10) delete c;}
 
             /* Allocate a very large number of collectible As and Bs and