From 3c885df74d624137fd2e12ff2ec7a3ee42704414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 15 May 2021 14:55:10 +0200 Subject: [PATCH] testunusedvar: Remove test cases that have undefined behavior --- test/testunusedvar.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/test/testunusedvar.cpp b/test/testunusedvar.cpp index ee8ca688a..3470292f7 100644 --- a/test/testunusedvar.cpp +++ b/test/testunusedvar.cpp @@ -3582,15 +3582,6 @@ private: ASSERT_EQUALS(// TODO "[test.cpp:4]: (style) Variable 'a' is assigned a value that is never used.\n" "[test.cpp:5]: (style) Variable 'c' is assigned a value that is never used.\n", errout.str()); - // extracttests.start: int x; - functionVariableUsage("void foo()\n" - "{\n" - " int a[10], * b = a + 10;\n" - " int * c = b - 10;\n" - " x = c[0];\n" - "}"); - ASSERT_EQUALS("[test.cpp:3]: (style) Variable 'a' is not assigned a value.\n", errout.str()); - functionVariableUsage("void foo()\n" "{\n" " int a[10], * b = a + 10;\n" @@ -3607,16 +3598,6 @@ private: "}"); // TODO ASSERT_EQUALS("[test.cpp:5]: (style) Variable 'c[1]' is assigned a value that is never used.\n", errout.str()); - // extracttests.start: void f(int); - functionVariableUsage("void foo()\n" - "{\n" - " int a[10], * b = a + 10;\n" - " int * c = b - 10;\n" - " int d = c[0];\n" - " f(d);\n" - "}"); - ASSERT_EQUALS("[test.cpp:3]: (style) Variable 'a' is not assigned a value.\n", errout.str()); - functionVariableUsage("void foo() {\n" // #4022 - FP (a is assigned a value that is never used) " int a[2], *b[2];\n" " a[0] = 123;\n"