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
This commit is contained in:
Péter Gál 2021-01-15 20:50:26 +01:00 committed by GitHub
parent ad7fc07ca4
commit abedab5ac2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,10 +93,7 @@ static void
test_internal_prop (void) test_internal_prop (void)
{ {
/* Make sure that the object is initialized in the engine. */ /* Make sure that the object is initialized in the engine. */
{ jerry_value_t object_dummy = jerry_create_object ();
jerry_value_t object = jerry_create_object ();
jerry_release_value (object);
}
/* Get the number of iterable objects. */ /* Get the number of iterable objects. */
int before_object_count = 0; int before_object_count = 0;
@ -130,6 +127,7 @@ test_internal_prop (void)
} }
jerry_release_value (object); jerry_release_value (object);
jerry_release_value (object_dummy);
} /* test_internal_prop */ } /* test_internal_prop */
static int test_data = 1; static int test_data = 1;