diff -r 000000000000 -r bde4ae8d615e os/ossrv/genericopenlibs/liboil/tsrc/testsuite/convert/src/convert.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/ossrv/genericopenlibs/liboil/tsrc/testsuite/convert/src/convert.c Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,1132 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include +#include +#include + +#include + +#define LOG_FILE "c:\\logs\\testsuite_convert_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + +#define SIZE 20 + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("testsuite_convert"); + close_log_file(); +} + +#define SIGN_BIT_8 0x80 +#define SIGN_BIT_16 0x8000 +#define SIGN_BIT_32 0x80000000 + +#define MAX_SIGNED_INT_32 0x7FFFFFFF +#define MAX_SIGNED_INT_16 0x7FFF +#define MAX_SIGNED_INT_16 0x7FFF +#define MAX_SIGNED_INT_8 0x7F + +#define MAX_UNSIGNED_INT16 0xFFFF +#define MAX_UNSIGNED_INT8 0xFF + +float f32src[] = {0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.0, 11.1, 12.2, 13.3, 14.4, 15.5, 16.6, 17.7, 18.8, 19.9}; +double f64src[] = {0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.0, 11.1, 12.2, 13.3, 14.4, 15.5, 16.6, 17.7, 18.8, 19.9}; + +void test_oil_convert_s16_f32() + { + int16_t output[SIZE]; + int i = 0; + + oil_convert_s16_f32(output, f32src, SIZE); + + for(i = 0; i