From d4344bd859da957dad91637b74e7ed3016b11033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 30 Jul 2015 14:05:53 +0200 Subject: [PATCH] cleanup testcases for div() --- test/testother.cpp | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/test/testother.cpp b/test/testother.cpp index dc50a3379..61e22debe 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -36,7 +36,6 @@ private: TEST_CASE(zeroDiv1); TEST_CASE(zeroDiv2); - TEST_CASE(zeroDiv3); TEST_CASE(zeroDiv4); TEST_CASE(zeroDiv5); TEST_CASE(zeroDiv6); @@ -288,21 +287,6 @@ private: ASSERT_EQUALS("", errout.str()); } - void zeroDiv3() { - check("void f()\n" - "{\n" - " div_t divresult = div (1,0);\n" - "}"); - ASSERT_EQUALS("[test.cpp:3]: (error) Division by zero.\n", errout.str()); - - // #4929 - if there is a user function with the name "div" don't warn - check("void div(int a, int b);\n" - "void f() {\n" - " div (1,0);\n" - "}"); - ASSERT_EQUALS("", errout.str()); - } - void zeroDiv4() { check("void f()\n" "{\n" @@ -328,18 +312,6 @@ private: "}"); ASSERT_EQUALS("[test.cpp:3]: (error) Division by zero.\n", errout.str()); - check("void f()\n" - "{\n" - " div_t divresult = div (1,0L);\n" - "}"); - ASSERT_EQUALS("[test.cpp:3]: (error) Division by zero.\n", errout.str()); - - check("void f()\n" - "{\n" - " div_t divresult = div (1,0x5);\n" - "}"); - ASSERT_EQUALS("", errout.str()); - // Don't warn about floating points (gcc doesn't warn either) // and floating points are handled differently than integers. check("void f()\n" @@ -353,19 +325,6 @@ private: " long a = b / 0.5;\n" "}"); ASSERT_EQUALS("", errout.str()); - - // Don't warn about 0.0 - check("void f()\n" - "{\n" - " div_t divresult = div (1,0.0);\n" - "}"); - ASSERT_EQUALS("", errout.str()); - - check("void f()\n" - "{\n" - " div_t divresult = div (1,0.5);\n" - "}"); - ASSERT_EQUALS("", errout.str()); } void zeroDiv5() {