From 18f261ad512b16a29332e89a784a6939e2a1148e Mon Sep 17 00:00:00 2001 From: Phil Turnbull Date: Wed, 14 Jun 2017 11:08:09 -0400 Subject: [PATCH] Initialise all fields of TSParseOptions in tests This should prevent any confusing failures in the unit tests: test/runtime/document_test.cc:381:7: warning: Passed-by-value struct argument contains uninitialized data (e.g., field: 'changed_range_count') ts_document_parse_with_options(document, options); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test/runtime/document_test.cc:408:7: warning: Passed-by-value struct argument contains uninitialized data (e.g., field: 'changed_range_count') ts_document_parse_with_options(document, options); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- test/runtime/document_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runtime/document_test.cc b/test/runtime/document_test.cc index 7757823c..0fd2e65f 100644 --- a/test/runtime/document_test.cc +++ b/test/runtime/document_test.cc @@ -374,7 +374,7 @@ describe("Document", [&]() { ts_document_set_language(document, load_real_language("json")); ts_document_set_input_string(document, input_string.c_str()); - TSParseOptions options; + TSParseOptions options = {}; options.changed_ranges = nullptr; options.halt_on_error = false; @@ -402,7 +402,7 @@ describe("Document", [&]() { ts_document_set_language(document, load_real_language("json")); ts_document_set_input_string(document, input_string.c_str()); - TSParseOptions options; + TSParseOptions options = {}; options.changed_ranges = nullptr; options.halt_on_error = true; ts_document_parse_with_options(document, options);