From 1e5d189152bdcf007e14c89883cc200fdd07be0c Mon Sep 17 00:00:00 2001 From: Evgeny Novikov Date: Mon, 6 Jun 2022 22:46:17 +0300 Subject: [PATCH] Update Aspectator printing queried declarations in one line Besides, extend the test case to demonstrate this. --- aspectator | 2 +- tests/input/complex_struct.c | 6 ++++++ tests/output/complex_struct_call_query_init_list.txt | 4 ++++ tests/output/complex_struct_call_query_init_list_json.txt | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/aspectator b/aspectator index 216d535..4c52807 160000 --- a/aspectator +++ b/aspectator @@ -1 +1 @@ -Subproject commit 216d535dedd0089f5b8b7a2af3316041b5bf3c79 +Subproject commit 4c5280750b7e5c0ac85ff2b23ebf95e35013f928 diff --git a/tests/input/complex_struct.c b/tests/input/complex_struct.c index 3ad0279..412be63 100644 --- a/tests/input/complex_struct.c +++ b/tests/input/complex_struct.c @@ -19,3 +19,9 @@ struct B }; struct B d = { {} }; + +struct +{ + int v; + int t; +} e = {.v = 212}; diff --git a/tests/output/complex_struct_call_query_init_list.txt b/tests/output/complex_struct_call_query_init_list.txt index b84c122..3fe9188 100644 --- a/tests/output/complex_struct_call_query_init_list.txt +++ b/tests/output/complex_struct_call_query_init_list.txt @@ -24,3 +24,7 @@ declaration: struct B d; value: field declaration: struct A b; value: {} +declaration: struct { int v; int t; } e; +value: + field declaration: int v; + value: 212 diff --git a/tests/output/complex_struct_call_query_init_list_json.txt b/tests/output/complex_struct_call_query_init_list_json.txt index 15d01a0..54450fe 100644 --- a/tests/output/complex_struct_call_query_init_list_json.txt +++ b/tests/output/complex_struct_call_query_init_list_json.txt @@ -6,3 +6,5 @@ declaration: struct A c[2U]; [{"value": [{"value": "21", "field": "int a;"}, {"value": [{"value": "12", "field": "int u;"}], "field": "union { int u; };"}], "index": 0}, {"value": "{}", "index": 1}] declaration: struct B d; [{"value": "{}", "field": "struct A b;"}] +declaration: struct { int v; int t; } e; +[{"value": "212", "field": "int v;"}]