From abedab5ac26c01fa7ebfceb7898ae0ac79ef06bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20G=C3=A1l?= Date: Fri, 15 Jan 2021 20:50:26 +0100 Subject: [PATCH] Fix objects foreach unittest in case of mem-stress-test (#4460) When the mem-stress-test is enabled for the objects foreach unittest the object counting is off by one. This was due to incorrect assumption on when the gc is triggered. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com --- tests/unit-core/test-objects-foreach.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/unit-core/test-objects-foreach.c b/tests/unit-core/test-objects-foreach.c index 17315fa7e..2e0000692 100644 --- a/tests/unit-core/test-objects-foreach.c +++ b/tests/unit-core/test-objects-foreach.c @@ -93,10 +93,7 @@ static void test_internal_prop (void) { /* Make sure that the object is initialized in the engine. */ - { - jerry_value_t object = jerry_create_object (); - jerry_release_value (object); - } + jerry_value_t object_dummy = jerry_create_object (); /* Get the number of iterable objects. */ int before_object_count = 0; @@ -130,6 +127,7 @@ test_internal_prop (void) } jerry_release_value (object); + jerry_release_value (object_dummy); } /* test_internal_prop */ static int test_data = 1;