First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
22 #include <liboil/liboil.h>
23 #include <liboil/liboilfunction.h>
28 #define LOG_FILE "c:\\logs\\testsuite_yuv2rgb_log.txt"
29 #include "std_log_result.h"
30 #define LOG_FILENAME_LINE __FILE__, __LINE__
34 void create_xml(int result)
39 testResultXml("testsuite_yuv2rgb");
44 void test_yuv2rgbx_u8()
46 uint8_t src1[MAX_SIZE], src2[MAX_SIZE], src3[MAX_SIZE];
47 uint8_t res[RES_SIZE],check[RES_SIZE]={0,135,0,0,0,134,0,0,0,134,0,0,0,134,0,0,0,134,0,0,0,134,0,0,0,134,0,0,0,134,0,0,0,134,0,0,0,134,0,0};
50 for(i=0;i<MAX_SIZE;i++)
57 for(i=0;i<RES_SIZE;i++)
60 oil_yuv2rgbx_u8(res,src1,src2,src3,MAX_SIZE);
62 for(i=0;i<RES_SIZE;i++)
63 if(res[i] == check[i])
65 std_log(LOG_FILENAME_LINE,"oil_yuv2rgbx_u8 successful, res[%d] = %d", i,res[i]);
70 std_log(LOG_FILENAME_LINE,"oil_yuv2rgbx_u8 unsuccessful, Expected =%d,Obtained =%d",check[i],res[i]);
75 void test_yuv2rgbx_sub2_u8()
77 uint8_t src1[MAX_SIZE], src2[MAX_SIZE], src3[MAX_SIZE];
78 uint8_t res[RES_SIZE],check[RES_SIZE]={0,134,0,0,0,135,0,0,0,135,0,0,0,136,0,0,0,136,0,0,0,137,0,0,0,137,0,0,0,138,0,0,0,138,0,0,0,139,0,0};
81 for(i=0;i<MAX_SIZE;i++)
88 for(i=0;i<RES_SIZE;i++)
91 oil_yuv2rgbx_sub2_u8(res,src1,src2,src3,MAX_SIZE);
93 for(i=0;i<RES_SIZE;i++)
94 if(res[i] == check[i])
96 std_log(LOG_FILENAME_LINE,"oil_yuv2rgbx_sub2_u8 successful, res[%d] = %d", i,res[i]);
101 std_log(LOG_FILENAME_LINE,"oil_yuv2rgbx_sub2_u8 unsuccessful, Expected =%d,Obtained =%d",check[i],res[i]);
107 void test_yuv2rgbx_sub4_u8()
109 uint8_t src1[MAX_SIZE], src2[MAX_SIZE], src3[MAX_SIZE];
110 uint8_t res[RES_SIZE],check[RES_SIZE]={0,137,0,0,0,138,0,0,0,139,0,0,0,140,0,0,0,140,0,0,0,141,0,0,0,142,0,0,0,143,0,0,0,0,0,0,0,0,0,0};
113 for(i=0;i<MAX_SIZE;i++)
120 for(i=0;i<RES_SIZE;i++)
123 oil_yuv2rgbx_sub4_u8(res,src1,src2,src3,MAX_SIZE);
125 for(i=0;i<RES_SIZE;i++)
126 if(res[i] == check[i])
128 std_log(LOG_FILENAME_LINE,"oil_yuv2rgbx_sub4_u8 successful, res[%d] = %d", i,res[i]);
133 std_log(LOG_FILENAME_LINE,"oil_yuv2rgbx_sub4_u8 unsuccessful,Expected =%d,Obtained =%d",check[i],res[i]);
140 std_log(LOG_FILENAME_LINE,"Test started testsuite_yuv2rgb8x8");
143 std_log(LOG_FILENAME_LINE,"oil_yuv2rgbx_u8");
146 std_log(LOG_FILENAME_LINE,"oil_yuv2rgbx_sub2_u8");
147 test_yuv2rgbx_sub2_u8();
149 std_log(LOG_FILENAME_LINE,"oil_yuv2rgbx_sub4_u8");
150 test_yuv2rgbx_sub4_u8();
154 std_log(LOG_FILENAME_LINE,"Test Fail");
156 std_log(LOG_FILENAME_LINE,"Test Successful");