=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: oleaut32/tests: Add tests for VarDecCmpR8 (gcov).

Alexandre Julliard julliard at winehq.org
Tue Jun 11 14:27:52 CDT 2013


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

Author: André Hentschel <nerv at dawncrow.de>
Date:   Sun Jun  9 23:27:24 2013 +0200

oleaut32/tests: Add tests for VarDecCmpR8 (gcov).

---

 dlls/oleaut32/tests/vartype.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/dlls/oleaut32/tests/vartype.c b/dlls/oleaut32/tests/vartype.c
index 4411d7d..345a822 100644
--- a/dlls/oleaut32/tests/vartype.c
+++ b/dlls/oleaut32/tests/vartype.c
@@ -482,6 +482,7 @@ static HRESULT (WINAPI *pVarDecSub)(const DECIMAL*,const DECIMAL*,DECIMAL*);
 static HRESULT (WINAPI *pVarDecMul)(const DECIMAL*,const DECIMAL*,DECIMAL*);
 static HRESULT (WINAPI *pVarDecDiv)(const DECIMAL*,const DECIMAL*,DECIMAL*);
 static HRESULT (WINAPI *pVarDecCmp)(const DECIMAL*,const DECIMAL*);
+static HRESULT (WINAPI *pVarDecCmpR8)(const DECIMAL*,double);
 static HRESULT (WINAPI *pVarDecNeg)(const DECIMAL*,DECIMAL*);
 
 static HRESULT (WINAPI *pVarBoolFromUI1)(BYTE,VARIANT_BOOL*);
@@ -4258,6 +4259,8 @@ static void test_VarDecFromCy(void)
 #define MATH1(func) hres = p##func(&l, &out)
 #undef MATH2
 #define MATH2(func) hres = p##func(&l, &r, &out)
+#undef MATH3
+#define MATH3(func) hres = p##func(&l, r)
 
 static void test_VarDecAbs(void)
 {
@@ -4554,6 +4557,36 @@ static void test_VarDecCmp(void)
 
 }
 
+static void test_VarDecCmpR8(void)
+{
+  HRESULT hres;
+  DECIMAL l;
+  double r;
+
+  CHECKPTR(VarDecCmpR8);
+
+  SETDEC(l,0,0,0,1); r = 0.0;  MATH3(VarDecCmpR8); EXPECT_GT;
+  SETDEC(l,0,0,0,1); r = 0.1;  MATH3(VarDecCmpR8); EXPECT_GT;
+  SETDEC(l,0,0,0,1); r = -0.1; MATH3(VarDecCmpR8); EXPECT_GT;
+
+  SETDEC(l,0,DECIMAL_NEG,0,1); r = 0.0;  MATH3(VarDecCmpR8); EXPECT_LT;
+  SETDEC(l,0,DECIMAL_NEG,0,1); r = 0.1;  MATH3(VarDecCmpR8); EXPECT_LT;
+  SETDEC(l,0,DECIMAL_NEG,0,1); r = -0.1; MATH3(VarDecCmpR8); EXPECT_LT;
+
+  SETDEC(l,0,0,0,0); r = 0.0;  MATH3(VarDecCmpR8); EXPECT_EQ;
+  SETDEC(l,0,0,0,0); r = 0.1;  MATH3(VarDecCmpR8); EXPECT_LT;
+  SETDEC(l,0,0,0,0); r = -0.1; MATH3(VarDecCmpR8); EXPECT_GT;
+
+  SETDEC(l,0,DECIMAL_NEG,0,0); r = 0.0;  MATH3(VarDecCmpR8); EXPECT_EQ;
+  SETDEC(l,0,DECIMAL_NEG,0,0); r = 0.1;  MATH3(VarDecCmpR8); EXPECT_LT;
+  SETDEC(l,0,DECIMAL_NEG,0,0); r = -0.1; MATH3(VarDecCmpR8); EXPECT_GT;
+
+  SETDEC(l,0,0,0,1);             r = DECIMAL_NEG; MATH3(VarDecCmpR8); EXPECT_LT;
+  SETDEC(l,0,DECIMAL_NEG,0,0);   r = DECIMAL_NEG; MATH3(VarDecCmpR8); EXPECT_LT;
+  SETDEC(l,0,0,-1,-1);           r = DECIMAL_NEG; MATH3(VarDecCmpR8); EXPECT_GT;
+  SETDEC(l,0,DECIMAL_NEG,-1,-1); r = DECIMAL_NEG; MATH3(VarDecCmpR8); EXPECT_LT;
+}
+
 /*
  * VT_BOOL
  */
@@ -6358,6 +6391,7 @@ START_TEST(vartype)
   test_VarDecAdd();
   test_VarDecSub();
   test_VarDecCmp();
+  test_VarDecCmpR8();
   test_VarDecMul();
   test_VarDecDiv();
 




More information about the wine-cvs mailing list