Skip to content

Commit abedab5

Browse files
authored
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 [email protected]
1 parent ad7fc07 commit abedab5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/unit-core/test-objects-foreach.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,7 @@ static void
9393
test_internal_prop (void)
9494
{
9595
/* Make sure that the object is initialized in the engine. */
96-
{
97-
jerry_value_t object = jerry_create_object ();
98-
jerry_release_value (object);
99-
}
96+
jerry_value_t object_dummy = jerry_create_object ();
10097

10198
/* Get the number of iterable objects. */
10299
int before_object_count = 0;
@@ -130,6 +127,7 @@ test_internal_prop (void)
130127
}
131128

132129
jerry_release_value (object);
130+
jerry_release_value (object_dummy);
133131
} /* test_internal_prop */
134132

135133
static int test_data = 1;

0 commit comments

Comments
 (0)