From ef07fab261cce781ca750c1288574d4001f14bcf Mon Sep 17 00:00:00 2001 From: Johnny Richard Date: Sun, 30 Apr 2023 01:48:18 +0200 Subject: parser: Registry identifiers on scope We are parsing variables/functions and checking if they are defined on scope. Otherwise we fail the parsing with a nice message. Signed-off-by: Johnny Richard Co-authored-by: Carlos Maniero --- test/scope_test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/scope_test.c') diff --git a/test/scope_test.c b/test/scope_test.c index b8ee30e..c71a38f 100644 --- a/test/scope_test.c +++ b/test/scope_test.c @@ -31,24 +31,24 @@ test_scope(const MunitParameter params[], void *user_data_or_fixture) scope_t *scope = scope_new(); - assert_null(scope_get(scope, &first_id)); - assert_null(scope_get(scope, &second_id)); + assert_null(scope_get(scope, first_id.name)); + assert_null(scope_get(scope, second_id.name)); scope_push(scope, &first_id, &first_id_node_1); scope_push(scope, &second_id, &second_id_node); - assert_ptr_equal((void *)scope_get(scope, &first_id), (void *)&first_id_node_1); - assert_ptr_equal((void *)scope_get(scope, &second_id), (void *)&second_id_node); + assert_ptr_equal((void *)scope_get(scope, first_id.name), (void *)&first_id_node_1); + assert_ptr_equal((void *)scope_get(scope, second_id.name), (void *)&second_id_node); scope_enter(scope); scope_push(scope, &first_id, &first_id_node_2); - assert_ptr_equal((void *)scope_get(scope, &first_id), (void *)&first_id_node_2); - assert_ptr_equal((void *)scope_get(scope, &second_id), (void *)&second_id_node); + assert_ptr_equal((void *)scope_get(scope, first_id.name), (void *)&first_id_node_2); + assert_ptr_equal((void *)scope_get(scope, second_id.name), (void *)&second_id_node); scope_leave(scope); - assert_ptr_equal((void *)scope_get(scope, &first_id), (void *)&first_id_node_1); + assert_ptr_equal((void *)scope_get(scope, first_id.name), (void *)&first_id_node_1); scope_destroy(scope); -- cgit v1.2.3