Skip to content

Commit 8de13ff

Browse files
committed
Enable the snapshot related test code in test-api.c
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
1 parent d3dc057 commit 8de13ff

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/unit/test-api.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,7 @@ main (void)
725725
jerry_cleanup ();
726726

727727
// Dump / execute snapshot
728-
// FIXME: support save/load snapshot for optimized parser
729-
if (false)
728+
if (true)
730729
{
731730
static uint8_t global_mode_snapshot_buffer[1024];
732731
static uint8_t eval_mode_snapshot_buffer[1024];
@@ -760,8 +759,13 @@ main (void)
760759
false);
761760

762761
JERRY_ASSERT (!jerry_value_has_error_flag (res));
763-
JERRY_ASSERT (jerry_value_is_undefined (res));
762+
JERRY_ASSERT (jerry_value_is_string (res));
763+
sz = jerry_get_string_size (res);
764+
JERRY_ASSERT (sz == 20);
765+
sz = jerry_string_to_char_buffer (res, (jerry_char_t *) buffer, sz);
766+
JERRY_ASSERT (sz == 20);
764767
jerry_release_value (res);
768+
JERRY_ASSERT (!strncmp (buffer, "string from snapshot", (size_t) sz));
765769

766770
res = jerry_exec_snapshot (eval_mode_snapshot_buffer,
767771
eval_mode_snapshot_size,

0 commit comments

Comments
 (0)