summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2010-02-23 19:50:46 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2010-02-23 19:50:46 +0000
commit6258e05ac22e6ba4925002c876c2515b033bf417 (patch)
tree2899092bb15691793df6ae1c8ff10023e6a3db5f
parent2ff437c7a6bdcf3b7bc95f7b543372d9a649fb62 (diff)
downloadATCD-6258e05ac22e6ba4925002c876c2515b033bf417.tar.gz
ChangeLogTag:Tue
-rw-r--r--ACE/ChangeLog12
-rw-r--r--ACE/configure.ac2
-rw-r--r--ACE/tests/OS_Test.cpp72
3 files changed, 84 insertions, 2 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index a465c990d97..f9e00ce945b 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,15 @@
+Tue Feb 23 19:45:39 UTC 2010 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
+
+ * tests/OS_Test.cpp: Added tests for floorl() and ceill(). Thanks
+ to Olivier Langlois <olivier at olivierlanglois dot net> for
+ this fix.
+
+Tue Feb 23 19:43:36 UTC 2010 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
+
+ * configure.ac: Added a check for ACE_CHECK_LACKS_FUNCS(floor ceil
+ floorl ceill). Thanks to Olivier Langlois <olivier at
+ olivierlanglois dot net> for this fix.
+
Tue Feb 23 15:15:00 UTC 2010 Simon Massey <sma at prismtech dot com>
* ace/config-lynxos.h:
diff --git a/ACE/configure.ac b/ACE/configure.ac
index ba3dec23d8d..561c1d192c6 100644
--- a/ACE/configure.ac
+++ b/ACE/configure.ac
@@ -3288,6 +3288,8 @@ ACE_CHECK_LACKS_FUNCS(strtoul)
ACE_FUNC_STRTOULL
+ACE_CHECK_LACKS_FUNCS(floor ceil floorl ceill)
+
# swab() comes in a number of forms:
# swab (const void*, void*, size_t) is POSIX, XPG4, SUS, SUSv2 standard.
# swab (const char*, char*, size_t) is SVID third edition.
diff --git a/ACE/tests/OS_Test.cpp b/ACE/tests/OS_Test.cpp
index 6144e102ceb..ae914515716 100644
--- a/ACE/tests/OS_Test.cpp
+++ b/ACE/tests/OS_Test.cpp
@@ -1153,7 +1153,11 @@ ceil_test (void)
result = ACE_OS::ceil (values [i]);
if (!is_equal(result, results[i]))
{
- ACE_ERROR ((LM_ERROR, ACE_TEXT ("ceil error: input %.1F, output %1F, expected %1F\n"), values [i], result, results [i]));
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("ceil error: input %.1F, output %1F, expected %1F\n"),
+ values [i],
+ result,
+ results [i]));
error_count++;
}
}
@@ -1177,7 +1181,65 @@ floor_test (void)
result = ACE_OS::floor (values [i]);
if (!is_equal(result, results[i]))
{
- ACE_ERROR ((LM_ERROR, ACE_TEXT ("floor error: input %.1F, output %1F, expected %1F\n"), values [i], result, results [i]));
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("floor error: input %.1F, output %1F, expected %1F\n"),
+ values [i],
+ result,
+ results [i]));
+ error_count++;
+ }
+ }
+
+ return error_count;
+}
+
+int
+ceill_test (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Testing ceill method\n")));
+
+ long double values[] = {-2.5, -1.5, 1.5, 2.5};
+ long double results[] = {-2.0, -1.0, 2.0, 3.0};
+ long double result = 0.0;
+ int error_count = 0;
+
+ for (size_t i = 0 ; i < sizeof (values) / sizeof (long double) ; i++)
+ {
+ result = ACE_OS::ceil (values [i]);
+ if (!is_equal(result, results[i]))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("ceil error: input %.1F, output %1F, expected %1F\n"),
+ values [i],
+ result,
+ results [i]));
+ error_count++;
+ }
+ }
+
+ return error_count;
+}
+
+int
+floorl_test (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Testing floorl method\n")));
+
+ long double values[] = {-2.5, -1.5, 1.5, 2.5};
+ long double results[] = {-3.0, -2.0, 1.0, 2.0};
+ long double result = 0.0;
+ int error_count = 0;
+
+ for (size_t i = 0 ; i < sizeof (values) / sizeof (long double) ; i++)
+ {
+ result = ACE_OS::floor (values [i]);
+ if (!is_equal(result, results[i]))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("floor error: input %.1F, output %1F, expected %1F\n"),
+ values [i], result, results [i]));
error_count++;
}
}
@@ -1252,6 +1314,12 @@ run_main (int, ACE_TCHAR *[])
if ((result = floor_test ()) != 0)
status = result;
+ if ((result = ceill_test ()) != 0)
+ status = result;
+
+ if ((result = floorl_test ()) != 0)
+ status = result;
+
if ((result = log2_test ()) != 0)
status = result;