Piotr Caban : msvcp90: Added std::tanh(complex) tests.

Alexandre Julliard julliard at winehq.org
Thu Jan 24 12:59:49 CST 2013


Module: wine
Branch: master
Commit: ec5e51d8935c28aeaee348a3c9226a997473759a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ec5e51d8935c28aeaee348a3c9226a997473759a

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Jan 24 12:39:28 2013 +0100

msvcp90: Added std::tanh(complex) tests.

---

 dlls/msvcp90/tests/misc.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/dlls/msvcp90/tests/misc.c b/dlls/msvcp90/tests/misc.c
index 0f1b27e..9f0b14b 100644
--- a/dlls/msvcp90/tests/misc.c
+++ b/dlls/msvcp90/tests/misc.c
@@ -113,6 +113,7 @@ static complex_float* (__cdecl *p_complex_float_add)(complex_float*, const compl
 static complex_float* (__cdecl *p_complex_float_div)(complex_float*, const complex_float*, const complex_float*);
 static float (__cdecl *p_complex_float__Fabs)(const complex_float*, int*);
 static complex_float* (__cdecl *p_complex_float_tan)(complex_float*, const complex_float*);
+static complex_float* (__cdecl *p_complex_float_tanh)(complex_float*, const complex_float*);
 
 static int invalid_parameter = 0;
 static void __cdecl test_invalid_parameter_handler(const wchar_t *expression,
@@ -255,6 +256,8 @@ static BOOL init(void)
                 "??$_Fabs at M@std@@YAMAEBV?$complex at M@0 at PEAH@Z");
         SET(p_complex_float_tan,
                 "??$tan at M@std@@YA?AV?$complex at M@0 at AEBV10@@Z");
+        SET(p_complex_float_tanh,
+                "??$tanh at M@std@@YA?AV?$complex at M@0 at AEBV10@@Z");
     } else {
         SET(p_char_assign, "?assign@?$char_traits at D@std@@SAXAADABD at Z");
         SET(p_wchar_assign, "?assign@?$char_traits at _W@std@@SAXAA_WAB_W at Z");
@@ -303,6 +306,8 @@ static BOOL init(void)
                 "??$_Fabs at M@std@@YAMABV?$complex at M@0 at PAH@Z");
         SET(p_complex_float_tan,
                 "??$tan at M@std@@YA?AV?$complex at M@0 at ABV10@@Z");
+        SET(p_complex_float_tanh,
+                "??$tanh at M@std@@YA?AV?$complex at M@0 at ABV10@@Z");
     }
 
     init_thiscall_thunk();
@@ -716,18 +721,36 @@ static void test_complex(void)
     p_complex_float_tan(&c2, &c1);
     ok(c2.real == 0, "c2.real = %f\n", c2.real);
     ok(c2.imag == 0, "c2.imag = %f\n", c2.imag);
+    p_complex_float_tanh(&c2, &c1);
+    ok(c2.real == 0, "c2.real = %f\n", c2.real);
+    ok(c2.imag == 0, "c2.imag = %f\n", c2.imag);
 
     c1.real = 3.14159/2;
     c1.imag = 0;
     p_complex_float_tan(&c2, &c1);
     ok(almost_eq(c2.real, 788906.062500), "c2.real = %f\n", c2.real);
     ok(c2.imag == 0, "c2.imag = %f\n", c2.imag);
+    p_complex_float_tanh(&c2, &c1);
+    ok(almost_eq(c2.real, 0.917152), "c2.real = %f\n", c2.real);
+    ok(c2.imag == 0, "c2.imag = %f\n", c2.imag);
 
     c1.real = 7.12;
     c1.imag = 0.17;
     p_complex_float_tan(&c2, &c1);
     ok(almost_eq(c2.real, 1.040818), "c2.real = %f\n", c2.real);
     ok(almost_eq(c2.imag, 0.362651), "c2.imag = %f\n", c2.imag);
+    p_complex_float_tanh(&c2, &c1);
+    ok(almost_eq(c2.real, 0.999999), "c2.real = %f\n", c2.real);
+    ok(almost_eq(c2.imag, 4.3627e-7), "c2.imag = %g\n", c2.imag);
+
+    c1.real = 0.14;
+    c1.imag = 0.19;
+    p_complex_float_tan(&c2, &c1);
+    ok(almost_eq(c2.real, 0.135859), "c2.real = %f\n", c2.real);
+    ok(almost_eq(c2.imag, 0.191341), "c2.imag = %f\n", c2.imag);
+    p_complex_float_tanh(&c2, &c1);
+    ok(almost_eq(c2.real, 0.144134), "c2.real = %f\n", c2.real);
+    ok(almost_eq(c2.imag, 0.188464), "c2.imag = %f\n", c2.imag);
 }
 
 START_TEST(misc)




More information about the wine-cvs mailing list