From 43bca8431093260d9dd5f397cd91c272edcd6c4d Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 30 Jul 2025 11:21:55 +0100 Subject: [PATCH 1/3] CPP: Convert test to use a stub rather than a library include. --- .../test/query-tests/Critical/InitialisationNotRun/test.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpp/ql/test/query-tests/Critical/InitialisationNotRun/test.cpp b/cpp/ql/test/query-tests/Critical/InitialisationNotRun/test.cpp index a9a3129e759c..ee0d070df088 100644 --- a/cpp/ql/test/query-tests/Critical/InitialisationNotRun/test.cpp +++ b/cpp/ql/test/query-tests/Critical/InitialisationNotRun/test.cpp @@ -1,4 +1,8 @@ -#include +// --- stubs --- + +char *strcpy(char *dest, const char *src); + +// --- tests --- class GlobalStorage { public: From d6fddde6e0dd4504fc0890507b97a62471b02a04 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 30 Jul 2025 11:22:23 +0100 Subject: [PATCH 2/3] CPP: Add .expected (results before query changes here). --- .../InitialisationNotRun/InitialisationNotRun.expected | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 cpp/ql/test/query-tests/Critical/InitialisationNotRun/InitialisationNotRun.expected diff --git a/cpp/ql/test/query-tests/Critical/InitialisationNotRun/InitialisationNotRun.expected b/cpp/ql/test/query-tests/Critical/InitialisationNotRun/InitialisationNotRun.expected new file mode 100644 index 000000000000..f3fbfc87dee6 --- /dev/null +++ b/cpp/ql/test/query-tests/Critical/InitialisationNotRun/InitialisationNotRun.expected @@ -0,0 +1,3 @@ +| test.cpp:12:16:12:17 | g1 | Initialization code for 'g1' is never run. | +| test.cpp:14:23:14:24 | g3 | Initialization code for 'g3' is never run. | +| test.cpp:16:12:16:12 | a | Initialization code for 'a' is never run. | From c0638a5fcbe78055d80b1e3ee16fae0dfe2cd35a Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 30 Jul 2025 11:24:57 +0100 Subject: [PATCH 3/3] CPP: Update .expected for the changes here. --- .../Critical/InitialisationNotRun/InitialisationNotRun.expected | 1 - 1 file changed, 1 deletion(-) diff --git a/cpp/ql/test/query-tests/Critical/InitialisationNotRun/InitialisationNotRun.expected b/cpp/ql/test/query-tests/Critical/InitialisationNotRun/InitialisationNotRun.expected index f3fbfc87dee6..fdb53a2a4689 100644 --- a/cpp/ql/test/query-tests/Critical/InitialisationNotRun/InitialisationNotRun.expected +++ b/cpp/ql/test/query-tests/Critical/InitialisationNotRun/InitialisationNotRun.expected @@ -1,3 +1,2 @@ | test.cpp:12:16:12:17 | g1 | Initialization code for 'g1' is never run. | | test.cpp:14:23:14:24 | g3 | Initialization code for 'g3' is never run. | -| test.cpp:16:12:16:12 | a | Initialization code for 'a' is never run. |