[opengtl-commits] [252] * add a test for vectors creation

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 252
Author:   cyrille
Date:     2008-06-27 22:34:14 +0200 (Fri, 27 Jun 2008)

Log Message:
-----------
* add a test for vectors creation
* add a simple convolution : copy...

Modified Paths:
--------------
    trunk/OpenGTL/OpenShiva/tests/CMakeLists.txt

Added Paths:
-----------
    trunk/OpenGTL/OpenShiva/tests/convolution/copy.shiva
    trunk/OpenGTL/OpenShiva/tests/vectors/
    trunk/OpenGTL/OpenShiva/tests/vectors/CMakeLists.txt
    trunk/OpenGTL/OpenShiva/tests/vectors/creation.shiva


Modified: trunk/OpenGTL/OpenShiva/tests/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenShiva/tests/CMakeLists.txt	2008-06-27 20:33:40 UTC (rev 251)
+++ trunk/OpenGTL/OpenShiva/tests/CMakeLists.txt	2008-06-27 20:34:14 UTC (rev 252)
@@ -1,3 +1,4 @@
 add_subdirectory(parse)
 add_subdirectory(library)
-add_subdirectory(structures)
\ No newline at end of file
+add_subdirectory(structures)
+add_subdirectory(vectors)

Added: trunk/OpenGTL/OpenShiva/tests/convolution/copy.shiva
===================================================================
--- trunk/OpenGTL/OpenShiva/tests/convolution/copy.shiva	                        (rev 0)
+++ trunk/OpenGTL/OpenShiva/tests/convolution/copy.shiva	2008-06-27 20:34:14 UTC (rev 252)
@@ -0,0 +1,10 @@
+kernel Copy
+{
+  void evaluatePixel(image img, out pixel result)
+  {
+    float2 point;
+    point[0] = result.x;
+    point[1] = result.y;
+    result = img.sampleNearest( point );
+  }
+}

Added: trunk/OpenGTL/OpenShiva/tests/vectors/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenShiva/tests/vectors/CMakeLists.txt	                        (rev 0)
+++ trunk/OpenGTL/OpenShiva/tests/vectors/CMakeLists.txt	2008-06-27 20:34:14 UTC (rev 252)
@@ -0,0 +1,8 @@
+
+set( TESTS_FILES
+  creation.shiva
+  )
+
+FOREACH( TEST_FILE ${TESTS_FILES} )
+  ADD_TEST(${TEST_FILE} ${SHIVATESTER} ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE})
+ENDFOREACH( TEST_FILE )

Added: trunk/OpenGTL/OpenShiva/tests/vectors/creation.shiva
===================================================================
--- trunk/OpenGTL/OpenShiva/tests/vectors/creation.shiva	                        (rev 0)
+++ trunk/OpenGTL/OpenShiva/tests/vectors/creation.shiva	2008-06-27 20:34:14 UTC (rev 252)
@@ -0,0 +1,16 @@
+kernel MyKernel
+{
+  void evaluatePixel(output pixel result)
+  {
+  }
+  int runTest()
+  {
+    int count = 0;
+    float2 v;
+    v[0] = 1.0;
+    v[1] = -1.0;
+    if( v[0] != 1.0 ) ++count;
+    if( v[1] != -1.0 ) ++count;
+    return count;
+  }
+}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/