[geos-commits] [SCM] GEOS branch main updated. e7a9eb185dda3f3fca5661dda74125acb935fc69

git at osgeo.org git at osgeo.org
Tue Jul 8 16:00:22 PDT 2025


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, main has been updated
       via  e7a9eb185dda3f3fca5661dda74125acb935fc69 (commit)
      from  9e56f1e8b359f8f61efbbfed756e1462ef13fde1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e7a9eb185dda3f3fca5661dda74125acb935fc69
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Jul 8 15:59:58 2025 -0700

    Add coverage of more of DD class

diff --git a/tests/unit/math/DDTest.cpp b/tests/unit/math/DDTest.cpp
index b98cbae33..c3d448ddd 100644
--- a/tests/unit/math/DDTest.cpp
+++ b/tests/unit/math/DDTest.cpp
@@ -404,6 +404,45 @@ void object::test<13>
     checkBinomial2(5e14, 345291.0);
 }
 
+template<>
+template<>
+void object::test<14> ()
+{
+    DD a(1.0);
+    double b = 1.0;
+    DD c = a + b;
+    double e = 2.0;
+    double f = 0.0;
+    ensure_equals(e, c.doubleValue());
+    ensure_equals((int)e, c.intValue());
+    c = a - b;
+    ensure_equals(f, c.doubleValue());
+    c = a * e;
+    ensure_equals(e, c.doubleValue());
+    c = a / b;
+    ensure_equals(b, c.doubleValue());
+}
+
+template<>
+template<>
+void object::test<15> ()
+{
+    DD nan = DD(1.0) / DD(0.0);
+    DD r = nan.negate();
+    ensure(r.isNaN());
+}
+
+
+template<>
+template<>
+void object::test<16> ()
+{
+    DD result = DD::pow(DD(2.0), 0);
+    ensure_equals(result.doubleValue(), 1.0);
+
+    result = DD::pow(DD(2.0), 1);
+    ensure_equals(result.doubleValue(), 2.0);
+}
 
 
 } // namespace tut

-----------------------------------------------------------------------

Summary of changes:
 tests/unit/math/DDTest.cpp | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list