[Piglit] [PATCH 4/4] cl: Add tan tests

Aaron Watry awatry at gmail.com
Thu Sep 4 10:30:21 PDT 2014


Signed-off-by: Aaron Watry <awatry at gmail.com>
---
 generated_tests/generate-cl-math-builtins.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/generated_tests/generate-cl-math-builtins.py b/generated_tests/generate-cl-math-builtins.py
index 0677569..394207a 100644
--- a/generated_tests/generate-cl-math-builtins.py
+++ b/generated_tests/generate-cl-math-builtins.py
@@ -25,7 +25,7 @@
 import os
 
 from genclbuiltins import gen
-from math import acos, asin, atan, atan2, pi, sin, sqrt, cos, fabs
+from math import acos, asin, atan, atan2, pi, sin, sqrt, cos, fabs, tan, pow
 
 CLC_VERSION_MIN = {
     'acos' : 10,
@@ -42,6 +42,7 @@ CLC_VERSION_MIN = {
     'round' : 10,
     'sign' : 10,
     'sin' : 10,
+    'tan' : 10,
     'sqrt' : 10,
     'trunc' : 10
 }
@@ -111,8 +112,8 @@ tests = {
         'arg_types' : [F, F],
         'function_type': 'ttt',
         'values' : [
-            [1.0, 0.0,    -1.0, 0.0,        1.0,    cos(1.12345)], # Result
-            [0.0, pi / 2, pi,   3 * pi / 2, 2 * pi, 1.12345] # Arg0
+            [1.0, 0.0,    -1.0, 0.0,        1.0,    cos(1.12345), -0.9258790228548379], # Result
+            [0.0, pi / 2, pi,   3 * pi / 2, 2 * pi, 1.12345, pow(2,120)] # Arg0
         ],
         'tolerance' : 2
     },
@@ -187,6 +188,15 @@ tests = {
         ],
         'tolerance': 3
     },
+    'tan' : {
+        'arg_types': [F, F],
+        'function_type': 'ttt',
+        'values': [
+            [0.0, 1.0,  0.0, sqrt(3), -1.0,   tan(2.234567), float("nan") ], # Result
+            [0.0, pi/4, pi,  pi/3,    3*pi/4, 2.234567 ,     float("nan") ], # Arg1
+        ],
+        'tolerance': 5
+    },
     'trunc' : {
         'arg_types': [F, F],
         'function_type': 'ttt',
-- 
1.9.1



More information about the Piglit mailing list