genericopenlibs/liboil/tsrc/testsuite/ref/src/rowcoladd8x8.c
changeset 50 79045913e4e9
equal deleted inserted replaced
49:e5d77a29bdca 50:79045913e4e9
       
     1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 #ifdef HAVE_CONFIG_H
       
    19 #include "config.h"
       
    20 #endif
       
    21 
       
    22 #include <liboil/liboil.h>
       
    23 #include <liboil/liboilfunction.h>
       
    24 #include <stdio.h>
       
    25 #include <globals.h>
       
    26 
       
    27 #define LOG_FILE "c:\\logs\\testsuite_rowcoladd8x8_log.txt"
       
    28 #include "std_log_result.h"
       
    29 #define LOG_FILENAME_LINE __FILE__, __LINE__
       
    30 #define MAX_SIZE 64
       
    31 #define RES_SIZE 1
       
    32 
       
    33 void create_xml(int result)
       
    34 {
       
    35     if(result)
       
    36         assert_failed = 1;
       
    37     
       
    38     testResultXml("testsuite_rowcoladd8x8");
       
    39     close_log_file();
       
    40 }
       
    41 
       
    42 void test_colsad8x8_u8()
       
    43     {
       
    44     uint8_t arr1[MAX_SIZE],arr2[MAX_SIZE];
       
    45     uint32_t res[RES_SIZE]={0}, check[RES_SIZE]={30};
       
    46     int i;
       
    47     
       
    48     for(i=0;i<MAX_SIZE;i++)
       
    49         {
       
    50          arr1[i]=i+3;
       
    51          arr2[i]=i+1;
       
    52         }
       
    53     oil_colsad8x8_u8(res,arr1,3,arr2,2);
       
    54     
       
    55     if(res[0]==check[0])
       
    56         {
       
    57         std_log(LOG_FILENAME_LINE,"oil_colsad8x8_u8 successful, res = %d", res[0]);
       
    58         }
       
    59     else
       
    60         {
       
    61         assert_failed=1;
       
    62         std_log(LOG_FILENAME_LINE,"oil_colsad8x8_u8 unsuccessful,Expected =%d,Obtained =%d",check[0],res[0]);
       
    63         }
       
    64     }
       
    65 
       
    66 
       
    67 void test_rowsad8x8_u8()
       
    68     {
       
    69     uint8_t arr1[MAX_SIZE],arr2[MAX_SIZE];
       
    70     uint32_t res[RES_SIZE]={0}, check[RES_SIZE]={12};
       
    71     int i;
       
    72     
       
    73     for(i=0;i<MAX_SIZE;i++)
       
    74         {
       
    75          arr1[i]=i+5;
       
    76          arr2[i]=i+2;
       
    77         }
       
    78     
       
    79     oil_rowsad8x8_u8(res,arr1,arr2);
       
    80     
       
    81     if(res[0]==check[0])
       
    82         {
       
    83         std_log(LOG_FILENAME_LINE,"oil_rowsad8x8_u8 successful, res = %d", res[0]);
       
    84         }
       
    85     else
       
    86         {
       
    87         assert_failed=1;
       
    88         std_log(LOG_FILENAME_LINE,"oil_rowsad8x8_u8 unsuccessful,Expected =%d,Obtained =%d",check[0],res[0]);
       
    89         }
       
    90     }
       
    91 
       
    92 
       
    93 int main ()
       
    94 {
       
    95   std_log(LOG_FILENAME_LINE,"Test started testsuite_rowcoladd8x8");
       
    96   oil_init ();
       
    97   
       
    98   std_log(LOG_FILENAME_LINE,"oil_colsad8x8_u8");
       
    99   test_colsad8x8_u8();
       
   100   
       
   101   std_log(LOG_FILENAME_LINE,"oil_rowsad8x8_u8");
       
   102   test_rowsad8x8_u8();
       
   103     
       
   104   if(assert_failed)
       
   105          std_log(LOG_FILENAME_LINE,"Test Fail");
       
   106   else
       
   107          std_log(LOG_FILENAME_LINE,"Test Successful");
       
   108    
       
   109   create_xml(0);
       
   110   return 0;
       
   111 }
       
   112