sl@0: /* sl@0: * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: sl@0: #define LOG_FILE "c:\\logs\\testsuite_convert_log.txt" sl@0: #include "std_log_result.h" sl@0: #define LOG_FILENAME_LINE __FILE__, __LINE__ sl@0: sl@0: #define SIZE 20 sl@0: sl@0: void create_xml(int result) sl@0: { sl@0: if(result) sl@0: assert_failed = 1; sl@0: sl@0: testResultXml("testsuite_convert"); sl@0: close_log_file(); sl@0: } sl@0: sl@0: #define SIGN_BIT_8 0x80 sl@0: #define SIGN_BIT_16 0x8000 sl@0: #define SIGN_BIT_32 0x80000000 sl@0: sl@0: #define MAX_SIGNED_INT_32 0x7FFFFFFF sl@0: #define MAX_SIGNED_INT_16 0x7FFF sl@0: #define MAX_SIGNED_INT_16 0x7FFF sl@0: #define MAX_SIGNED_INT_8 0x7F sl@0: sl@0: #define MAX_UNSIGNED_INT16 0xFFFF sl@0: #define MAX_UNSIGNED_INT8 0xFF sl@0: sl@0: 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}; sl@0: 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}; sl@0: sl@0: void test_oil_convert_s16_f32() sl@0: { sl@0: int16_t output[SIZE]; sl@0: int i = 0; sl@0: sl@0: oil_convert_s16_f32(output, f32src, SIZE); sl@0: sl@0: for(i = 0; i