From 644e046cf035a76c1712e3cdbe080b1eae8c7afc Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 18 Jan 2014 13:37:28 +0000 Subject: [PATCH] .upptst git-svn-id: svn://ultimatepp.org/upp/trunk@6787 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- upptst/NaNINF/NaNINF.upp | 9 +++++++++ upptst/NaNINF/NaNInf.cpp | 25 +++++++++++++++++++++++++ upptst/NaNINF/init | 4 ++++ 3 files changed, 38 insertions(+) create mode 100644 upptst/NaNINF/NaNINF.upp create mode 100644 upptst/NaNINF/NaNInf.cpp create mode 100644 upptst/NaNINF/init diff --git a/upptst/NaNINF/NaNINF.upp b/upptst/NaNINF/NaNINF.upp new file mode 100644 index 000000000..095ae49d2 --- /dev/null +++ b/upptst/NaNINF/NaNINF.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + NaNInf.cpp; + +mainconfig + "" = "SSE2"; + diff --git a/upptst/NaNINF/NaNInf.cpp b/upptst/NaNINF/NaNInf.cpp new file mode 100644 index 000000000..e72dfd863 --- /dev/null +++ b/upptst/NaNINF/NaNInf.cpp @@ -0,0 +1,25 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN +{ + double d = 0; + ASSERT(!IsNaN(d)); + ASSERT(!IsInf(d)); + ASSERT(IsFin(d)); + + d = sqrt(-1.0); + ASSERT(IsNaN(d)); + ASSERT(!IsInf(d)); + + d = 1e300; + d *= d; + ASSERT(!IsNaN(d)); + ASSERT(IsInf(d)); + + d = 1e300; + d *= -d; + ASSERT(!IsNaN(d)); + ASSERT(IsInf(d)); +} diff --git a/upptst/NaNINF/init b/upptst/NaNINF/init new file mode 100644 index 000000000..692eb3b80 --- /dev/null +++ b/upptst/NaNINF/init @@ -0,0 +1,4 @@ +#ifndef _NaNInf_icpp_init_stub +#define _NaNInf_icpp_init_stub +#include "Core/init" +#endif