summaryrefslogtreecommitdiff
path: root/tests/cxx
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2013-02-17 11:15:11 +0100
committerMarc Glisse <marc.glisse@inria.fr>2013-02-17 11:15:11 +0100
commit40a3102c2d9ccee25b5dab3aaf5e00cbe8db3b5b (patch)
tree4b94bf524375b191c6486704a3e55bb398e161e4 /tests/cxx
parent37544d3499ff88bebe279ea9dabb670c5958b14c (diff)
downloadgmp-40a3102c2d9ccee25b5dab3aaf5e00cbe8db3b5b.tar.gz
Link C++ tests with -lm, so we can compare the result of mpf functions with libm functions.
Diffstat (limited to 'tests/cxx')
-rw-r--r--tests/cxx/Makefile.am4
-rw-r--r--tests/cxx/t-ops2.cc2
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/cxx/Makefile.am b/tests/cxx/Makefile.am
index f603dfa58..b888d65a4 100644
--- a/tests/cxx/Makefile.am
+++ b/tests/cxx/Makefile.am
@@ -22,12 +22,14 @@
# 3.2 on itanium2-hp-hpux11.22. Without this option, the libgmp.sl.6
# required by libgmpxx.sl (ie. in its NEEDED records) is not found by the
# linker. FIXME: Presumably libtool should do something about this itself.
+# -lm is needed for t-ops2 which compares the results of trunc and mpf_trunc.
#
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/tests
LDADD = -L$(top_builddir)/.libs \
$(top_builddir)/tests/libtests.la \
$(top_builddir)/libgmpxx.la \
- $(top_builddir)/libgmp.la
+ $(top_builddir)/libgmp.la \
+ -lm
if WANT_CXX
check_PROGRAMS = t-assign t-binary t-cast t-constr t-cxx11 \
diff --git a/tests/cxx/t-ops2.cc b/tests/cxx/t-ops2.cc
index fceb4470c..656790b44 100644
--- a/tests/cxx/t-ops2.cc
+++ b/tests/cxx/t-ops2.cc
@@ -184,6 +184,8 @@ void checkf (){
ASSERT_ALWAYS(sqrt(mpf_class(7))>2.64);
ASSERT_ALWAYS(sqrt(mpf_class(7))<2.65);
ASSERT_ALWAYS(sqrt(mpf_class(0))==0);
+ // TODO: add some consistency checks, as described in
+ // http://gmplib.org/list-archives/gmp-bugs/2013-February/002940.html
CHECK1(mpf_class,1.9,trunc);
CHECK1(mpf_class,1.9,floor);
CHECK1(mpf_class,1.9,ceil);