OSDN Git Service

fr_vector_fill() passed test
[libbfin32/algorithm_vector.git] / algorithm_vector / fx_vector_test.c
index dbcc266..2c69edb 100644 (file)
@@ -799,3 +799,43 @@ void test_08_fr32_vector_neg()
 #undef TAPS_08
 #undef NUMSAMPLE_08
 
+/*
+ * Basic test to see scalar + vector addition.
+ */
+#define NUMSAMPLE_09 4
+
+
+
+fract32 desired_09[NUMSAMPLE_09] =
+    {
+        0x3,
+        0x3,
+        0x3,
+        0x00000000,         // 0 for count test
+    };
+
+void test_09_fr32_vector_fill()
+{
+    fract32 output[NUMSAMPLE_09];
+    int i;
+
+
+        // clear output buffer
+    clearBuffer( output, NUMSAMPLE_09);
+        // test subtraction. Sample is less than NUMSAMPLE_09 to test the count parameter
+    fr32_vector_fill( 3, output, NUMSAMPLE_09-1);
+
+    for ( i=0; i<NUMSAMPLE_09; i++)
+    {
+        if ( output[i] != desired_09[i] )
+        {
+            printf( "test_09 NG :output[%2d] = 0x%08X but should be 0x%08X\n", i, output[i], desired_09[i] );
+            return;
+        }
+    }
+    printf ("test_09 OK\n");
+}
+
+#undef TAPS_09
+#undef NUMSAMPLE_09
+