Skip to content

Commit fa783f7

Browse files
committed
Removing IEEE754 implementation from MAC
1 parent 02513e8 commit fa783f7

File tree

4 files changed

+54
-2
lines changed

4 files changed

+54
-2
lines changed

examples/AllTests/FEDemoTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
#include "CppUTest/CommandLineTestRunner.h"
2929
#include "CppUTest/TestHarness.h"
3030
#include "CppUTest/TestRegistry.h"
31-
#include "CppUTestExt/IEEE754ExceptionsPlugin.h"
3231

3332
#ifdef CPPUTEST_HAVE_FENV
33+
#include "CppUTestExt/IEEE754ExceptionsPlugin.h"
3434

3535
/*
3636
* To see a demonstration of tests failing as a result of IEEE754ExceptionsPlugin

include/CppUTest/CppUTestConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
* Works on non-Visual C++ compilers and Visual C++ 2008 and newer
173173
*/
174174

175-
#if CPPUTEST_USE_STD_C_LIB && (!defined(_MSC_VER) || (_MSC_VER >= 1800))
175+
#if CPPUTEST_USE_STD_C_LIB && (!defined(_MSC_VER) || (_MSC_VER >= 1800)) && (!defined(__APPLE__))
176176
#define CPPUTEST_HAVE_FENV
177177
#if defined(__WATCOMC__) || defined(__ARMEL__) || defined(__m68k__)
178178
#define CPPUTEST_FENV_IS_WORKING_PROPERLY 0

src/CppUTestExt/IEEE754ExceptionsPlugin.cpp

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,54 @@ void IEEE754ExceptionsPlugin::ieee754Check(UtestShell& test, TestResult& result,
100100
}
101101
}
102102

103+
#else
104+
105+
106+
bool IEEE754ExceptionsPlugin::inexactDisabled_ = true;
107+
108+
IEEE754ExceptionsPlugin::IEEE754ExceptionsPlugin(const SimpleString& name)
109+
: TestPlugin(name)
110+
{
111+
}
112+
113+
void IEEE754ExceptionsPlugin::preTestAction(UtestShell&, TestResult&)
114+
{
115+
}
116+
117+
void IEEE754ExceptionsPlugin::postTestAction(UtestShell&, TestResult&)
118+
{
119+
}
120+
121+
void IEEE754ExceptionsPlugin::disableInexact()
122+
{
123+
}
124+
125+
void IEEE754ExceptionsPlugin::enableInexact()
126+
{
127+
}
128+
129+
bool IEEE754ExceptionsPlugin::checkIeee754OverflowExceptionFlag()
130+
{
131+
return false;
132+
}
133+
134+
bool IEEE754ExceptionsPlugin::checkIeee754UnderflowExceptionFlag()
135+
{
136+
return false;
137+
}
138+
139+
bool IEEE754ExceptionsPlugin::checkIeee754InexactExceptionFlag()
140+
{
141+
return false;
142+
}
143+
144+
bool IEEE754ExceptionsPlugin::checkIeee754DivByZeroExceptionFlag()
145+
{
146+
return false;
147+
}
148+
149+
void IEEE754ExceptionsPlugin::ieee754Check(UtestShell&, TestResult&, int, const char*)
150+
{
151+
}
152+
103153
#endif

tests/CppUTestExt/IEEE754PluginTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "CppUTest/TestTestingFixture.h"
3232
#include "CppUTestExt/IEEE754ExceptionsPlugin.h"
3333

34+
#ifdef CPPUTEST_HAVE_FENV
3435
#if CPPUTEST_FENV_IS_WORKING_PROPERLY
3536

3637
extern "C"
@@ -143,3 +144,4 @@ IGNORE_TEST(IEEE754ExceptionsPlugin2, should_not_fail_in_ignored_test)
143144
}
144145

145146
#endif
147+
#endif

0 commit comments

Comments
 (0)