Skip to content

Commit

Permalink
Merge pull request cpputest#1121 from Andne/float-warn
Browse files Browse the repository at this point in the history
Fix float warning
  • Loading branch information
basvodde authored Oct 9, 2017
2 parents ce0b67b + 6aa3266 commit 79870a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 3.7.0-ci{build}

image: Visual Studio 2015
image: Previous Visual Studio 2015

cache:
- C:\ProgramData\chocolatey\bin -> appveyor.yml
Expand Down
3 changes: 2 additions & 1 deletion tests/CppUTest/UtestTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ static void _exitTestMethod()
FAIL("Should not get here");
}

static volatile double zero = 0.0;

TEST(UtestShell, compareDoubles)
{
double zero = 0.0;
double not_a_number = zero / zero;
double infinity = 1 / zero;
CHECK(doubles_equal(1.0, 1.001, 0.01));
Expand Down
3 changes: 2 additions & 1 deletion tests/CppUTestExt/IEEE754PluginTest_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
#include "IEEE754PluginTest_c.h"

static volatile float f;
static volatile float zero_float = 0.0f;

void set_divisionbyzero_c(void)
{
f = 1.0f;
f /= 0.0f;
f /= zero_float;
}

void set_overflow_c(void)
Expand Down

0 comments on commit 79870a9

Please sign in to comment.