# HG changeset patch # User hgs # Date 1281030793 -19800 # Node ID 79045913e4e943a5cdba9500aa4d60e9089f2599 # Parent e5d77a29bdca414ee47e4c8aafe808a7b5bdc6a8 201031 diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/group/bld.inf --- a/genericopenlibs/liboil/tsrc/group/bld.inf Thu Aug 05 20:12:17 2010 +0530 +++ b/genericopenlibs/liboil/tsrc/group/bld.inf Thu Aug 05 23:23:13 2010 +0530 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-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" @@ -19,4 +19,9 @@ #include "../testsuite/group/bld.inf" #include "../examples/group/bld.inf" -#include "../testapps/group/bld.inf" \ No newline at end of file +#include "../testapps/group/bld.inf" + +PRJ_TESTEXPORTS +liboiltests.iby /epoc32/rom/include/liboiltests.iby +liboiltests_emulator.bat /epoc32/winscw/c/liboiltests_emulator.bat +liboiltests_hardware.bat /epoc32/winscw/c/liboiltests_hardware.bat \ No newline at end of file diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/group/liboil_test.pkg --- a/genericopenlibs/liboil/tsrc/group/liboil_test.pkg Thu Aug 05 20:12:17 2010 +0530 +++ b/genericopenlibs/liboil/tsrc/group/liboil_test.pkg Thu Aug 05 23:23:13 2010 +0530 @@ -1,5 +1,5 @@ ; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; 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" @@ -18,7 +18,7 @@ ; Name : liboil_test.pkg ; Part of : Liboil project ; -; Version : %version: 1 % +; Version : %version: bh1mrt#1.1.1 % ; ============================================================================ ;Languages @@ -36,39 +36,6 @@ ;Unique Vendor name :"Vendor" -"\epoc32\release\armv5\urel\liboil.dll"-"!:\sys\bin\liboil.dll" -"\epoc32\release\armv5\urel\example1.exe"-"!:\sys\bin\example1.exe" -"\epoc32\release\armv5\urel\memcpy-speed.exe"-"!:\sys\bin\memcpy-speed.exe" -"\epoc32\winscw\c\data\liboil\test.jpg"-"!:\data\liboil\test.jpg" -"\epoc32\release\armv5\urel\jpeg_test.exe"-"!:\sys\bin\jpeg_test.exe" -"\epoc32\release\armv5\urel\jpeg_rgb_test.exe"-"!:\sys\bin\jpeg_rgb_test.exe" -"\epoc32\release\armv5\urel\oil-bugreport.exe"-"!:\sys\bin\oil-bugreport.exe" -"\epoc32\release\armv5\urel\oil-mt19937.exe"-"!:\sys\bin\oil-mt19937.exe" -"\epoc32\release\armv5\urel\oil-random.exe"-"!:\sys\bin\oil-random.exe" -"\epoc32\release\armv5\urel\oil-suggest.exe"-"!:\sys\bin\oil-suggest.exe" -"\epoc32\release\armv5\urel\oil-test.exe"-"!:\sys\bin\oil-test.exe" -;"\epoc32\release\armv5\urel\printcpu.exe"-"!:\sys\bin\printcpu.exe" -"\epoc32\release\armv5\urel\test_merge_linear_argb.exe"-"!:\sys\bin\test_merge_linear_argb.exe" -"\epoc32\release\armv5\urel\test_merge_linear_u8.exe"-"!:\sys\bin\test_merge_linear_u8.exe" -"\epoc32\release\armv5\urel\test_scalarmultiply_f32_ns.exe"-"!:\sys\bin\test_scalarmultiply_f32_ns.exe" -"\epoc32\release\armv5\urel\test_splat_u8.exe"-"!:\sys\bin\test_splat_u8.exe" -"\epoc32\release\armv5\urel\test_splat_u8_ns.exe"-"!:\sys\bin\test_splat_u8_ns.exe" -"\epoc32\release\armv5\urel\testsuite_abs.exe"-"!:\sys\bin\testsuite_abs.exe" -"\epoc32\release\armv5\urel\testsuite_align.exe"-"!:\sys\bin\testsuite_align.exe" -"\epoc32\release\armv5\urel\testsuite_copy.exe"-"!:\sys\bin\testsuite_copy.exe" -"\epoc32\release\armv5\urel\testsuite_dso_check.exe"-"!:\sys\bin\testsuite_dso_check.exe" -"\epoc32\release\armv5\urel\testsuite_introspect.exe"-"!:\sys\bin\testsuite_introspect.exe" -"\epoc32\release\armv5\urel\testsuite_list_impls.exe"-"!:\sys\bin\testsuite_list_impls.exe" -"\epoc32\release\armv5\urel\testsuite_md5.exe"-"!:\sys\bin\testsuite_md5.exe" -"\epoc32\release\armv5\urel\testsuite_md5_profile.exe"-"!:\sys\bin\testsuite_md5_profile.exe" -"\epoc32\release\armv5\urel\testsuite_moo.exe"-"!:\sys\bin\testsuite_moo.exe" -"\epoc32\release\armv5\urel\testsuite_proto1.exe"-"!:\sys\bin\testsuite_proto1.exe" -"\epoc32\release\armv5\urel\testsuite_proto2.exe"-"!:\sys\bin\testsuite_proto2.exe" -"\epoc32\release\armv5\urel\testsuite_proto3.exe"-"!:\sys\bin\testsuite_proto3.exe" -"\epoc32\release\armv5\urel\testsuite_proto4.exe"-"!:\sys\bin\testsuite_proto4.exe" -"\epoc32\release\armv5\urel\testsuite_stride.exe"-"!:\sys\bin\testsuite_stride.exe" -"\epoc32\release\armv5\urel\testsuite_test1.exe"-"!:\sys\bin\testsuite_test1.exe" -"\epoc32\release\armv5\urel\testsuite_zigzag.exe"-"!:\sys\bin\testsuite_zigzag.exe" -"\epoc32\release\armv5\urel\testapps_oil_resample_linear_argb.exe"-"!:\sys\bin\testapps_oil_resample_linear_argb.exe" -"\epoc32\release\armv5\urel\testapps_oil_resample_linear_u8.exe"-"!:\sys\bin\testapps_oil_resample_linear_u8.exe" +"sf\os\ossrv\genericopenlibs\liboil\tsrc\examples\jpeg\data\test.jpg"-"C:\test.jpg" + diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/group/liboiltests.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/group/liboiltests.iby Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,79 @@ +// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Symbian Foundation License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef __LIBOILTESTS_IBY__ +#define __LIBOILTESTS_IBY__ + +#include "liboil.iby" + +file=ABI_DIR\BUILD_DIR\testsuite_dso_check.exe sys\bin\testsuite_dso_check.exe +file=ABI_DIR\BUILD_DIR\testsuite_copy.exe sys\bin\testsuite_copy.exe +file=ABI_DIR\BUILD_DIR\testsuite_abs.exe sys\bin\testsuite_abs.exe +file=ABI_DIR\BUILD_DIR\testsuite_align.exe sys\bin\testsuite_align.exe +file=ABI_DIR\BUILD_DIR\testsuite_list_impls.exe sys\bin\testsuite_list_impls.exe +file=ABI_DIR\BUILD_DIR\testsuite_md5_profile.exe sys\bin\testsuite_md5_profile.exe +file=ABI_DIR\BUILD_DIR\testsuite_md5.exe sys\bin\testsuite_md5.exe +file=ABI_DIR\BUILD_DIR\testsuite_zigzag.exe sys\bin\testsuite_zigzag.exe +file=ABI_DIR\BUILD_DIR\testsuite_moo.exe sys\bin\testsuite_moo.exe +file=ABI_DIR\BUILD_DIR\testsuite_proto1.exe sys\bin\testsuite_proto1.exe +file=ABI_DIR\BUILD_DIR\testsuite_proto2.exe sys\bin\testsuite_proto2.exe +file=ABI_DIR\BUILD_DIR\testsuite_proto4.exe sys\bin\testsuite_proto4.exe +file=ABI_DIR\BUILD_DIR\testsuite_proto3.exe sys\bin\testsuite_proto3.exe +file=ABI_DIR\BUILD_DIR\testsuite_stride.exe sys\bin\testsuite_stride.exe +file=ABI_DIR\BUILD_DIR\testsuite_test1.exe sys\bin\testsuite_test1.exe +file=ABI_DIR\BUILD_DIR\example1.exe sys\bin\example1.exe +file=ABI_DIR\BUILD_DIR\memcpy-speed.exe sys\bin\memcpy-speed.exe +file=ABI_DIR\BUILD_DIR\oil-mt19937.exe sys\bin\oil-mt19937.exe +file=ABI_DIR\BUILD_DIR\oil-bugreport.exe sys\bin\oil-bugreport.exe +file=ABI_DIR\BUILD_DIR\oil-random.exe sys\bin\oil-random.exe +file=ABI_DIR\BUILD_DIR\oil-test.exe sys\bin\oil-test.exe +file=ABI_DIR\BUILD_DIR\oil-suggest.exe sys\bin\oil-suggest.exe +file=ABI_DIR\BUILD_DIR\testsuite_introspect.exe sys\bin\testsuite_introspect.exe +file=ABI_DIR\BUILD_DIR\jpeg_rgb_test.exe sys\bin\jpeg_rgb_test.exe +file=ABI_DIR\BUILD_DIR\jpeg_test.exe sys\bin\jpeg_test.exe +file=ABI_DIR\BUILD_DIR\test_scalarmultiply_f32_ns.exe sys\bin\test_scalarmultiply_f32_ns.exe +file=ABI_DIR\BUILD_DIR\test_merge_linear_u8.exe sys\bin\test_merge_linear_u8.exe +file=ABI_DIR\BUILD_DIR\test_splat_u8_ns.exe sys\bin\test_splat_u8_ns.exe +file=ABI_DIR\BUILD_DIR\test_merge_linear_argb.exe sys\bin\test_merge_linear_argb.exe +file=ABI_DIR\BUILD_DIR\test_splat_u8.exe sys\bin\test_splat_u8.exe +file=ABI_DIR\BUILD_DIR\testapps_oil_resample_linear_argb.exe sys\bin\testapps_oil_resample_linear_argb.exe +file=ABI_DIR\BUILD_DIR\testapps_oil_resample_linear_u8.exe sys\bin\testapps_oil_resample_linear_u8.exe + +file=ABI_DIR\BUILD_DIR\testsuite_copyptr.exe sys\bin\testsuite_copyptr.exe +file=ABI_DIR\BUILD_DIR\testsuite_diff.exe sys\bin\testsuite_diff.exe +file=ABI_DIR\BUILD_DIR\testsuite_misc8x8.exe sys\bin\testsuite_misc8x8.exe +file=ABI_DIR\BUILD_DIR\testsuite_yuv2rgb.exe sys\bin\testsuite_yuv2rgb.exe +file=ABI_DIR\BUILD_DIR\testsuite_math.exe sys\bin\testsuite_math.exe +file=ABI_DIR\BUILD_DIR\testsuite_err8x8.exe sys\bin\testsuite_err8x8.exe +file=ABI_DIR\BUILD_DIR\testsuite_sad8x8.exe sys\bin\testsuite_sad8x8.exe +file=ABI_DIR\BUILD_DIR\testsuite_recon8x8.exe sys\bin\testsuite_recon8x8.exe +file=ABI_DIR\BUILD_DIR\testsuite_mult8x8.exe sys\bin\testsuite_mult8x8.exe +file=ABI_DIR\BUILD_DIR\testsuite_rowcoladd8x8.exe sys\bin\testsuite_rowcoladd8x8.exe +file=ABI_DIR\BUILD_DIR\testsuite_splat.exe sys\bin\testsuite_splat.exe +file=ABI_DIR\BUILD_DIR\testsuite_convert.exe sys\bin\testsuite_convert.exe +file=ABI_DIR\BUILD_DIR\testsuite_composite.exe sys\bin\testsuite_composite.exe +file=ABI_DIR\BUILD_DIR\testsuite_mas.exe sys\bin\testsuite_mas.exe +file=ABI_DIR\BUILD_DIR\testsuite_wavelet.exe sys\bin\testsuite_wavelet.exe +file=ABI_DIR\BUILD_DIR\testsuite_dct.exe sys\bin\testsuite_dct.exe +file=ABI_DIR\BUILD_DIR\testsuite_debug.exe sys\bin\testsuite_debug.exe +file=ABI_DIR\BUILD_DIR\testsuite_function.exe sys\bin\testsuite_function.exe +file=ABI_DIR\BUILD_DIR\testsuite_liboiltest.exe sys\bin\testsuite_liboiltest.exe +file=ABI_DIR\BUILD_DIR\testsuite_random.exe sys\bin\testsuite_random.exe +file=ABI_DIR\BUILD_DIR\testsuite_swab.exe sys\bin\testsuite_swab.exe +file=ABI_DIR\BUILD_DIR\testsuite_trans8x8.exe sys\bin\testsuite_trans8x8.exe +file=ABI_DIR\BUILD_DIR\testsuite_clamp1.exe sys\bin\testsuite_clamp1.exe + +data = \epoc32\winscw\c\liboiltests_hardware.bat \liboiltests_hardware.bat +#endif diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/group/liboiltests_emulator.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/group/liboiltests_emulator.bat Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,75 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +testsuite_dso_check.exe +testsuite_copy.exe +testsuite_abs.exe +testsuite_align.exe +testsuite_list_impls.exe +testsuite_md5_profile.exe +testsuite_md5.exe +testsuite_zigzag.exe +testsuite_moo.exe +testsuite_proto1.exe +testsuite_proto2.exe +testsuite_proto4.exe +testsuite_proto3.exe +testsuite_stride.exe +testsuite_test1.exe +example1.exe +memcpy-speed.exe +oil-mt19937.exe +oil-bugreport.exe +oil-random.exe +oil-test.exe abs_f32_f32 +oil-suggest.exe +testsuite_introspect.exe +jpeg_rgb_test.exe c:\test.jpg +test_scalarmultiply_f32_ns.exe +test_merge_linear_u8.exe +test_splat_u8_ns.exe +test_merge_linear_argb.exe +test_splat_u8.exe +testapps_oil_resample_linear_argb.exe +testapps_oil_resample_linear_u8.exe +jpeg_test.exe c:\test.jpg + + +testsuite_copyptr.exe +testsuite_diff.exe +testsuite_misc8x8.exe +testsuite_yuv2rgb.exe +testsuite_math.exe +testsuite_err8x8.exe +testsuite_sad8x8.exe +testsuite_recon8x8.exe +testsuite_mult8x8.exe +testsuite_rowcoladd8x8.exe +testsuite_splat.exe + +testsuite_convert.exe +testsuite_composite.exe +testsuite_mas.exe +testsuite_wavelet.exe +testsuite_dct.exe +testsuite_debug.exe +testsuite_function.exe +testsuite_liboiltest.exe +testsuite_random.exe +testsuite_swab.exe +testsuite_trans8x8.exe + +testsuite_clamp1.exe \ No newline at end of file diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/group/liboiltests_hardware.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/group/liboiltests_hardware.bat Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,75 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +testsuite_dso_check.exe +testsuite_copy.exe +testsuite_abs.exe +testsuite_align.exe +testsuite_list_impls.exe +testsuite_md5_profile.exe +testsuite_md5.exe +testsuite_zigzag.exe +testsuite_moo.exe +testsuite_proto1.exe +testsuite_proto2.exe +testsuite_proto4.exe +testsuite_proto3.exe +testsuite_stride.exe +testsuite_test1.exe +example1.exe +memcpy-speed.exe +oil-mt19937.exe +oil-bugreport.exe +oil-random.exe +oil-test.exe abs_f32_f32 +oil-suggest.exe +testsuite_introspect.exe +jpeg_rgb_test.exe c:\test.jpg +test_scalarmultiply_f32_ns.exe +test_merge_linear_u8.exe +test_splat_u8_ns.exe +test_merge_linear_argb.exe +test_splat_u8.exe +testapps_oil_resample_linear_argb.exe +testapps_oil_resample_linear_u8.exe +jpeg_test.exe c:\test.jpg + + +testsuite_copyptr.exe +testsuite_diff.exe +testsuite_misc8x8.exe +testsuite_yuv2rgb.exe +testsuite_math.exe +testsuite_err8x8.exe +testsuite_sad8x8.exe +testsuite_recon8x8.exe +testsuite_mult8x8.exe +testsuite_rowcoladd8x8.exe +testsuite_splat.exe + +testsuite_convert.exe +testsuite_composite.exe +testsuite_mas.exe +testsuite_wavelet.exe +testsuite_dct.exe +testsuite_debug.exe +testsuite_function.exe +testsuite_liboiltest.exe +testsuite_random.exe +testsuite_swab.exe +testsuite_trans8x8.exe + +testsuite_clamp1.exe \ No newline at end of file diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/group/test.xml --- a/genericopenlibs/liboil/tsrc/group/test.xml Thu Aug 05 20:12:17 2010 +0530 +++ b/genericopenlibs/liboil/tsrc/group/test.xml Thu Aug 05 23:23:13 2010 +0530 @@ -8,52 +8,12 @@ - - + + - - - - - - - - - - install - - - - - - - install-software - - - - - - - - - - - - - - - - - - - - - @@ -1135,11 +1095,810 @@ + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + fetch-log + + + + + + + + - ATS3Drop/sis/liboil.sisx ATS3Drop/general/test.jpg ATS3Drop/armv5_urel/testsuite_abs.exe ATS3Drop/armv5_urel/testsuite_align.exe @@ -1174,21 +1933,30 @@ ATS3Drop/armv5_urel/test_splat_u8_ns.exe ATS3Drop/armv5_urel/testapps_oil_resample_linear_u8.exe ATS3Drop/armv5_urel/testapps_oil_resample_linear_argb.exe - - + ATS3Drop/armv5_urel/testsuite_copyptr.exe + ATS3Drop/armv5_urel/testsuite_diff.exe + ATS3Drop/armv5_urel/testsuite_misc8x8.exe + ATS3Drop/armv5_urel/testsuite_yuv2rgb.exe + ATS3Drop/armv5_urel/testsuite_math.exe + ATS3Drop/armv5_urel/testsuite_err8x8.exe + ATS3Drop/armv5_urel/testsuite_sad8x8.exe + ATS3Drop/armv5_urel/testsuite_recon8x8.exe + ATS3Drop/armv5_urel/testsuite_mult8x8.exe + ATS3Drop/armv5_urel/testsuite_rowcoladd8x8.exe + ATS3Drop/armv5_urel/testsuite_splat.exe + ATS3Drop/armv5_urel/testsuite_convert.exe + ATS3Drop/armv5_urel/testsuite_composite.exe + ATS3Drop/armv5_urel/testsuite_mas.exe + ATS3Drop/armv5_urel/testsuite_wavelet.exe + ATS3Drop/armv5_urel/testsuite_dct.exe + ATS3Drop/armv5_urel/testsuite_debug.exe + ATS3Drop/armv5_urel/testsuite_function.exe + ATS3Drop/armv5_urel/testsuite_liboiltest.exe + ATS3Drop/armv5_urel/testsuite_random.exe + ATS3Drop/armv5_urel/testsuite_swab.exe + ATS3Drop/armv5_urel/testsuite_trans8x8.exe + ATS3Drop/armv5_urel/testsuite_clamp1.exe + - - SendEmailAction - - - - - - - - diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/inc/utils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/inc/utils.h Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,67 @@ +/* +* 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: +* +*/ + + + +#ifndef _UTILS_H__ +#define _UTILS_H__ + +#include + +#define LEN 15 + +int comparefloats(double symbian_op, double linux_op) + { + double fractpart1=0, intpart1=0, fractpart2=0, intpart2=0; + int ret = 0; + char str_int1[LEN+1] = "\0"; + char str_fract1[LEN+1+2] = "\0"; + char str_fract2[LEN+1+2] = "\0"; + char format_str[10] = "\0"; + int len1=0, len_to_comp=0; + + if((symbian_op < 0) && (linux_op < 0)) + { + symbian_op = symbian_op * -1; + linux_op = linux_op * -1; + } + + fractpart1 = modf(symbian_op, &intpart1); + fractpart2 = modf(linux_op, &intpart2); + + if(intpart1 == intpart2) + { + sprintf(str_int1, "%d", (int)intpart1); + len1 = strlen(str_int1); + + len_to_comp = LEN - len1; + sprintf(format_str, "%s%d%s", "%0.", len_to_comp, "f"); + + sprintf(str_fract1, format_str, fractpart1); + sprintf(str_fract2, format_str, fractpart2); + + if(strcmp(str_fract1, str_fract2) != 0) + ret = 1; + } + else + ret = 1; + + return ret; + } + +#endif //_UTILS_H__ + diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/clamp1/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/clamp1/group/bld.inf Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,19 @@ +// 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: +// + + + +PRJ_TESTMMPFILES +clamp1.mmp diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/clamp1/group/clamp1.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/clamp1/group/clamp1.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,47 @@ +// 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: +// +//clamp1.mmp + + +TARGET testsuite_clamp1.exe +TARGETTYPE exe +UID 0 0xE100000E + +#ifdef EKA2 +LANG SC +CAPABILITY All -Tcb +//VENDORID VID_DEFAULT +#endif + +SYSTEMINCLUDE /epoc32/include +SYSTEMINCLUDE /epoc32/include/stdapis +SYSTEMINCLUDE /epoc32/include/stdapis/liboil + +USERINCLUDE ../../../inc + +MACRO OIL_ENABLE_UNSTABLE_API + +USERINCLUDE ../inc +SOURCEPATH ../src +SOURCE clamp1.c + +LIBRARY liboil.lib +LIBRARY euser.lib +LIBRARY libc.lib +LIBRARY libm.lib + +STATICLIBRARY libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/clamp1/group/clamp1.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/clamp1/group/clamp1.pkg Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,31 @@ +// 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: +// + +;Languages +&EN + +;Header +#{"clamp1.pkg"},(0x0AC240C0),1,0,0 + +;Supports S60 3.0 +[0x101F7961], 0, 0, 0, {"S60ProductID"} + +;Localised Vendor name +%{"Nokia Testing EN"} + +;Unique Vendor name +:"Vendor" + +"\epoc32\release\armv5\urel\testsuite_clamp1.exe"-"c:\sys\bin\testsuite_clamp1.exe" \ No newline at end of file diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/composite/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/composite/group/bld.inf Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,23 @@ +/* +* 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: +* +*/ + + + +PRJ_TESTMMPFILES + + +composite.mmp diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/composite/group/composite.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/composite/group/composite.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,49 @@ +/* +* 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: +* +*/ + + +TARGET testsuite_composite.exe +TARGETTYPE exe +UID 0 0x20032345 + +#ifdef EKA2 +LANG SC +CAPABILITY All -Tcb +//VENDORID VID_DEFAULT +#endif + +SYSTEMINCLUDE /epoc32/include +SYSTEMINCLUDE /epoc32/include/stdapis +SYSTEMINCLUDE /epoc32/include/stdapis/liboil + +USERINCLUDE ../../../inc + +MACRO OIL_ENABLE_UNSTABLE_API + +USERINCLUDE ../inc +SOURCEPATH ../src + +SOURCE composite.c + +LIBRARY liboil.lib +LIBRARY euser.lib +LIBRARY libc.lib +LIBRARY libm.lib + +STATICLIBRARY libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/composite/group/composite.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/composite/group/composite.pkg Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,32 @@ +; +; 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: +; + +;Languages +&EN + +;Header +#{"composite.pkg"},(0x20032345),1,0,0 + +;Supports S60 3.0 +[0x101F7961], 0, 0, 0, {"S60ProductID"} + +;Localised Vendor name +%{"Nokia Testing EN"} + +;Unique Vendor name +:"Vendor" + +"\epoc32\release\armv5\urel\testsuite_composite.exe"-"c:\sys\bin\testsuite_composite.exe" \ No newline at end of file diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/convert/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/convert/group/bld.inf Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,23 @@ +/* +* 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: +* +*/ + + + +PRJ_TESTMMPFILES + + +convert.mmp diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/convert/group/convert.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/convert/group/convert.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,50 @@ +/* +* 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: +* +*/ +//convert.mmp + + +TARGET testsuite_convert.exe +TARGETTYPE exe +UID 0 0x20032346 + +#ifdef EKA2 +LANG SC +CAPABILITY All -Tcb +//VENDORID VID_DEFAULT +#endif + +SYSTEMINCLUDE /epoc32/include +SYSTEMINCLUDE /epoc32/include/stdapis +SYSTEMINCLUDE /epoc32/include/stdapis/liboil + +USERINCLUDE ../../../inc + +MACRO OIL_ENABLE_UNSTABLE_API + +USERINCLUDE ../inc +SOURCEPATH ../src + +SOURCE convert.c + +LIBRARY liboil.lib +LIBRARY euser.lib +LIBRARY libc.lib +LIBRARY libm.lib + +STATICLIBRARY libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/convert/group/convert.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/convert/group/convert.pkg Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,32 @@ +; +; 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: +; + +;Languages +&EN + +;Header +#{"convert.pkg"},(0x20032346),1,0,0 + +;Supports S60 3.0 +[0x101F7961], 0, 0, 0, {"S60ProductID"} + +;Localised Vendor name +%{"Nokia Testing EN"} + +;Unique Vendor name +:"Vendor" + +"\epoc32\release\armv5\urel\testsuite_convert.exe"-"c:\sys\bin\testsuite_convert.exe" \ No newline at end of file diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/copy/group/bld.inf --- a/genericopenlibs/liboil/tsrc/testsuite/copy/group/bld.inf Thu Aug 05 20:12:17 2010 +0530 +++ b/genericopenlibs/liboil/tsrc/testsuite/copy/group/bld.inf Thu Aug 05 23:23:13 2010 +0530 @@ -1,23 +1,22 @@ -/* -* Copyright (c) 2008 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: -* -*/ +// 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: +// + PRJ_TESTMMPFILES - copy.mmp +copy_ptr.mmp diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/copy/group/copy.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/copy/group/copy.pkg Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,32 @@ +; +; Copyright (c) 2002-2006 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: +; + +;Languages +&EN + +;Header +#{"copy.pkg"},(0x0AC240C2),1,0,0 + +;Supports S60 3.0 +[0x101F7961], 0, 0, 0, {"S60ProductID"} + +;Localised Vendor name +%{"Nokia Testing EN"} + +;Unique Vendor name +:"Vendor" + +"\epoc32\release\armv5\urel\testsuite_copy.exe"-"c:\sys\bin\testsuite_copy.exe" \ No newline at end of file diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/copy/group/copy_ptr.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/copy/group/copy_ptr.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,48 @@ +// 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: +// +//copy_ptr.mmp + + +TARGET testsuite_copyptr.exe +TARGETTYPE exe +UID 0x1000008d 0xe0000007 + +#ifdef EKA2 +LANG SC +CAPABILITY All -Tcb +//VENDORID VID_DEFAULT +#endif + +SYSTEMINCLUDE /epoc32/include/stdapis/liboil +SYSTEMINCLUDE /epoc32/include/stdapis +SYSTEMINCLUDE /epoc32/include + +USERINCLUDE ../../../inc +MACRO OIL_ENABLE_UNSTABLE_API + +USERINCLUDE ../inc +SOURCEPATH ../src +SOURCE copy_ptr.c + +LIBRARY liboil.lib +LIBRARY euser.lib +LIBRARY libc.lib +LIBRARY libm.lib + +STATICLIBRARY libcrt0.lib + +SMPSAFE + + diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/copy/group/copy_ptr.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/copy/group/copy_ptr.pkg Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,32 @@ +; +; Copyright (c) 2002-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: +; + +;Languages +&EN + +;Header +#{"copyptr.pkg"},(0xe0000007),1,0,0 + +;Supports S60 3.0 +[0x101F7961], 0, 0, 0, {"S60ProductID"} + +;Localised Vendor name +%{"Nokia Testing EN"} + +;Unique Vendor name +:"Vendor" + +"\epoc32\release\armv5\urel\testsuite_copyptr.exe"-"c:\sys\bin\testsuite_copyptr.exe" \ No newline at end of file diff -r e5d77a29bdca -r 79045913e4e9 genericopenlibs/liboil/tsrc/testsuite/copy/src/copy_ptr.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/liboil/tsrc/testsuite/copy/src/copy_ptr.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,179 @@ +// 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: +// + + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include + +#define LOG_FILE "c:\\logs\\testsuite_copyptr_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ +#define MAX_SIZE 64 +#define RES_SIZE 1 +#define SIZE 10 + + +uint8_t src1[MAX_SIZE], src2[MAX_SIZE]; + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("testsuite_copyptr"); + close_log_file(); +} + + +void test_copy_u8() +{ + uint8_t src[SIZE],dest[SIZE],check[SIZE]={0,0,0,1,2,3,4,5,0,0}; + int i; + + for(i=0;i +#include +#include +#include +#include + +#define LOG_FILE "c:\\logs\\testsuite_diff_log.txt" +#include "std_log_result.h" +#include "utils.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + +#define RES_SIZE 1 +#define MAX_SIZE 64 +#define MAX_SIZE1 10 +#define MAX_SIZE2 15 + + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("testsuite_diff"); + close_log_file(); +} + + +void test_average_s16_u8(void) +{ + int i; + int16_t dest[MAX_SIZE]; + uint8_t src1[MAX_SIZE],src2[MAX_SIZE], src3[MAX_SIZE]; + int16_t check[MAX_SIZE] = {0,2,3,5,6,8,9,11,5,6,8,9,11,12,14,15,9,11,12,14,15,17,18,20,14,15,17,18,20,21,23,24,18,20,21,23,24,26,27,29,23,24,26,27,29,30,32,33,27,29,30,32,33,35,36,38,32,33,35,36,38,39,41,42}; + for(i=0;i +#include +#include +#include +#include + +#define LOG_FILE "c:\\logs\\testsuite_misc8x8_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ +#define MAX_SIZE 64 + + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("testsuite_misc8x8"); + close_log_file(); +} + +void test_clipconv8x8_u8_s16() + { + int16_t arr[MAX_SIZE]; + uint8_t res[MAX_SIZE], check[MAX_SIZE]={2,4,6,4,6,8,6,8,10,8,10,12,10,12,14,12,14,16,14,16,18,16,18,20,22,24,26,28,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + int i; + + for(i=0;i +#include +#include +#include +#include + +#define LOG_FILE "c:\\logs\\testsuite_yuv2rgb_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ +#define MAX_SIZE 10 +#define RES_SIZE 40 + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("testsuite_yuv2rgb"); + close_log_file(); +} + + +void test_yuv2rgbx_u8() + { + uint8_t src1[MAX_SIZE], src2[MAX_SIZE], src3[MAX_SIZE]; + 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}; + int i; + + for(i=0;i +#include +#include +#include +#include + +#define LOG_FILE "c:\\logs\\testsuite_math_log.txt" +#include "std_log_result.h" +#include "utils.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ +#define MAX_SIZE 10 +#define MAX_SIZE1 8 +#define MAX_DSIZE 5 + +int16_t arr1[MAX_SIZE], arr2[MAX_SIZE], res1[MAX_SIZE]; +uint8_t uarr1[MAX_SIZE],uarr2[MAX_SIZE1],uarr3[MAX_SIZE1], ures1[MAX_SIZE1]; +float farr1[MAX_SIZE1], farr2[MAX_SIZE1],fres1[MAX_SIZE1]; +double darr1[MAX_DSIZE], darr2[MAX_DSIZE],dres1[MAX_DSIZE]; + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("testsuite_math"); + close_log_file(); +} + +void test_add_s16() + { + int i; + int16_t check[MAX_SIZE]={8,13,18,23,28,33,38,43,48,53}; + for(i=0;i +#include +#include +#include +#include + +#define LOG_FILE "c:\\logs\\testsuite_err8x8_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ +#define MAX_SIZE 64 +#define RES_SIZE 1 + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("testsuite_err8x8"); + close_log_file(); +} + + +void test_err_intra8x8_u8() + { + uint8_t err1[MAX_SIZE]; + uint32_t res[RES_SIZE]={0}, check[RES_SIZE]={967680}; + int i; + + for(i=0;i +#include +#include +#include +#include + +#define LOG_FILE "c:\\logs\\testsuite_mult8x8_log.txt" +#include "std_log_result.h" +#include "utils.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ +#define MAX_SIZE 64 +#define MAX_SIZE1 10 +#define RES_SIZE 1 + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("testsuite_mult8x8"); + close_log_file(); +} + + +void test_mult8x8_s16() + { + int i; + int16_t mult1[MAX_SIZE],mult2[MAX_SIZE],res[MAX_SIZE],check[MAX_SIZE]={2,16,42,80,108,130,154,180,208,238,14,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + + for(i=0;i +#include +#include +#include +#include + +#define LOG_FILE "c:\\logs\\testsuite_recon8x8_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ +#define MAX_SIZE 64 + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("testsuite_recon8x8"); + close_log_file(); +} + +void test_recon8x8_intra() + { + int16_t src[MAX_SIZE]; + uint8_t dest[MAX_SIZE],check[MAX_SIZE]={138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201}; + int i; + + for(i=0;i +#include +#include +#include + +#define LOG_FILE "c:\\logs\\testsuite_rowcoladd8x8_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ +#define MAX_SIZE 64 +#define RES_SIZE 1 + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("testsuite_rowcoladd8x8"); + close_log_file(); +} + +void test_colsad8x8_u8() + { + uint8_t arr1[MAX_SIZE],arr2[MAX_SIZE]; + uint32_t res[RES_SIZE]={0}, check[RES_SIZE]={30}; + int i; + + for(i=0;i +#include +#include +#include + +#define LOG_FILE "c:\\logs\\testsuite_sad8x8_log.txt" +#include "std_log_result.h" +#include "utils.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ +#define MAX_SIZE 144 +#define MAX_SIZE1 256 +#define MAX_SIZE2 64 +#define RES_SIZE 1 + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("testsuite_sad8x8"); + close_log_file(); +} + + +void test_sad12xn_u8() + { + int i; + uint8_t sad1[MAX_SIZE],sad2[MAX_SIZE]; + uint32_t result[RES_SIZE]={0}, check_res=3168; + + for(i=0;i +#include +#include +#include +#include + +#define LOG_FILE "c:\\logs\\testsuite_splat_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ +#define MAX_SIZE 10 +#define SIZE 1 + + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("testsuite_splat"); + close_log_file(); +} + +void test_splat_u16_ns() + { + int i; + uint16_t sp1[SIZE]={10},res[MAX_SIZE]; + uint16_t check[MAX_SIZE]={10,10,10,10,10,10,10,10,10,10}; + + for(i=0;iPreferredBufSize(); + TEST(bufSize==0); + INFO_PRINTF2(_L("Val of Preferred buffer size %d"), bufSize); + INFO_PRINTF1(_L("Testing default constructor of TDataTypeWithPriority")); + TDataTypeWithPriority dataTypeWithPriority = TDataTypeWithPriority(); CleanupStack::PopAndDestroy(confAndMimeDataRec); } @@ -306,7 +312,13 @@ } CleanupStack::PopAndDestroy(1); // tmpListOfRecogniszers - + + //New test + INFO_PRINTF1(_L("Testing index([]) operator")); + const CApaScanningDataRecognizer::TRecognizer& testDataRecognizer=(*iRecognizer)[0]; + TUid uid1 = testDataRecognizer.iUid; + TUid uid2 = ((*iRecognizer)[0]).iUid; + TEST(uid1==uid2); //for testing ecom style plugin INFO_PRINTF1(_L("Testing the ecom style TTESTECOMDATAREC recognizer is loaded or not")); CApaScanningDataRecognizer::TRecognizer testEcomDataRecognizer; @@ -486,7 +498,6 @@ CleanupStack::PopAndDestroy(buf); // buf delete iRecognizer; - iRecongnizer = 0; } CT_MimeStep::~CT_MimeStep() diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/app_name.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/app_name.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 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 +target app_name.exe +targettype exe + +UID 0 0x0AC240C0 + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests + +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude .. ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +source app-name.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/array_test1.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/array_test1.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 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 +target array1_test.exe +targettype exe + +UID 0 0x0AC240C1 + + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude .. ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +SOURCE array-test1.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE + + diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/array_test2.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/array_test2.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 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 +target array2_test.exe +targettype exe + +UID 0 0x0AC240C2 + + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude .. ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +SOURCE array-test2.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE + + + diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/at_exit.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/at_exit.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 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 +target at_exit.exe +targettype exe + +UID 0 0x0AC240C4 + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests + +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude .. ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +source at-exit.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/base_name.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/base_name.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 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 +target base_name.exe +targettype exe + +UID 0 0x0AC240C5 + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests + +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude .. ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +source base-name.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/bld.inf --- a/glib/build/symbian/tests/group/bld.inf Thu Aug 05 20:12:17 2010 +0530 +++ b/glib/build/symbian/tests/group/bld.inf Thu Aug 05 23:23:13 2010 +0530 @@ -95,3 +95,17 @@ utf8_pointer.mmp utf8_validate.mmp +array_test1.mmp +array_test2.mmp +app_name.mmp +at_exit.mmp +base_name.mmp +bookmarkfile_test1.mmp +list_env.mmp +majorversion_test.mmp +nullify_ptr.mmp +test_utils.mmp +unichar_test.mmp +uri_funcs.mmp +utf8_string.mmp + diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/bookmarkfile_test1.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/bookmarkfile_test1.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,52 @@ +// 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: +// + + +MACRO __SYMBIAN32__ + +#include +target bookmarkfile_test1.exe +targettype exe + +UID 0 0x0AC240C6 + + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests + +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +source bookmarkfile-test1.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/glibtests.iby --- a/glib/build/symbian/tests/group/glibtests.iby Thu Aug 05 20:12:17 2010 +0530 +++ b/glib/build/symbian/tests/group/glibtests.iby Thu Aug 05 23:23:13 2010 +0530 @@ -29,6 +29,7 @@ data=ZDRIVE\NormalizationTest.txt \NormalizationTest.txt data=ZDRIVE\4096-random-bytes \4096-random-bytes data=ZDRIVE\valid-01.xbel \valid-01.xbel +data=ZDRIVE\valid-01.xbel \Private\e00000e6\file.xbel //batch file data=\epoc32\winscw\c\testglib_hardware.bat \testglib_hardware.bat @@ -127,3 +128,59 @@ file=ABI_DIR\BUILD_DIR\utf8_validate.exe \sys\bin\utf8_validate.exe +file=ABI_DIR\BUILD_DIR\array1_test.exe \sys\bin\array1_test.exe +file=ABI_DIR\BUILD_DIR\array2_test.exe \sys\bin\array2_test.exe +file=ABI_DIR\BUILD_DIR\app_name.exe \sys\bin\app_name.exe +file=ABI_DIR\BUILD_DIR\at_exit.exe \sys\bin\at_exit.exe +file=ABI_DIR\BUILD_DIR\base_name.exe \sys\bin\base_name.exe +file=ABI_DIR\BUILD_DIR\bookmarkfile_test1.exe \sys\bin\bookmarkfile_test1.exe +file=ABI_DIR\BUILD_DIR\list_env.exe \sys\bin\list_env.exe +file=ABI_DIR\BUILD_DIR\majorversion_test.exe \sys\bin\majorversion_test.exe +file=ABI_DIR\BUILD_DIR\nullity_ptr.exe \sys\bin\nullity_ptr.exe +file=ABI_DIR\BUILD_DIR\test_utils.exe \sys\bin\test_utils.exe +file=ABI_DIR\BUILD_DIR\unichar_test.exe \sys\bin\unichar_test.exe +file=ABI_DIR\BUILD_DIR\uri_funcs.exe \sys\bin\uri_funcs.exe +file=ABI_DIR\BUILD_DIR\utf8_string.exe \sys\bin\utf8_string.exe + + +//BC executables +file=ABI_DIR\BUILD_DIR\tutf8.exe \sys\bin\tutf8.exe +file=ABI_DIR\BUILD_DIR\tnode.exe \sys\bin\tnode.exe +file=ABI_DIR\BUILD_DIR\tunichar.exe \sys\bin\tunichar.exe +file=ABI_DIR\BUILD_DIR\tmisc.exe \sys\bin\tmisc.exe +file=ABI_DIR\BUILD_DIR\tslist.exe \sys\bin\tslist.exe +file=ABI_DIR\BUILD_DIR\ttrash.exe \sys\bin\ttrash.exe +file=ABI_DIR\BUILD_DIR\ttree.exe \sys\bin\ttree.exe +file=ABI_DIR\BUILD_DIR\tmanual.exe \sys\bin\tmanual.exe +file=ABI_DIR\BUILD_DIR\tgstring.exe \sys\bin\tgstring.exe +file=ABI_DIR\BUILD_DIR\tscanner.exe \sys\bin\tscanner.exe +file=ABI_DIR\BUILD_DIR\toption.exe \sys\bin\toption.exe +file=ABI_DIR\BUILD_DIR\tthread.exe \sys\bin\tthread.exe +file=ABI_DIR\BUILD_DIR\tasyncqueue.exe \sys\bin\tasyncqueue.exe +file=ABI_DIR\BUILD_DIR\closure-marshal.exe \sys\bin\marshal.exe +file=ABI_DIR\BUILD_DIR\paramspec-test.exe \sys\bin\paramspec-test.exe +file=ABI_DIR\BUILD_DIR\asyncqueue-test.exe \sys\bin\asyncqueue-test.exe +file=ABI_DIR\BUILD_DIR\utf8-pointer.exe \sys\bin\utf8-pointer.exe +file=ABI_DIR\BUILD_DIR\extra_tests.exe \sys\bin\extra_tests.exe +file=ABI_DIR\BUILD_DIR\unichar_test.exe \sys\bin\unichar_test.exe +file=ABI_DIR\BUILD_DIR\child-test1.exe \sys\bin\child-test1.exe +file=ABI_DIR\BUILD_DIR\child-test2.exe \sys\bin\child-test2.exe +file=ABI_DIR\BUILD_DIR\option-test.exe \sys\bin\option-test.exe +file=ABI_DIR\BUILD_DIR\printf-test.exe \sys\bin\printf-test.exe +file=ABI_DIR\BUILD_DIR\string-test.exe \sys\bin\string-test.exe +file=ABI_DIR\BUILD_DIR\strtod-test.exe \sys\bin\strtod-test.exe +file=ABI_DIR\BUILD_DIR\gvalue-test.exe \sys\bin\gvalue-test.exe +file=ABI_DIR\BUILD_DIR\byte_array_test.exe \sys\bin\byte_array_test.exe +file=ABI_DIR\BUILD_DIR\dir_test.exe \sys\bin\dir_test.exe +file=ABI_DIR\BUILD_DIR\misc_test.exe \sys\bin\misc_test.exe +file=ABI_DIR\BUILD_DIR\cache_test.exe \sys\bin\cache_test.exe +file=ABI_DIR\BUILD_DIR\dataset_test.exe \sys\bin\dataset_test.exe +file=ABI_DIR\BUILD_DIR\keyfile_test.exe \sys\bin\keyfile_test.exe +file=ABI_DIR\BUILD_DIR\mem_test.exe \sys\bin\mem_test.exe +file=ABI_DIR\BUILD_DIR\datalist_test.exe \sys\bin\datalist_test.exe +file=ABI_DIR\BUILD_DIR\hook_test.exe \sys\bin\hook_test.exe +file=ABI_DIR\BUILD_DIR\log_test.exe \sys\bin\log_test.exe +file=ABI_DIR\BUILD_DIR\main_loop_test.exe \sys\bin\main_loop_test.exe +file=ABI_DIR\BUILD_DIR\mem_profile_test.exe \sys\bin\mem_profile_test.exe +file=ABI_DIR\BUILD_DIR\g_test1.exe \sys\bin\g_test1.exe +file=ABI_DIR\BUILD_DIR\g_test2.exe \sys\bin\g_test2.exe diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/list_env.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/list_env.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 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 +target list_env.exe +targettype exe + +UID 0 0x0AC240C7 + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests + +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude .. ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +source list-env.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/majorversion_test.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/majorversion_test.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,52 @@ +// 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: +// + + +MACRO __SYMBIAN32__ + +#include +target majorversion_test.exe +targettype exe + +UID 0 0x0AC240C8 + + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests + +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +source majorversion-test.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/nullify_ptr.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/nullify_ptr.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 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 +target nullify_ptr.exe +targettype exe + +UID 0 0x0AB23DD0 + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests + +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude .. ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +source nullify-ptr.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/test_utils.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/test_utils.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 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 +target test_utils.exe +targettype exe + +UID 0 0x0AB23DD1 + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests + +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude .. ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +source test-utils.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/testglib_emulator.bat --- a/glib/build/symbian/tests/group/testglib_emulator.bat Thu Aug 05 20:12:17 2010 +0530 +++ b/glib/build/symbian/tests/group/testglib_emulator.bat Thu Aug 05 23:23:13 2010 +0530 @@ -103,3 +103,60 @@ asyncqueue_test.exe array_test.exe accumulator.exe + +// newly added exes +array1_test.exe +array2_test.exe +app_name.exe +at_exit.exe +base_name.exe +bookmarkfile_test1.exe c:\valid-01.xbel +list_env.exe +majorversion_test.exe +nullify_ptr.exe +test_utils.exe +utf8_string.exe +uri_funcs.exe +unichar_test.exe + +//from BC +tutf8.exe +tnode.exe +tunichar.exe +tmisc.exe +tslist.exe +ttrash.exe +ttree.exe +tmanual.exe +tgstring.exe +tscanner.exe +toption.exe +tthread.exe +tasyncqueue.exe +closure-marshal.exe +paramspec-test.exe +asyncqueue-test.exe +utf8-pointer.exe +extra_tests.exe +child-test1.exe +child-test2.exe +option-test.exe +printf-test.exe +string-test.exe +strtod-test.exe +gvalue-test.exe +byte_array_test.exe +dir_test.exe +misc_test.exe +cache_test.exe +dataset_test.exe +keyfile_test.exe +mem_test.exe +datalist_test.exe +hook_test.exe +log_test.exe +main_loop_test.exe +mem_profile_test.exe +g_test1.exe +g_test2.exe +helloworld.exe \ No newline at end of file diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/testglib_hardware.bat --- a/glib/build/symbian/tests/group/testglib_hardware.bat Thu Aug 05 20:12:17 2010 +0530 +++ b/glib/build/symbian/tests/group/testglib_hardware.bat Thu Aug 05 23:23:13 2010 +0530 @@ -22,6 +22,7 @@ copy z:\collate-1.unicode c:\ copy z:\NormalizationTest.txt c:\ copy z:\4096-random-bytes c:\ +copy z:\valid-01.xbel c:\ utf8_validate.exe utf8_pointer.exe @@ -112,3 +113,61 @@ asyncqueue_test.exe array_test.exe accumulator.exe + +//newly added exes +array1_test.exe +array2_test.exe +app_name.exe +at_exit.exe +base_name.exe +bookmarkfile_test1.exe c:\valid-01.xbel +list_env.exe +majorversion_test.exe +nullify_ptr.exe +test_utils.exe +utf8_string.exe +uri_funcs.exe +unichar_test.exe + +//from BC +tutf8.exe +tnode.exe +tunichar.exe +tmisc.exe +tslist.exe +ttrash.exe +ttree.exe +tmanual.exe +tgstring.exe +tscanner.exe +toption.exe +tthread.exe +tasyncqueue.exe +closure-marshal.exe +paramspec-test.exe +asyncqueue-test.exe +utf8-pointer.exe +extra_tests.exe +child-test1.exe +child-test2.exe +option-test.exe +printf-test.exe +string-test.exe +strtod-test.exe +gvalue-test.exe +byte_array_test.exe +dir_test.exe +misc_test.exe +cache_test.exe +dataset_test.exe +keyfile_test.exe +mem_test.exe +datalist_test.exe +hook_test.exe +log_test.exe +main_loop_test.exe +mem_profile_test.exe +g_test1.exe +g_test2.exe +helloworld.exe + diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/unichar_test.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/unichar_test.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 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 +target unichar_test.exe +targettype exe + +UID 0 0x0AB23DD2 + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests + +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude .. ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +source unichar-test.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/uri_funcs.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/uri_funcs.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 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 +target uri_funcs.exe +targettype exe + +UID 0 0x0AB23013 + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests + +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude .. ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +source uri-funcs.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 glib/build/symbian/tests/group/utf8_string.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/build/symbian/tests/group/utf8_string.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 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 +target utf8_string.exe +targettype exe + +UID 0 0x0AB23014 + +#ifdef EKA2 +CAPABILITY ALL -TCB +//VENDORID VID_DEFAULT +#endif + +//The src directory is added to the (user)include path by default +userinclude ../../../../tests +systeminclude ../../../../tests + +userinclude ../inc +//The top level directory is added to the include path by default +//systeminclude .. ../glib + +//Adding the Symbian and PIPS include path +systeminclude /epoc32/include +systeminclude /epoc32/include/stdapis +systeminclude /epoc32/include/stdapis/glib-2.0 +sourcepath ../../../../tests +source utf8-string.c + +//Adding some default libraries +library euser.lib libc.lib +library libglib.lib libgobject.lib libgthread.lib libgmodule.lib + +staticlibrary libcrt0.lib + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/app-name.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/app-name.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,67 @@ +// 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: +// + +#undef G_DISABLE_ASSERT +#undef G_LOG_DOMAIN + +#include +#include +#define LOG_FILE "c:\\logs\\app_name_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("app_name_log"); + close_log_file(); +} + +int main (int argc, char *argv[]) +{ + char appName[] = "TestApp"; + const char *retAppName; + + g_set_application_name(appName); + + retAppName = g_get_application_name(); + + if(retAppName != NULL) + { + if(g_strcmp0(appName, retAppName) !=0 ) + { + std_log(LOG_FILENAME_LINE, "g_get_application_name returned wrong name"); + assert_failed = 1; + } + } + else + { + std_log(LOG_FILENAME_LINE, "g_get_application_name returned NULL. errno = %d", errno); + assert_failed = 1; + } + + g_free((void *)retAppName); + + if(assert_failed) + std_log(LOG_FILENAME_LINE,"Test Failed"); + else + std_log(LOG_FILENAME_LINE,"Test Successful"); + + create_xml(0); + + return 0; +} diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/array-test1.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/array-test1.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,309 @@ +// 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: +// + + +#undef G_DISABLE_ASSERT +#undef G_LOG_DOMAIN + +#include +#define LOG_FILE "c:\\logs\\array1_test_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("array-test"); + close_log_file(); +} + +static gint sort (gconstpointer a, gconstpointer b) +{ + if(*(guint32*)a == *(guint32*)b) + return 0; + else + return *(guint32*)a < *(guint32*)b ? -1 : 1; +} + + +static gint sort_userdata (gconstpointer a, gconstpointer b, gpointer user_data) +{ + if(*(guint32*)a == *(guint32*)b) + return 0; + else + return *(guint32*)a < *(guint32*)b ? -1 : 1; +} + + + +/*Will return TRUE if input GArray and int[] array 2 are same else FALSE*/ +gboolean compare_array(GArray* array1, gint* array2, gint size) +{ + + int i; + if ( size != array1->len) + return FALSE; + for ( i = 0; i < size ; i++) + { + if ( g_array_index(array1, gint, i) != array2[i]) + return FALSE; + } + + return TRUE; +} + + +void test_remove_array_index() +{ + GArray *garray; + + const gint ARRAY_SIZE = 7; + const gint ARRAY_SIZE_AFTER_REMOVE_INDEX = 6; + const gint ARRAY_SIZE_AFTER_REMOVE_INDEX_FAST = 5; + + gint array[ARRAY_SIZE] = {4,5,6,7,8,9,10}; + gint array_after_remove_index_1[ARRAY_SIZE_AFTER_REMOVE_INDEX]= {4,6,7,8,9,10}; /*array after removing index 1*/ + gint array_after_remove_index_fast_2[ARRAY_SIZE_AFTER_REMOVE_INDEX_FAST] = {4,6,10,8,9}; /* array after removing index 2 fast. Input is array after removing index 1 */ + + int i; + gboolean ret; + + garray = g_array_new (FALSE,FALSE,sizeof(gint)); + if(garray == NULL) + { + std_log(LOG_FILENAME_LINE, "Array not created"); + assert_failed = 1; + return ; + } + + /*Insert values into array*/ + g_array_insert_vals(garray,0,array,ARRAY_SIZE); + + /* test for deleting single element in an array. Removing the element with index 1*/ + std_log(LOG_FILENAME_LINE, "Delete array element at index 1"); + garray = g_array_remove_index(garray,1); + + if(garray == NULL ) + { + std_log(LOG_FILENAME_LINE, "NULL return by g_array_remove_index"); + assert_failed = 1; + return ; + } + + /*Print the array elements after remove*/ + for(i=0; ilen; i++) + { + std_log(LOG_FILENAME_LINE, "Current array element at index %d is %d", i,g_array_index(garray, gint, i)); + } + + /*Check if the array size is now 4 and element at index 1 is not 5 after removal*/ + + ret = compare_array(garray, array_after_remove_index_1, ARRAY_SIZE_AFTER_REMOVE_INDEX); + if ( !ret) + { + std_log(LOG_FILENAME_LINE, "Array Element not properly deleted by g_array_remove_index"); + assert_failed = 1; + g_array_free(garray,TRUE); + return ; + } + + + /* Test to remove index element 2 using g_array_remove_index_fast*/ + + std_log(LOG_FILENAME_LINE, "Delete array element at index 2"); + garray =g_array_remove_index_fast(garray,2); + if(garray == NULL) + { + std_log(LOG_FILENAME_LINE, "NULL return by g_array_remove_index_fast"); + assert_failed = 1; + return ; + } + + for(i=0; ilen; i++) + { + std_log(LOG_FILENAME_LINE, "Current array element at index %d is %d", i,g_array_index(garray, gint, i)); + } + + ret = compare_array(garray, array_after_remove_index_fast_2, ARRAY_SIZE_AFTER_REMOVE_INDEX_FAST); + if ( !ret) + { + std_log(LOG_FILENAME_LINE, "Array Element not properly deleted by g_array_remove_index_fast"); + assert_failed = 1; + g_array_free(garray,TRUE); + return; + } + g_array_free(garray,TRUE); +} + + +void test_test_remove_array_index_range() +{ + const int ARRAY_SIZE = 10; + const int ARRAY_SIZE_AFTER_REMOVE_INDEX_RANGE = 8; + + gint array[ARRAY_SIZE]= {10,5,16,7,11,0,20,1,9,8}; + gint array_after_remove_index_range[ARRAY_SIZE_AFTER_REMOVE_INDEX_RANGE] = {10,5,16,0,20,1,9,8}; /*after removing 2 elements from index 3*/ + + gboolean ret; + GArray* garray; + int i; + + garray = g_array_new (FALSE,FALSE,sizeof(gint)); + if(garray == NULL) + { + std_log(LOG_FILENAME_LINE, "Array not created"); + assert_failed = 1; + return ; + } + + g_array_insert_vals(garray,0,array,ARRAY_SIZE); + for(i=0; ilen;i++) + { + std_log(LOG_FILENAME_LINE, "Current array elements %d is %d", i,g_array_index(garray, gint, i)); + } + + garray = g_array_remove_range(garray,3,2); /*remove two elements from index 3 */ + + if(garray == NULL) + { + std_log(LOG_FILENAME_LINE,"Elements not deleted properly by g_array_remove_range"); + assert_failed = 1; + return ; + + } + + /*print the array elements */ + for(i=0; ilen;i++) + { + std_log(LOG_FILENAME_LINE, "Curent array element(after deletion) %d is %d", i,g_array_index(garray, gint, i)); + } + + + ret = compare_array(garray, array_after_remove_index_range, ARRAY_SIZE_AFTER_REMOVE_INDEX_RANGE); + if(!ret) + { + std_log(LOG_FILENAME_LINE,"Elements not deleted properly"); + assert_failed = 1; + g_array_free(garray,TRUE); + return ; + } + g_array_free(garray,TRUE); +} + + +void test_sort_array() +{ + + GArray *garray; + const int ARRAY_SIZE = 11; + gint array[ARRAY_SIZE] = {10,5,16,7,11,0,20,1,9,8,9}; + gint sort_array[ARRAY_SIZE] = {0,1,5,7,8,9,9,10,11,16,20}; + + gboolean ret; + int i; + + /* Test for sorting the array elements */ + + garray = g_array_new (FALSE,FALSE,sizeof(gint)); + + if(garray == NULL) + { + std_log(LOG_FILENAME_LINE, "Array not created"); + assert_failed = 1; + return ; + } + g_array_insert_vals(garray,0,array,ARRAY_SIZE); + + g_array_sort(garray, sort); + + if(garray == NULL) + { + std_log(LOG_FILENAME_LINE, "Array not sorted"); + assert_failed = 1; + return ; + } + + std_log(LOG_FILENAME_LINE,"SORTED ARRAY"); + + for(i=0;ilen;i++) + { + std_log(LOG_FILENAME_LINE, "Element %d is %d", i,g_array_index(garray, gint, i)); + } + + ret = compare_array(garray, sort_array, ARRAY_SIZE); + + if(!ret) + { + std_log(LOG_FILENAME_LINE, "Array not sorted correctly"); + assert_failed = 1; + return ; + } + + g_array_free(garray,TRUE); + + + garray = g_array_new (FALSE,FALSE,sizeof(gint)); + if(garray == NULL) + { + std_log(LOG_FILENAME_LINE, "Array not created"); + return ; + } + g_array_insert_vals(garray,0,array,ARRAY_SIZE); + + g_array_sort_with_data (garray, sort_userdata, NULL); + + if(garray == NULL) + { + std_log(LOG_FILENAME_LINE, "Array not sorted with user data"); + assert_failed = 1; + return ; + } + + std_log(LOG_FILENAME_LINE,"SORTED ARRAY WITH USERDATA"); + for(i=0;ilen;i++) + { + std_log(LOG_FILENAME_LINE, "Element %d is %d", i,g_array_index(garray, gint, i)); + } + + ret = compare_array(garray, sort_array, ARRAY_SIZE); + if(!ret) + { + std_log(LOG_FILENAME_LINE, "Array not sorted correctly with user data"); + assert_failed = 1; + return ; + } + g_array_free(garray,TRUE); +} + + +int main (void) +{ + test_test_remove_array_index_range(); + test_sort_array(); + test_remove_array_index(); + + if(assert_failed) + std_log(LOG_FILENAME_LINE,"Test Failed"); + else + std_log(LOG_FILENAME_LINE,"Test Successful"); + + create_xml(0); + return 0; +} + + diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/array-test2.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/array-test2.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,243 @@ +// 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: +// + + +#undef G_DISABLE_ASSERT +#undef G_LOG_DOMAIN + +#define LOG_FILENAME_LINE __FILE__, __LINE__ +#include +#include + +#define LOG_FILE "c:\\logs\\array2_test_log.txt" +#include "std_log_result.h" + + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("ptrarray-test"); + close_log_file(); +} + +static gint psort (gconstpointer a, gconstpointer b) +{ + if(**(guint32**)a == **(guint32**)b) + return 0; + else + return **(guint32**)a < **(guint32**)b ? -1 : 1; +} + + +static gint psort_userdata (gconstpointer a, gconstpointer b, gpointer user_data) +{ + if(**(guint32**)a == **(guint32**)b) + return 0; + else + return **(guint32**)a < **(guint32**)b ? -1 : 1; +} + +gboolean compare_pointer_array(GPtrArray *parray1, gint* array2, gint size ) +{ + + int i; + int* val; + if ( size != parray1->len) + return FALSE; + for ( i = 0; i < size ; i++) + { + val = (int*)g_ptr_array_index(parray1, i) ; + if(val == NULL) + return FALSE; + if ( *val != array2[i]) + return FALSE; + } + + return TRUE; + + +} +void test_pointer_array_remove_range() +{ + GPtrArray *gparray; + const gint ARRAY_SIZE = 15; + const gint ARRAY_SIZE_AFTER_REMOVE_RANGE = 12; /*removing 3 elements starting from index 3*/ + + gint array[ARRAY_SIZE]= {99,88,77,33,44,11,66,22,0,39,1,9,100,2,73}; + gint array_after_remove_range[ARRAY_SIZE_AFTER_REMOVE_RANGE ]= {99,88,77,66,22,0,39,1,9,100,2,73}; + gboolean ret; + int i; + + + gparray = g_ptr_array_new (); + if(gparray == NULL) + { + std_log(LOG_FILENAME_LINE, "Pointer Array Not created"); + assert_failed = 1; + return; + } + + /*Add elements to array*/ + for (i = 0; i < ARRAY_SIZE; i++) + { + g_ptr_array_add (gparray, &(array[i])); + std_log(LOG_FILENAME_LINE, "Ptr Array element at index %d is %d",i, array[i]); + } + + g_ptr_array_remove_range(gparray,3,3); + + std_log(LOG_FILENAME_LINE, "AFTER DELETING THE RANGE"); + + /*Print the garray pointer->values*/ + for(i=0;ilen;i++) + { + gpointer val = g_ptr_array_index (gparray,i); + std_log(LOG_FILENAME_LINE, "Ptr Array element at index %d is %d",i, *((int*)val)); + } + + ret = compare_pointer_array(gparray, array_after_remove_range, ARRAY_SIZE_AFTER_REMOVE_RANGE ); + + if(ret != TRUE) + { + std_log(LOG_FILENAME_LINE, "Pointer Array Elements not properly deleted by g_ptr_array_remove_range"); + assert_failed = 1; + g_ptr_array_free(gparray,TRUE); + return ; + } + g_ptr_array_free (gparray, TRUE); +} + + +void sort_pointer_array() +{ + + GPtrArray *gparray; + const gint ARRAY_SIZE = 15; + + gint array[ARRAY_SIZE]= {99,88,77,33,44,11,66,22,0,39,1,9,100,2,73}; + gint sorted_array[ARRAY_SIZE]= { 0,1,2,9,11,22,33,39,44,66,73,77,88,99,100}; + int i; + gboolean ret; + + /* Test to sort the pointer array*/ + gparray = g_ptr_array_new (); + if(gparray == NULL) + { + std_log(LOG_FILENAME_LINE, "Pointer Array not created"); + assert_failed = 1; + g_ptr_array_free(gparray,TRUE); + return ; + } + + for (i = 0; i < ARRAY_SIZE; i++) + { + g_ptr_array_add (gparray, &array[i]); + std_log(LOG_FILENAME_LINE, "Ptr Array element at index %d is %d",i, array[i]); + } + + g_ptr_array_sort(gparray,psort); + + /*Print the sorted Array*/ + std_log(LOG_FILENAME_LINE, "SORTED ARRAY"); + + for(i=0;ilen;i++) + { + gpointer val = g_ptr_array_index (gparray,i); + std_log(LOG_FILENAME_LINE, "Ptr Array element at index %d is %d",i, *((int*)val)); + } + + + ret = compare_pointer_array(gparray, sorted_array, ARRAY_SIZE); + if(ret != TRUE) + { + std_log(LOG_FILENAME_LINE, "Pointer Array Elements not sorted by g_ptr_array_sort"); + assert_failed = 1; + g_ptr_array_free(gparray,TRUE); + return ; + } + g_ptr_array_free (gparray, TRUE); +} + + +void sort_pointer_array_with_data() +{ + + GPtrArray *gparray; + const gint ARRAY_SIZE = 15; + + gint array[ARRAY_SIZE]= {99,88,77,33,44,11,66,22,0,39,1,9,100,2,73}; + gint sorted_array[ARRAY_SIZE]= { 0,1,2,9,11,22,33,39,44,66,73,77,88,99,100}; + int i; + gboolean ret; + + /* Test to sort the pointer array*/ + gparray = g_ptr_array_new (); + if(gparray == NULL) + { + std_log(LOG_FILENAME_LINE, "Pointer Array not created"); + assert_failed = 1; + g_ptr_array_free(gparray,TRUE); + return ; + } + + for (i = 0; i < ARRAY_SIZE; i++) + { + g_ptr_array_add (gparray, &array[i]); + + std_log(LOG_FILENAME_LINE, "Ptr Array element at index %d is %d",i, array[i]); + } + + g_ptr_array_sort_with_data(gparray,psort_userdata, NULL); + + + /*Print the sorted Array*/ + std_log(LOG_FILENAME_LINE, "SORTED ARRAY"); + + for(i=0;ilen;i++) + { + gpointer val = g_ptr_array_index (gparray,i); + std_log(LOG_FILENAME_LINE, "Ptr Array element at index %d is %d",i, *((int*)val) ); + } + + + ret = compare_pointer_array(gparray, sorted_array, ARRAY_SIZE); + + if(ret != TRUE) + { + std_log(LOG_FILENAME_LINE, "Pointer Array Elements not sorted by g_ptr_array_sort"); + assert_failed = 1; + g_ptr_array_free(gparray,TRUE); + return ; + } + g_ptr_array_free (gparray, TRUE); +} + + +int main (void) +{ + test_pointer_array_remove_range(); + sort_pointer_array(); + sort_pointer_array_with_data(); + + if(assert_failed) + std_log(LOG_FILENAME_LINE,"Test Failed"); + else + std_log(LOG_FILENAME_LINE,"Test Successful"); + + create_xml(0); + return 0; +} diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/at-exit.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/at-exit.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,45 @@ +// 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: +// + +#undef G_DISABLE_ASSERT +#undef G_LOG_DOMAIN + +#include +#include +#define LOG_FILE "c:\\logs\\at_exit_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("at_exit_log"); + close_log_file(); +} + +void on_exit() + { + std_log(LOG_FILENAME_LINE,"Test Successful"); + create_xml(0); + } + +int main (int argc, char *argv[]) +{ + g_atexit(on_exit); + std_log(LOG_FILENAME_LINE, "Test ll be considered failed if on_exit() is not called"); + return 0; +} diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/base-name.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/base-name.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,72 @@ +// 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: +// + +#undef G_DISABLE_ASSERT +#undef G_LOG_DOMAIN + +#include +#include +#include +#define LOG_FILE "c:\\logs\\base_name_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + +#define MAX_FILENAME_LENGTH 256 +#define MAX_PATH_LENGTH 256 + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("base_name_log"); + close_log_file(); +} + +int main (int argc, char *argv[]) +{ + char folder_name[] = "c:\\example\\test\\"; + char file_name[] = "test.txt"; + const gchar *ret_file_name; + + gchar input_file[MAX_PATH_LENGTH]; + sprintf(input_file, "%s%s", folder_name, file_name); + + ret_file_name = g_basename(input_file); + + if(ret_file_name != NULL) + { + if(g_strcmp0(ret_file_name, file_name) !=0 ) + { + std_log(LOG_FILENAME_LINE, "g_basename returned wrong file name"); + assert_failed = 1; + } + } + else + { + std_log(LOG_FILENAME_LINE, "g_basename returned NULL. errno = %d", errno); + assert_failed = 1; + } + + + if(assert_failed) + std_log(LOG_FILENAME_LINE,"Test Failed"); + else + std_log(LOG_FILENAME_LINE,"Test Successful"); + + create_xml(0); + + return 0; +} diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/bookmarkfile-test1.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/bookmarkfile-test1.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,108 @@ +// 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 +#define LOG_FILE "c:\\logs\\bookmark_test1_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ +#define in_FILE "file.xbel" + + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("bookmark-test1"); + close_log_file(); +} + +int +main (int argc, + char *argv[]) + { + GBookmarkFile* bookmark; + gsize uris_len; + gchar *bookmark_data = NULL; + gboolean file_written,file_load; + const gchar *rel_path; + time_t time; + const gchar *bookmark_filename = argv[1]; + GError *error = NULL; + gchar **bookmark_uri = NULL; + + bookmark = g_bookmark_file_new(); + file_load= g_bookmark_file_load_from_file(bookmark, bookmark_filename, &error); + if(file_load != TRUE) + { + std_log(LOG_FILENAME_LINE,"g_bookmark_file_load_from_file fails with err:%s",error->message); + assert_failed = 1; + } + bookmark_data = g_bookmark_file_to_data(bookmark,&uris_len,&error); + if(bookmark_data == NULL) + { + std_log(LOG_FILENAME_LINE,"Bg_bookmark_file_to_data fails with err:%s",error->message); + assert_failed = 1; + } + rel_path = in_FILE; // Code changed to Hardcode the data file in the c:\ private path. + file_written = g_bookmark_file_load_from_data_dirs(bookmark, rel_path,NULL, &error); + if(file_written == FALSE) + { + std_log(LOG_FILENAME_LINE,"g_bookmark_file_load_from_data_dirs fails with err:%s",error->message); + assert_failed = 1; + } + + bookmark_uri = g_bookmark_file_get_uris(bookmark, NULL); + if(bookmark_uri == NULL) + { + std_log(LOG_FILENAME_LINE,"g_bookmark_file_get_uris fails"); + assert_failed = 1; + } + + bookmark_data = g_bookmark_file_get_mime_type(bookmark,*bookmark_uri,&error); + if(bookmark_data == NULL) + { + std_log(LOG_FILENAME_LINE,"URI cannot be found and the error code:%s",error->message); + assert_failed = 1; + } + g_bookmark_file_set_is_private(bookmark,*bookmark_uri, TRUE); + file_written = g_bookmark_file_get_is_private(bookmark,*bookmark_uri, &error); + if(file_written == FALSE) + { + std_log(LOG_FILENAME_LINE,"Private flag is not set in the URI and fails with :%s",error->message); + assert_failed = 1; + } + + g_bookmark_file_set_added(bookmark,*bookmark_uri,-1);//-1, To use the current time. + time = g_bookmark_file_get_added(bookmark,*bookmark_uri,&error); + if(time == -1) + { + std_log(LOG_FILENAME_LINE,"URI cannot be found and fails with :%s",error->message); + assert_failed = 1; + } + g_strfreev(bookmark_uri); + g_bookmark_file_free(bookmark); + + if(assert_failed) + std_log(LOG_FILENAME_LINE,"Test Fail"); + else + std_log(LOG_FILENAME_LINE,"Test Successful"); + + + create_xml(assert_failed); + return 0; + } diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/list-env.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/list-env.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,98 @@ +// 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: +// + +#undef G_DISABLE_ASSERT +#undef G_LOG_DOMAIN + +#include +#include +#define LOG_FILE "c:\\logs\\list_env_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("list_env_log"); + close_log_file(); +} + +int main (int argc, char *argv[]) +{ + const gchar *variable1 = "TEST_VAR1"; + gchar *value1 = "testvalue1"; + const gchar *variable2 = "TEST_VAR2"; + gchar *value2 = "testvalue2"; + gchar **env_list; + gint i, found = 0; + guint no_of_variables =0; + gboolean found_var1 = 0, found_var2 = 0; + + if(g_setenv (variable1, value1, TRUE) && g_setenv (variable2, value2, TRUE)) + { + env_list = g_listenv(); + + if(env_list) + { + no_of_variables = g_strv_length(env_list); + + if(no_of_variables) + { + for(i = 0; i +#include "glib.h" +#define LOG_FILE "c:\\logs\\majorversion_test_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("version-test"); + close_log_file(); +} + + +int +main (int argc, + char *argv[]) + { + const guint *major_version = NULL; + const guint *minor_version = NULL; + const guint *micro_version = NULL; + const guint *interface_age = NULL; + const guint *binary_age = NULL; + const gchar *check_version = NULL; + major_version = _glib_major_version(); + minor_version = _glib_minor_version(); + micro_version = _glib_micro_version(); + interface_age = _glib_interface_age(); + binary_age = _glib_binary_age(); + std_log(LOG_FILENAME_LINE,"Binary age :%d\n Interface age:%d",*binary_age,*interface_age); + check_version = glib_check_version((*major_version),(*minor_version),(*micro_version)); + if(check_version != NULL) + { + std_log(LOG_FILENAME_LINE,"GLib library in use is not compatible with the given verison"); + assert_failed = 1; + } + if(assert_failed) + { + std_log(LOG_FILENAME_LINE,"%s",check_version); + std_log(LOG_FILENAME_LINE,"Test Fail"); + } + else + std_log(LOG_FILENAME_LINE,"Test Successful"); + + + create_xml(assert_failed); + return 0; + } + + diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/nullify-ptr.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/nullify-ptr.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,52 @@ +// 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: +// + +#undef G_DISABLE_ASSERT +#undef G_LOG_DOMAIN + +#include +#define LOG_FILE "c:\\logs\\nullify_ptr_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("nullify_ptr_log"); + close_log_file(); +} + +int main (int argc, char *argv[]) +{ + char *ptr; + g_nullify_pointer((gpointer)&ptr); + + if(ptr != NULL) + { + std_log(LOG_FILENAME_LINE,"ptr is not NULL"); + assert_failed = 1; + } + + if(assert_failed) + std_log(LOG_FILENAME_LINE,"Test Fail"); + else + std_log(LOG_FILENAME_LINE,"Test Successful"); + + create_xml(0); + + return 0; +} diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/std_log_result.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/std_log_result.h Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,178 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + + +#ifndef _STD_LOG_FILE_H__ +#define _STD_LOG_FILE_H__ + +#include +#include +#include +#include +#include +#ifdef __SYMBIAN32__ +//#define LOG_FILE "c:\\logs\\std_test_log.txt" +#define LOG_DIR "c:\\logs\\" +#define LOG_FILE_EXT "xml" +int assert_failed = 0; +#else +#define LOG_DIR "" +#define LOG_FILE_EXT "xml" +#define LOG_FILE "std_test_log.txt" +int assert_failed = 0; +#endif +FILE *fp; + +int gnutest = 1; + +# define VERIFY(fn) gnutest &= (fn) + + +void std_log(const char *filename,const int lineno,const char* aformat,...) +{ + va_list va; + if(fp==NULL) + { + fp = fopen(LOG_FILE,"a"); + } + + va_start(va,aformat); + { + fprintf(fp,"%s - [%d] : ",filename,lineno); + vfprintf(fp,aformat,va); + fprintf(fp,"\n"); + } + va_end(va); + fflush(fp); +} + + +void init_log_file() +{ + if(fp == NULL) + { + fp = fopen(LOG_FILE, "a"); + } +} + +void close_log_file() +{ + fclose(fp); +} + +// This function is used to generate the xml file used bt ATS +void testResultXml(char *filename) +{ + char time_buf[50]; + + char result[10]; + + char xmlfilename[256]; + + time_t t = time(NULL); + + struct tm *tm1 = localtime(&t); + + char *atsinitmsg = "\n\t"; + + char *atsbatchinit1 = \ + "\n\t\t\ + \n\t\t\t\ + \n\t\t\t"; + + char *atsbatchinit2 = "\ + \n\t\t\tNA\ + \n\t\t\t\ + \n\t\t\t\tNA\ + \n\t\t\t\tNA\ + \n\t\t\t\ + \n\t\t"; + + char *atsbatchresult= \ + "\n\t\t\ + \n\t\t\t00:00:00\ + \n\t\t"; + + char *atsclosemsg = \ + "\n\t\ + \n\n "; + + char *atstestinit = "\n\t\t"; + + + char *atscaseinit1 = \ + "\n\t\t\t\ + \n\t\t\t\t\ + \n\t\t\t\t"; + + char *atscaseinit2 = "\ + \n\t\t\t\t0\ + \n\t\t\t"; + + char *atscaseresult1= \ + "\n\t\t\t\ + \n\t\t\t\t0\ + \n\t\t\t\t00:00:00\ + \n\t\t\t"; + + char *atstestclose = "\n\t\t"; + + /* Check and see if spd_logs/xml is existent or not. If not present create it */ + DIR *dir; + FILE *fp; + + dir = opendir("c:\\spd_logs"); + if(!dir) + mkdir("c:\\spd_logs",0777); + + dir = opendir("c:\\spd_logs\\xml"); + if(!dir) + mkdir("c:\\spd_logs\\xml",0777); + + // create the xml file name + strcpy(xmlfilename,"c:/spd_logs/xml/"); + strcat(xmlfilename,filename); + strcat(xmlfilename,".xml"); + + strftime(time_buf,50,"%c",tm1); + + if(assert_failed ) + strcpy(result,"FAILED"); + else + strcpy(result,"PASSED"); + + fp = fopen(xmlfilename,"w"); + + if(fp) + { + fprintf(fp,"%s%s%s%s%s%s%s%s%s%s%s%s%s%s",atsinitmsg,atsbatchinit1,time_buf,atsbatchinit2,atstestinit, + atscaseinit1,filename,atscaseinit2,atscaseresult1,result,atscaseresult2, + atstestclose,atsbatchresult,atsclosemsg); + + fclose(fp); + } + else + { + g_assert(FALSE && "Failed to create the xml file"); + } +} + +#endif + diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/test-utils.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/test-utils.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,198 @@ +// 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: +// + +#undef G_DISABLE_ASSERT +#undef G_LOG_DOMAIN + +#include +#include +#define LOG_FILE "c:\\logs\\test_utils_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("test_utils_log"); + close_log_file(); +} + +static void +gstring_overwrite_int (GString *gstring, + guint pos, + guint32 vuint) +{ + vuint = g_htonl (vuint); + g_string_overwrite_len (gstring, pos, (const gchar*) &vuint, 4); +} + +static void +gstring_append_int (GString *gstring, + guint32 vuint) +{ + vuint = g_htonl (vuint); + g_string_append_len (gstring, (const gchar*) &vuint, 4); +} + +static void +gstring_append_double (GString *gstring, + double vdouble) +{ + union { double vdouble; guint64 vuint64; } u; + u.vdouble = vdouble; + u.vuint64 = GUINT64_TO_BE (u.vuint64); + g_string_append_len (gstring, (const gchar*) &u.vuint64, 8); +} + +static guint8* +g_test_log_dump (GTestLogMsg *msg, + guint *len) +{ + GString *gstring = g_string_sized_new (1024); + guint ui; + gstring_append_int (gstring, 0); /* message length */ + gstring_append_int (gstring, msg->log_type); + gstring_append_int (gstring, msg->n_strings); + gstring_append_int (gstring, msg->n_nums); + gstring_append_int (gstring, 0); /* reserved */ + for (ui = 0; ui < msg->n_strings; ui++) + { + guint l = strlen (msg->strings[ui]); + gstring_append_int (gstring, l); + g_string_append_len (gstring, msg->strings[ui], l); + } + for (ui = 0; ui < msg->n_nums; ui++) + gstring_append_double (gstring, msg->nums[ui]); + *len = gstring->len; + gstring_overwrite_int (gstring, 0, *len); /* message length */ + return (guint8*) g_string_free (gstring, FALSE); +} + +void start_timer() + { + GTimer *timer; + timer = g_timer_new (); + g_timer_start(timer); + g_timer_stop(timer); + } + +void test_g_test_trap() + { + if(g_test_trap_fork(0, G_TEST_TRAP_SILENCE_STDOUT)) + { + exit(0); + } + + if(!g_test_trap_has_passed()) + { + std_log(LOG_FILENAME_LINE, "g_test_trap_has_passed didnt work as expected"); + assert_failed = 1; + } + } + +void test_g_test_log_type_name() + { + const char *ret; + ret = g_test_log_type_name(G_TEST_LOG_MESSAGE); + + if(strcmp(ret, "message")) + { + std_log(LOG_FILENAME_LINE, "g_test_log_type_name didnt work as expected"); + assert_failed = 1; + } + } + +void test_g_test_timer() + { + double ret_time1, ret_time2; + + g_test_timer_start(); + ret_time1 = g_test_timer_elapsed(); + ret_time2 = g_test_timer_last(); + + if(!(ret_time1 == ret_time2)) + { + std_log(LOG_FILENAME_LINE, "g_test_timer* didnt work as expected"); + assert_failed = 1; + } + } + +void test_g_log_buffer() + { + GTestLogBuffer* log_buffer; + GTestLogMsg* log_msg; + GTestLogMsg msg_ip; + gchar *astrings[1] = {NULL}; + guint8 *dbuffer; + guint dbufferlen; + int i; + + msg_ip.log_type = G_TEST_LOG_MESSAGE; + msg_ip.n_strings = 1; + msg_ip.strings = astrings; + astrings[0] = (gchar*) "test-log-some-dummy-log"; + msg_ip.n_nums = 0; + msg_ip.nums = 0; + dbuffer = (guint8*)g_test_log_dump(&msg_ip, &dbufferlen); + + log_buffer = g_test_log_buffer_new(); + + if(log_buffer) + { + g_test_log_buffer_push(log_buffer, dbufferlen, (const guint8*)dbuffer); + + log_msg = g_test_log_buffer_pop(log_buffer); + + if(log_msg) + { + g_test_log_msg_free(log_msg); + } + else + { + std_log(LOG_FILENAME_LINE, "g_test_log_buffer_pop returned NULL"); + assert_failed = 1; + } + + g_test_log_buffer_free(log_buffer); + } + else + { + std_log(LOG_FILENAME_LINE, "g_test_log_buffer_new returned NULL"); + assert_failed = 1; + } + + g_free (dbuffer); + } + +int main (int argc, char *argv[]) +{ + g_test_init(&argc, &argv); + + test_g_test_trap(); + test_g_test_log_type_name(); + test_g_test_timer(); + test_g_log_buffer(); + + if(assert_failed) + std_log(LOG_FILENAME_LINE,"Test Failed"); + else + std_log(LOG_FILENAME_LINE,"Test Successful"); + + create_xml(0); + + return 0; +} diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/unichar-test.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/unichar-test.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,112 @@ +// 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: +// + +#undef G_DISABLE_ASSERT +#undef G_LOG_DOMAIN + +#include +#include +#define LOG_FILE "c:\\logs\\unichar_test_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("unichar_testlog"); + close_log_file(); +} + +int main (int argc, char *argv[]) +{ + gunichar ret; + gunichar mark = 0x0BCA; //spacing mark. Tamil letter. + gunichar title = 0x01F2; //Latin letter. + gunichar square = 0x25A1; //white square + gunichar space = 0x200B; //zero width space + gunichar tel_symbol = 0x32C0; //telegraphic symbol for january + gunichar CR = 0x000D; //carriage return + GUnicodeBreakType type; + + g_unichar_get_mirror_char('(', &ret); + + if(!(')' == ret)) + { + std_log(LOG_FILENAME_LINE,"g_unichar_get_mirror_char didnt work as expected"); + assert_failed = 1; + } + + + if(!g_unichar_ismark(mark)) + { + std_log(LOG_FILENAME_LINE,"g_unichar_ismark didnt work as expected"); + assert_failed = 1; + } + + if(!g_unichar_istitle(title)) + { + std_log(LOG_FILENAME_LINE,"g_unichar_istitle didnt work as expected"); + assert_failed = 1; + } + + if(!g_unichar_isdefined(square)) + { + std_log(LOG_FILENAME_LINE,"g_unichar_isdefined didnt work as expected"); + assert_failed = 1; + } + + if(!g_unichar_iszerowidth(space)) + { + std_log(LOG_FILENAME_LINE,"g_unichar_iszerowidth didnt work as expected"); + assert_failed = 1; + } + + if(!g_unichar_iswide(tel_symbol)) + { + std_log(LOG_FILENAME_LINE,"g_unichar_iswide didnt work as expected"); + assert_failed = 1; + } + + if(!g_unichar_iswide_cjk(tel_symbol)) + { + std_log(LOG_FILENAME_LINE,"g_unichar_iswide_cjk didnt work as expected"); + assert_failed = 1; + } + + ret = g_unichar_totitle('a'); + if(!(ret == 'A')) + { + std_log(LOG_FILENAME_LINE,"g_unichar_totitle didnt work as expected"); + assert_failed = 1; + } + + type = g_unichar_break_type(CR); + if(type != G_UNICODE_BREAK_CARRIAGE_RETURN) + { + std_log(LOG_FILENAME_LINE,"g_unichar_break_type didnt work as expected"); + assert_failed = 1; + } + + if(assert_failed) + std_log(LOG_FILENAME_LINE,"Test Failed"); + else + std_log(LOG_FILENAME_LINE,"Test Successful"); + + create_xml(0); + + return 0; +} diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/uri-funcs.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/uri-funcs.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,122 @@ +// 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: +// + +#undef G_DISABLE_ASSERT +#undef G_LOG_DOMAIN + +#include +#include +#define LOG_FILE "c:\\logs\\uri_funcs_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("uri_funcs_log"); + close_log_file(); +} + +int main (int argc, char *argv[]) +{ + gchar *uri = "http:\\\\www.no!ki@a.com"; + gchar *res_str = ":\\"; + char *p; + char *q; + char *escape_str; + + p = g_uri_parse_scheme(uri); + + if(p) + { + if(strcmp(p, "http")) + { + std_log(LOG_FILENAME_LINE,"g_uri_parse_scheme didnt work as expected"); + assert_failed = 1; + } + free(p); + } + else + { + std_log(LOG_FILENAME_LINE,"g_uri_parse_scheme returnd NULL. errno = %d", errno); + assert_failed = 1; + } + + + //escape the uri + escape_str = g_uri_escape_string(uri, res_str, TRUE); + + if(escape_str) + { + std_log(LOG_FILENAME_LINE, "escape string %s", escape_str); + + //convert back only a segment + q = g_uri_unescape_segment(escape_str, escape_str+16, NULL); + if(q) + { + std_log(LOG_FILENAME_LINE, "unescape segment string %s", q); + if(strcmp(q, "http:\\\\www.no!")) + { + std_log(LOG_FILENAME_LINE,"g_uri_unescape_segment didnt work as expected"); + assert_failed = 1; + } + free(q); + } + else + { + std_log(LOG_FILENAME_LINE,"g_uri_unescape_segment returned NULL. errno = %d", errno); + assert_failed = 1; + } + + //convert back the whole string + p = g_uri_unescape_string(escape_str, NULL); + if(p) + { + std_log(LOG_FILENAME_LINE, "unescape string %s", p); + + //converted string should be same as original uri string + if(strcmp(p, uri)) + { + std_log(LOG_FILENAME_LINE,"g_uri_unescape_string returned NULL"); + assert_failed = 1; + } + + free(p); + } + else + { + std_log(LOG_FILENAME_LINE,"g_uri_unescape_string returned NULL. errno = %d", errno); + assert_failed = 1; + } + + free(escape_str); + } + else + { + std_log(LOG_FILENAME_LINE,"g_uri_escape_string returned NULL. errno = %d", errno); + assert_failed = 1; + } + + if(assert_failed) + std_log(LOG_FILENAME_LINE,"Test Failed"); + else + std_log(LOG_FILENAME_LINE,"Test Successful"); + + create_xml(0); + + return 0; +} diff -r e5d77a29bdca -r 79045913e4e9 glib/tests/utf8-string.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/tests/utf8-string.c Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,72 @@ +// 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: +// + +#undef G_DISABLE_ASSERT +#undef G_LOG_DOMAIN + +#include +#include +#define LOG_FILE "c:\\logs\\utf8_string_log.txt" +#include "std_log_result.h" +#define LOG_FILENAME_LINE __FILE__, __LINE__ + +void create_xml(int result) +{ + if(result) + assert_failed = 1; + + testResultXml("utf8_string_log"); + close_log_file(); +} + +int main (int argc, char *argv[]) +{ + gchar *src = "TestString"; + gchar dest[20]; + gchar *p; + + p = g_utf8_strncpy(dest, src, strlen(src)); + + if(p == dest) + { + if(strcmp(dest, src)) + { + std_log(LOG_FILENAME_LINE,"g_utf8_strncpy didnt work as expected"); + assert_failed = 1; + } + } + else + { + std_log(LOG_FILENAME_LINE,"g_utf8_strncpy's return value is invalid"); + assert_failed = 1; + } + + p = NULL; + p = g_utf8_strrchr(src, strlen(src), 't'); + if(strcmp(p, "tring")) + { + std_log(LOG_FILENAME_LINE,"g_utf8_strrchr didnt work as expected"); + assert_failed = 1; + } + + if(assert_failed) + std_log(LOG_FILENAME_LINE,"Test Failed"); + else + std_log(LOG_FILENAME_LINE,"Test Successful"); + + create_xml(0); + + return 0; +} diff -r e5d77a29bdca -r 79045913e4e9 glib/tsrc/group/bld.inf --- a/glib/tsrc/group/bld.inf Thu Aug 05 20:12:17 2010 +0530 +++ b/glib/tsrc/group/bld.inf Thu Aug 05 23:23:13 2010 +0530 @@ -18,3 +18,46 @@ #include "../../build/symbian/tests/group/bld.inf" #include "../../build/symbian/glib/tests/group/bld.inf" #include "../../build/symbian/gobject/tests/group/bld.inf" + + +PRJ_TESTMMPFILES +../BC/group/tutf8.mmp +../BC/group/tnode.mmp +../BC/group/tunichar.mmp +../BC/group/tmisc.mmp +../BC/group/tslist.mmp +../BC/group/ttrash.mmp +../BC/group/ttree.mmp +../BC/group/tmanual.mmp +../BC/group/tgstring.mmp +../BC/group/tscanner.mmp +../BC/group/toption.mmp +../BC/group/tthread.mmp +../BC/group/tasyncqueue.mmp +../BC/group/closure-marshal.mmp +../BC/group/paramspec-test.mmp +../BC/group/asyncqueue-test.mmp +../BC/group/utf8-pointer.mmp +../BC/group/extra_tests.mmp +../BC/group/child-test1.mmp +../BC/group/child-test2.mmp +../BC/group/option-test.mmp +../BC/group/printf-test.mmp +../BC/group/string-test.mmp +../BC/group/strtod-test.mmp +../BC/group/gvalue-test.mmp +../BC/group/byte_array_test.mmp +../BC/group/dir_test.mmp +../BC/group/misc_test.mmp +../BC/group/cache_test.mmp +../BC/group/dataset_test.mmp +../BC/group/keyfile_test.mmp +../BC/group/mem_test.mmp +../BC/group/datalist_test.mmp +../BC/group/hook_test.mmp +../BC/group/log_test.mmp +../BC/group/main_loop_test.mmp +../BC/group/mem_profile_test.mmp +../BC/group/g_test1.mmp +../BC/group/g_test2.mmp +../BC/group/helloworld.mmp \ No newline at end of file diff -r e5d77a29bdca -r 79045913e4e9 glib/tsrc/test.xml --- a/glib/tsrc/test.xml Thu Aug 05 20:12:17 2010 +0530 +++ b/glib/tsrc/test.xml Thu Aug 05 23:23:13 2010 +0530 @@ -4,7 +4,7 @@ admin 10 - 9.2_MCL_RELEASE_glib-2.20.4_vasco + glib_vasco @@ -13,7 +13,7 @@ - + @@ -1284,7 +1284,7 @@ execute - + @@ -1882,7 +1882,7 @@ execute - + @@ -2023,12 +2023,21 @@ + + install + + + + + + + execute - + - + @@ -2211,7 +2220,8 @@ - + + @@ -2233,19 +2243,377 @@ - - fetch-log + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + + + + + + + + + + install - - - + + + + + + + + execute + + + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + + + + + install + + + + + + + + + install + + + + + + + + + execute + + + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + + + + + + + + + install + + + + + + + + + execute + + + + + + + + + + + + + + + fetch-log + + + + + + + + - + + ATSINPUT/components/glib-2.20.4_utf8_string/armv5_urel/utf8_string.exe + ATSINPUT/components/glib-2.20.4_uri_funcs/armv5_urel/uri_funcs.exe + ATSINPUT/components/glib-2.20.4_unichar_test/armv5_urel/unichar_test.exe + ATSINPUT/components/glib-2.20.4_test_utils/armv5_urel/test_utils.exe + ATSINPUT/components/glib-2.20.4_nullify_ptr/armv5_urel/nullify_ptr.exe + ATSINPUT/components/glib-2.20.4_majorversion_test/armv5_urel/majorversion_test.exe + ATSINPUT/components/glib-2.20.4_list_env/armv5_urel/list_env.exe + ATSINPUT/components/glib-2.20.4_bookmarkfile_test1/armv5_urel/bookmarkfile_test1.exe + ATSINPUT/components/glib-2.20.4_base_name/armv5_urel/base_name.exe + ATSINPUT/components/glib-2.20.4_at_exit/armv5_urel/at_exit.exe + ATSINPUT/components/glib-2.20.4_app_name/armv5_urel/app_name.exe + ATSINPUT/components/glib-2.20.4_array2_test/armv5_urel/array2_test.exe + ATSINPUT/components/glib-2.20.4_array1_test/armv5_urel/array1_test.exe ATSINPUT/components/glib-2.20.4_accumulator/armv5_urel/accumulator.exe ATSINPUT/components/glib-2.20.4_array_test/armv5_urel/array_test.exe ATSINPUT/components/glib-2.20.4_asyncqueue_test/armv5_urel/asyncqueue_test.exe @@ -2256,6 +2624,7 @@ ATSINPUT/components/glib-2.20.4_bookmarkfile_test/General/valid-01.xbel ATSINPUT/components/glib-2.20.4_checksum_test/armv5_urel/checksum_test.exe ATSINPUT/components/glib-2.20.4_child_test/armv5_urel/child_test.exe + ATSINPUT/components/glib-2.20.4_child_test/armv5_urel/helloworld.exe ATSINPUT/components/glib-2.20.4_closures/armv5_urel/closures.exe ATSINPUT/components/glib-2.20.4_completion_test/armv5_urel/completion_test.exe ATSINPUT/components/glib-2.20.4_convert_test/armv5_urel/convert_test.exe diff -r e5d77a29bdca -r 79045913e4e9 lowlevellibsandfws/apputils/group/bafl.iby --- a/lowlevellibsandfws/apputils/group/bafl.iby Thu Aug 05 20:12:17 2010 +0530 +++ b/lowlevellibsandfws/apputils/group/bafl.iby Thu Aug 05 23:23:13 2010 +0530 @@ -21,9 +21,9 @@ file=ABI_DIR\BUILD_DIR\baksrv.dll System\Libs\baksrv.dll file=ABI_DIR\BUILD_DIR\baksrvs.exe System\Programs\baksrvs.exe -data=ZPRIVATE\100048AA\backup_registration.xml private\100048aa\backup_registration.xml +data=ZPRIVATE\100048aa\backup_registration.xml private\100048aa\backup_registration.xml -#include "initialiseLocale.iby" +#include "initialiselocale.iby" #include #include diff -r e5d77a29bdca -r 79045913e4e9 lowlevellibsandfws/pluginfw/Framework/MMPFiles/errorrsc.mmp --- a/lowlevellibsandfws/pluginfw/Framework/MMPFiles/errorrsc.mmp Thu Aug 05 20:12:17 2010 +0530 +++ b/lowlevellibsandfws/pluginfw/Framework/MMPFiles/errorrsc.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -23,7 +23,7 @@ // generated for the system error // resolver, // must eventually end up in Z:\System\Errors SOURCEPATH ../../Framework/frame -START RESOURCE EComErr.rss +START RESOURCE ecomerr.rss TARGETPATH /resource/errors diff -r e5d77a29bdca -r 79045913e4e9 lowlevellibsandfws/pluginfw/Group/ECom.iby --- a/lowlevellibsandfws/pluginfw/Group/ECom.iby Thu Aug 05 20:12:17 2010 +0530 +++ b/lowlevellibsandfws/pluginfw/Group/ECom.iby Thu Aug 05 23:23:13 2010 +0530 @@ -23,16 +23,16 @@ #define __ECOM_IBY__ // Make sure the error strings appear in the ROM -data=MULTI_LINGUIFY(RSC ZRESOURCE\Errors\ECOMERR Resource\Errors\ecomerr) +data=MULTI_LINGUIFY(RSC ZRESOURCE\errors\ecomerr Resource\Errors\ecomerr) // Framework Components -file=ABI_DIR\BUILD_DIR\ECOM.dll System\Libs\ECom.dll -file=ABI_DIR\BUILD_DIR\ECOMSERVER.exe System\Libs\EComServer.exe -file=ABI_DIR\BUILD_DIR\EComPatchData.dll System\Libs\EComPatchData.dll +file=ABI_DIR\BUILD_DIR\ecom.dll System\Libs\ECom.dll +file=ABI_DIR\BUILD_DIR\ecomserver.exe System\Libs\EComServer.exe +file=ABI_DIR\BUILD_DIR\ecompatchdata.dll System\Libs\EComPatchData.dll // // ECOM uses a custom scheme to do patchable constants. Licensees are instructed to -// edit \epoc32\rom\include\ecompatchconstants.hby if they want to patch anyone of +// edit EPOCROOT##epoc32\rom\include\ecompatchconstants.hby if they want to patch anyone of // the patchable constants below. Direct use of the patchdata command outside here // is not supported because ECOM may change which binaries need the patches. // diff -r e5d77a29bdca -r 79045913e4e9 ofdbus/dbus-glib/tsrc/testapps/dbus_glib_signal_server1/src/dbus_glib_signal_server1.c --- a/ofdbus/dbus-glib/tsrc/testapps/dbus_glib_signal_server1/src/dbus_glib_signal_server1.c Thu Aug 05 20:12:17 2010 +0530 +++ b/ofdbus/dbus-glib/tsrc/testapps/dbus_glib_signal_server1/src/dbus_glib_signal_server1.c Thu Aug 05 23:23:13 2010 +0530 @@ -68,6 +68,7 @@ if(signal_second == 2) { fd = open(fifopath, O_WRONLY); + sleep(2); if(fd > 0) { if(signal_first == 1) @@ -121,6 +122,7 @@ dbus_g_proxy_connect_signal (proxy, "HelloSignal", G_CALLBACK (hello_signal_handler1), NULL, NULL); fd = open(fifopath, O_WRONLY); + sleep(2); if (fd > 0) { err = write(fd, buf1, strlen(buf1)); diff -r e5d77a29bdca -r 79045913e4e9 ofdbus/dbus-glib/tsrc/testapps/dbus_glib_signal_server2/src/dbus_glib_signal_server2.c --- a/ofdbus/dbus-glib/tsrc/testapps/dbus_glib_signal_server2/src/dbus_glib_signal_server2.c Thu Aug 05 20:12:17 2010 +0530 +++ b/ofdbus/dbus-glib/tsrc/testapps/dbus_glib_signal_server2/src/dbus_glib_signal_server2.c Thu Aug 05 23:23:13 2010 +0530 @@ -65,6 +65,7 @@ if(signal_second == 2) { fd = open(fifopath, O_WRONLY); + sleep(2); if(fd > 0) { if(signal_first == 1) @@ -119,6 +120,7 @@ dbus_g_proxy_connect_signal (proxy, "HelloSignal", G_CALLBACK (hello_signal_handler1), NULL, NULL); fd = open(fifopath, O_WRONLY); + sleep(2); if (fd > 0) { err = write(fd, buf1, strlen(buf1)); diff -r e5d77a29bdca -r 79045913e4e9 ofdbus/dbus/tsrc/testapps/match_rule_server/src/match_rule_server.c --- a/ofdbus/dbus/tsrc/testapps/match_rule_server/src/match_rule_server.c Thu Aug 05 20:12:17 2010 +0530 +++ b/ofdbus/dbus/tsrc/testapps/match_rule_server/src/match_rule_server.c Thu Aug 05 23:23:13 2010 +0530 @@ -177,6 +177,7 @@ if (fd > 0) { buf1 = "done2"; //for checkpoint 2 + sleep(2); err = write(fd, buf1, strlen(buf1)); close(fd); } diff -r e5d77a29bdca -r 79045913e4e9 stdlibs/libcrypt/test/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdlibs/libcrypt/test/group/bld.inf Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,41 @@ +// 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: +// Name : bld.inf +// Part of : +// This is a top level bld file to generate all libraries +// This material, including documentation and any related +// computer programs, is protected by copyright controlled by +// Nokia Corporation. All rights are reserved. Copying, +// including reproducing, storing, adapting or translating, any +// or all of this material requires the prior written consent of +// Nokia. This material also contains confidential +// information which may not be disclosed to others without the +// prior written consent of Nokia. +// + + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTEXPORTS +../scripts/tcrypt.script /epoc32/winscw/c/tcrypt/tcrypt.script +test_data.dat /epoc32/winscw/c/tcrypt/test_data.dat +libcrypttests.iby /epoc32/rom/include/libcrypttests.iby + +#ifndef GCCXML +PRJ_TESTMMPFILES +tcrypt.mmp +#endif + +// End of File \ No newline at end of file diff -r e5d77a29bdca -r 79045913e4e9 stdlibs/libcrypt/test/group/libcrypt_test.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdlibs/libcrypt/test/group/libcrypt_test.pkg Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,20 @@ +// 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: +// + + +//libcrypt +"\sf\os\ossrv\stdlibs\libcrypt\group\tcrypt.script"-"c:\tcrypt\tcrypt.script" +"\sf\os\ossrv\stdlibs\libcrypt\group\test_data.dat"-"c:\tcrypt\test_data.dat" + diff -r e5d77a29bdca -r 79045913e4e9 stdlibs/libcrypt/test/group/libcrypttests.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdlibs/libcrypt/test/group/libcrypttests.iby Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,26 @@ +// 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: +// + +#ifndef __LIBCRYPTTESTS_IBY__ +#define __LIBCRYPTTESTS_IBY__ + +#include "stdlibs.iby" +#include "testexecute.iby" + +//exes +file=ABI_DIR\BUILD_DIR\tcrypt.exe sys\bin\tcrypt.exe + +#endif + diff -r e5d77a29bdca -r 79045913e4e9 stdlibs/libcrypt/test/group/tcrypt.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdlibs/libcrypt/test/group/tcrypt.mmp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,42 @@ +// 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: +// + +TARGET tcrypt.exe +TARGETTYPE exe +UID 0x1000008D 0x1028308C + +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE tcrypt.cpp +SOURCE tcryptserver.cpp + +USERINCLUDE ../inc + + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +OS_LAYER_LIBC_SYSTEMINCLUDE + + +LIBRARY euser.lib efsrv.lib ecom.lib bafl.lib c32.lib xmlframework.lib hash.lib +LIBRARY testexecuteutils.lib +LIBRARY testexecutelogclient.lib +LIBRARY libcrypt.lib +LIBRARY libc.lib + +STATICLIBRARY libcrt0.lib + + +SMPSAFE diff -r e5d77a29bdca -r 79045913e4e9 stdlibs/libcrypt/test/group/test_data.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdlibs/libcrypt/test/group/test_data.dat Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,308 @@ +// COMMENTS SHOULD ALWAYS BEGIN IN A NEW LINE, NEVER EMBED COMMENTS WITHIN DATA + +ENCRYPT_TEST_DATA_1 +// To test setkey() and encrypt() functions with all zeroes as key and data +KEY :0000000000000000000000000000000000000000000000000000000000000000 +DATA_BLOCK :0000000000000000000000000000000000000000000000000000000000000000 +// A value of 0 indicates encryption +ED_FLAG :0 +EXPECTED_OUTPUT:1000110010100110010011011110100111000001101100010010001110100111 +END_TEST_DATA + +ENCRYPT_TEST_DATA_2 +// To test setkey() and encrypt() functions with all zeroes as key +KEY :0000000000000000000000000000000000000000000000000000000000000000 +DATA_BLOCK :0000100110000000000000011110110100001001100001010000010100101100 +// A value of 0 indicates encryption +ED_FLAG :0 +EXPECTED_OUTPUT:0110110110000110111111010111001001101010001000001011011010110001 +END_TEST_DATA + +ENCRYPT_TEST_DATA_3 +// To test setkey() and encrypt() functions with all ones in the bit vectors of +// both key and data +KEY :1111111111111111111111111111111111111111111111111111111111111111 +DATA_BLOCK :1111111111111111111111111111111111111111111111111111111111111111 +// A value of 0 indicates encryption +ED_FLAG :0 +EXPECTED_OUTPUT:0111001101011001101100100001011000111110010011101101110001011000 +END_TEST_DATA + +ENCRYPT_TEST_DATA_4 +// To test setkey() and encrypt() functions with all ones in the bit vector of +// key +KEY :1111111111111111111111111111111111111111111111111111111111111111 +DATA_BLOCK :0111000101110011011000110111010011010001011010010110111101111111 +// A value of 0 indicates encryption +ED_FLAG :0 +EXPECTED_OUTPUT:1101100001000111000111011001010111011111101101101111101010001100 +END_TEST_DATA + +ENCRYPT_TEST_DATA_5 +// To test setkey() and encrypt() functions +KEY :0101101001111010101010100101110001111101101010100111011111101010 +DATA_BLOCK :0000100110000000000000011110110100001001100001010000010100101100 +// A value of 0 indicates encryption +ED_FLAG :0 +EXPECTED_OUTPUT:1001110010101010100010100010111111100110001001001101000000111110 +END_TEST_DATA + +ENCRYPT_TEST_DATA_6 +// To test setkey() and encrypt() functions. KEY value is unchanged +KEY :0101101001111010101010100101110001111101101010100111011111101010 +DATA_BLOCK :0111000101110011011000110111010011010001011010010110111101111111 +// A value of 0 indicates encryption +ED_FLAG :0 +EXPECTED_OUTPUT:1010100110000001111010011100110101001111111010111001100000110100 +END_TEST_DATA + +ENCRYPT_TEST_DATA_7 +// To test setkey() and encrypt() function. Key value is unchanged +KEY :0101101001111010101010100101110001111101101010100111011111101010 +DATA_BLOCK :0000000000000000000000000000000000000000000000000000000000000000 +// A value of 0 indicates encryption +ED_FLAG :0 +EXPECTED_OUTPUT:1111111101110111111110100101100000110110100100001110000110111111 +END_TEST_DATA + +ENCRYPT_TEST_DATA_8 +// To test setkey() and encrypt() function. Key value is unchanged +KEY :0101101001111010101010100101110001111101101010100111011111101010 +DATA_BLOCK :1111111111111111111111111111111111111111111111111111111111111111 +// A value of 0 indicates encryption +ED_FLAG :0 +EXPECTED_OUTPUT: 1111110011010110011011000110100010111111001110111000011111101100 +END_TEST_DATA + +ENCRYPT_TEST_DATA_9 +// To test setkey() and encrypt() function. ED_FLAG changed to denote a decrypt action. +KEY :0101101001111010101010100101110001111101101010100111011111101010 +DATA_BLOCK :1111110011010110011011000110100010111111001110111000011111101100 +// A value of 0 indicates encryption +ED_FLAG :1 +EXPECTED_OUTPUT: 11111111111111111111111111111111111111111111111111111111111111111 +END_TEST_DATA + +CRYPT_TEST_DATA_1 +// To test crypt() function - DES algorithm. Password-eight characters in length +PASSWORD :password +SALT :XY +EXPECTED_OUTPUT:XYGpusIMIT/IM +END_TEST_DATA + +CRYPT_TEST_DATA_2 +// To test crypt() function - DES algorithm. Password-less than eight characters +// in length +PASSWORD :passS +SALT :XY +EXPECTED_OUTPUT:XYGFf3I4Sg2K2 +END_TEST_DATA + +CRYPT_TEST_DATA_3 +// To test crypt() function - DES algorithm. Password-less than eight characters +// in length +PASSWORD :pa +SALT :9D +EXPECTED_OUTPUT:9DWVv8b/n8C2M +END_TEST_DATA + +CRYPT_TEST_DATA_4 +// To test crypt() function - DES algorithm. Password-more than eight characters +// in length +PASSWORD :passwordXYTEY +SALT :.Q +EXPECTED_OUTPUT:.Q7kADsEJ1WMI +END_TEST_DATA + +CRYPT_TEST_DATA_5 +// To test crypt() function - DES algorithm. Password-more than eight characters +// in length - notice that the output depends on the first eight characters of +// the passowrd and "salt". +PASSWORD :passwordXY367USH +SALT :.Q +EXPECTED_OUTPUT:.Q7kADsEJ1WMI +END_TEST_DATA + +CRYPT_TEST_DATA_6 +// To test crypt() function - DES algorithm. NULL as password with a valid "salt" +PASSWORD : +SALT :.Q +EXPECTED_OUTPUT:.QJ.W2gUJgXaI +END_TEST_DATA + +CRYPT_TEST_DATA_7 +// To test crypt() function - DES algorithm. NULL as password with a valid "salt" +PASSWORD : +SALT :YU +EXPECTED_OUTPUT:YU6VVzA5TJabA +END_TEST_DATA + +CRYPT_TEST_DATA_8 +// To test crypt() function - DES algorithm. NULL as password with a valid "salt" +PASSWORD : +SALT :/. +EXPECTED_OUTPUT:/.elhbtlysKy6 +END_TEST_DATA + +CRYPT_TEST_DATA_9 +// To test crypt() function - DES algorithm. NULL as password with a valid "salt" +PASSWORD : +SALT :// +EXPECTED_OUTPUT://plGAV7Hp3Zo +END_TEST_DATA + +CRYPT_TEST_DATA_10 +// To test crypt() function - DES algorithm. NULL as password with a valid "salt" +PASSWORD : +SALT :aB +EXPECTED_OUTPUT:aBtwyC/9wKybE +END_TEST_DATA + +CRYPT_TEST_DATA_11 +// To test crypt() function - DES algorithm. Valid password with a "salt" which +// is one-character in length. Output differs from that of Linux's +PASSWORD :OuEIW90I +SALT :a +EXPECTED_OUTPUT: +END_TEST_DATA + +CRYPT_TEST_DATA_12 +// To test crypt() function - DES algorithm. Valid password with a "salt" which +// is longer two characters in length +PASSWORD :OuEIW90I +SALT :iKOI0 +EXPECTED_OUTPUT:iKr4GcNvuB/Wk +END_TEST_DATA + +CRYPT_TEST_DATA_13 +// To test crypt() function - DES algorithm. A valid password and no "salt" +// Output differs from that of Linux's +PASSWORD :uShyU7w9 +SALT : +EXPECTED_OUTPUT: +END_TEST_DATA + +CRYPT_TEST_DATA_14 +// To test crypt() function. Both password and salt being +// NULL. Output differs from that of Linux's +PASSWORD : +SALT : +EXPECTED_OUTPUT: +END_TEST_DATA + +CRYPT_TEST_DATA_15 +// To test crypt() function - MD5 algorithm. Both password and salt +// are valid +PASSWORD :password +SALT :$1$ +EXPECTED_OUTPUT:$1$$I2o9Z7NcvQAKp7wyCTlia0 +END_TEST_DATA + +CRYPT_TEST_DATA_16 +// To test crypt() function - MD5 algorithm. Both password and salt +// are valid with password being more than 8 characters in length +PASSWORD :passwordUEI091H +SALT :$1$ +EXPECTED_OUTPUT:$1$$V1X9nybzyUbSXdm8CAqve. +END_TEST_DATA + +CRYPT_TEST_DATA_018 +// To test crypt() function - MD5 algorithm. Both password and salt +// are valid with password being more than 8 characters in length, and +// '/' embedded within the string. Salt consists of "$1$" followed +// by eight characters, and terminated by "$" +PASSWORD :pass//rdI09Y. +SALT :$1$password$ +EXPECTED_OUTPUT:$1$password$PnpYLDVZ8stpwScDiSk170 +END_TEST_DATA + +CRYPT_TEST_DATA_17 +// To test crypt() function - MD5 algorithm. Both password and salt +// are valid with password being more than 8 characters in length, and +// '/' embedded within the string. Salt consists of "$1$" followed +// by eight characters, and NOT terminated by "$" +PASSWORD :pass//rdI09Y. +SALT :$1$password +EXPECTED_OUTPUT:$1$password$PnpYLDVZ8stpwScDiSk170 +END_TEST_DATA + +CRYPT_TEST_DATA_18 +// To test crypt() function - MD5 algorithm. Both password and salt +// are valid with password being more than 8 characters in length, and +// '/' embedded within the string. Salt consists of just "$1$" +PASSWORD :pass//rdI09Y. +SALT :$1$ +EXPECTED_OUTPUT:$1$$Q.yyUXhIuZxEiqLaLs9Yt/ +END_TEST_DATA + +CRYPT_TEST_DATA_19 +// To test crypt() function - MD5 algorithm. Both password and salt +// are valid with the length of the password being less than 8. +// Salt consists of just "$1$" +PASSWORD ://URi +SALT :$1$ +EXPECTED_OUTPUT:$1$$dNOmQGH620K312nN0mn1H/ +END_TEST_DATA + +CRYPT_TEST_DATA_20 +// To test crypt() function - MD5 algorithm. Both password and salt +// are valid with the length of the password being less than 8. +// Salt consists of "$1$" followed by a string, and terminated by +// "$" +PASSWORD ://URi +SALT :$1$paU7$ +EXPECTED_OUTPUT:$1$paU7$L1IzpLbp2c1NZn1fI5ZF3/ +END_TEST_DATA + +CRYPT_TEST_DATA_21 +// To test crypt() function - MD5 algorithm. Both password and salt +// are valid with the length of the password being less than 8. +// Salt consists of "$1$" followed by a string, and NOT terminated by +// "$" +PASSWORD ://URi +SALT :$1$paU7 +EXPECTED_OUTPUT:$1$paU7$L1IzpLbp2c1NZn1fI5ZF3/ +END_TEST_DATA + +CRYPT_TEST_DATA_22 +// To test crypt() function - MD5 algorithm. Both password and salt +// are valid with the length of the password being less than 8. +// Salt consists of just "$1$" +PASSWORD ://URi +SALT :$1$ +EXPECTED_OUTPUT:$1$$dNOmQGH620K312nN0mn1H/ +END_TEST_DATA + +CRYPT_TEST_DATA_23 +// To test crypt() function - MD5 algorithm. NULL as password and "$1$" +// as salt +PASSWORD : +SALT :$1$ +EXPECTED_OUTPUT:$1$$qRPK7m23GJusamGpoGLby/ +END_TEST_DATA + +CRYPT_TEST_DATA_24 +// To test crypt() function - MD5 algorithm. NULL as password. Salt consists +// of "$1$" followed by a string, and terminated by "$" +PASSWORD : +SALT :$1$oI./$ +EXPECTED_OUTPUT:$1$oI./$rZsQHWhxaiZQFk7TPVtZv0 +END_TEST_DATA + +CRYPT_TEST_DATA_25 +// To test crypt() function - MD5 algorithm. NULL as password. Salt consists +// of "$1$" followed by a string with a "$" embedded within the string, and +// NOT terminated by "$" +PASSWORD : +SALT :$1$o$./ +EXPECTED_OUTPUT:$1$o$q44o3M/kTKnXAewu70WtZ/ +END_TEST_DATA + +CRYPT_TEST_DATA_26 +// To test crypt() function - MD5 algorithm. NULL as password. Salt consists +// of "$1$" followed by a string, and NOT terminated by "$" +PASSWORD : +SALT :$1$oi8URVn +EXPECTED_OUTPUT:$1$oi8URVn$f8o6zSdfLb/OggBchx70f0 +END_TEST_DATA + diff -r e5d77a29bdca -r 79045913e4e9 stdlibs/libcrypt/test/inc/tcrypt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdlibs/libcrypt/test/inc/tcrypt.h Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,72 @@ +/* +/* +* 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: +* +*/ + +#ifndef __TESTCRYPT_H__ +#define __TESTCRYPT_H__ + +#include +// For file input/output +#include +#include + +_LIT(KEncrypt, "Encrypt"); +_LIT(KCrypt, "Crypt"); + +class CTestCrypt : public CTestStep + { +public: + + ~CTestCrypt(); + CTestCrypt(const TDesC& aStepName); + TVerdict doTestStepL(); + TVerdict doTestStepPreambleL(); + TVerdict doTestStepPostambleL(); + +private: + /* + * Test method to test encrypt() API + */ + virtual TInt Encrypt(); + + /* + * Test method to test crypt() API + */ + virtual TInt Crypt(); + + /* + * To reposition the file pointer to the line following the + * requested string, in this case the "test data ID" + */ + int RepositionFilePointer(const char *aString); + + /* + * Retrieve's the test data for the encrypt() and setkey() + * functions + */ + TInt GetEncryptTestData(char key[], char block[], int *edflag, char output[]); + + TInt GetCryptTestData(char[], char[], char[]); + + +private: // Data + + FILE *iTestDataFile; + }; + +#endif + diff -r e5d77a29bdca -r 79045913e4e9 stdlibs/libcrypt/test/inc/tcryptserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdlibs/libcrypt/test/inc/tcryptserver.h Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,37 @@ +/* +* 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: +* +*/ + + + +#ifndef __TCRYPTOSERVER_H__ +#define __TCRYPTOSERVER_H__ + +#include +#include + +class CTestCryptServer : public CTestServer + { +public: + static CTestCryptServer* NewL(); + virtual CTestStep* CreateTestStep(const TDesC& aStepName); + RFs& Fs() {return iFs;} + +private: + RFs iFs; + }; + +#endif // diff -r e5d77a29bdca -r 79045913e4e9 stdlibs/libcrypt/test/scripts/tcrypt.script --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdlibs/libcrypt/test/scripts/tcrypt.script Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,58 @@ +// 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: +// + +PRINT Run all tcrypt +LOAD_SUITE tcrypt + +CONSECUTIVE + +RUN_TEST_STEP !Result=0 5 tcrypt Encrypt +RUN_TEST_STEP !Result=0 5 tcrypt Encrypt +RUN_TEST_STEP !Result=0 5 tcrypt Encrypt +RUN_TEST_STEP !Result=0 5 tcrypt Encrypt +RUN_TEST_STEP !Result=0 5 tcrypt Encrypt +RUN_TEST_STEP !Result=0 5 tcrypt Encrypt +RUN_TEST_STEP !Result=0 5 tcrypt Encrypt +RUN_TEST_STEP !Result=0 5 tcrypt Encrypt +RUN_TEST_STEP !Result=0 5 tcrypt Encrypt + +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt +RUN_TEST_STEP !Result=0 5 tcrypt Crypt + + diff -r e5d77a29bdca -r 79045913e4e9 stdlibs/libcrypt/test/src/tcrypt.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdlibs/libcrypt/test/src/tcrypt.cpp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,473 @@ +/* +* 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 FILES +#include +#include "tcrypt.h" + +// EXTERNAL FUNCTION PROTOTYPES +extern "C" { +IMPORT_C char *crypt(const char *key, const char *salt); +IMPORT_C void setkey(const char *key); +IMPORT_C void encrypt(char block[], int edflag); +} + +// LOCAL FUNCTION PROTOTYPES +LOCAL_C void GetBitVector(char data[], char* buffer); +LOCAL_C char *TrimWhiteSpaces(char *string); + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// TrimWhiteSpaces +// To to trim whitespaces in the input string +// ----------------------------------------------------------------------------- +// +LOCAL_C char *TrimWhiteSpaces(char *string) +{ + char *pTemp = string; + for(;*string != '\0'; string++) + { + if((*string == ' ') || (*string == '\t')) + { + pTemp++; + } + } + + return pTemp; +} + +// ----------------------------------------------------------------------------- +// GetBitVector +// This function unpacks the byte to obtain the corresponding bit vector +// ----------------------------------------------------------------------------- +// +LOCAL_C void GetBitVector(char data[], char* buffer) +{ + int temp; + if(buffer != NULL ) + { + temp = strlen(buffer); + for(int i = 0 ; i(err) : EPass); + } + else if(TestStepName() == KCrypt) + { + INFO_PRINTF1(_L("Crypt():")); + err = Crypt(); + SetTestStepResult(err ? static_cast(err) : EPass); + } + + return TestStepResult(); + } + + +// ----------------------------------------------------------------------------- +// CTestCrypt::Encrypt +// Encrypt function +// ----------------------------------------------------------------------------- +// +TInt CTestCrypt::Encrypt() +{ + static int tId = 0; + char pTemp[30]; + memset(pTemp, 0, 30); + sprintf(pTemp, "ENCRYPT_TEST_DATA_%d", ++tId); + INFO_PRINTF2(_L("Begin: ENCRYPT_TEST_DATA_%d\n"), tId); + + // locate "test_data_id" from within the file + if(!RepositionFilePointer(pTemp)) + { + // String not found...invalid test data ID + INFO_PRINTF1(_L("Requested test data ID could not be found\n")); + return KErrNotFound; + } + + // Get the key, data block, operation to be performed and the + // expected output for the current test data ID + char key[64] = + { + 0 + }; + char block[64] = + { + 0 + }; + char output[64] = + { + 0 + }; + int edflag = -1; + if(GetEncryptTestData(key, block, &edflag, output) != KErrNone) + { + // Test data not found or is not present in the expected + // format + INFO_PRINTF1(_L("Test data not found or is not present in the expected format\n")); + return KErrNotFound; + } + + // Perform encryption/decryption + + // Invoke setkey from the libcrypt library + setkey(key); + + // Call the encrypt function + encrypt(block,edflag); + + // Verify if the final output is same as the expected output + + if(!strcmp(block,block)) + { + INFO_PRINTF2(_L("End: ENCRYPT_TEST_DATA_%d\n"), tId); + // Test case passed + return KErrNone; + } + INFO_PRINTF1(_L("Output from the encrypt() function does not match the \"expected output\"")); + INFO_PRINTF2(_L("End: ENCRYPT_TEST_DATA_%d\n"), tId); + return KErrNotFound; +} + +// ----------------------------------------------------------------------------- +// CTestCrypt::RepositionFilePointer +// This function positions the file pointer to the line immediately following +// the string aString +// ----------------------------------------------------------------------------- +// + +TInt CTestCrypt::RepositionFilePointer(const char *aString) +{ + char buffer[256]; + char * ptr = NULL; + while(fgets((char*)buffer, 256, iTestDataFile) != NULL) + { + ptr = NULL; + + if((ptr=strchr(buffer,'\r')) || (ptr=strchr(buffer,'\n'))) //check for both + *ptr='\0'; + if(!strcmp(buffer, aString)) + { + return 1; + } + memset(buffer, 0, 256); + } + return 0; +} + +// ----------------------------------------------------------------------------- +// CTestCrypt::GetEncryptTestData +// This function reads the test data for encrypt() API +// ----------------------------------------------------------------------------- +// +TInt CTestCrypt::GetEncryptTestData(char key[], char block[], int *edflag, char output[]) +{ + char buffer[256]; + char *p = NULL; + bool bKey = false, // will be set to true upon reading 'key' + bBlock = false, // will be set to true upon reading 'data block' + bEdflag = false, // will be set to true upon reading 'edflag' + bOutput = false; // will be set to true upon reading 'expected output' + + char *pTemp = NULL; + char * ptr = NULL; + + while((p = fgets(buffer, 256, iTestDataFile)) != NULL) + { + + ptr = NULL; + + if((ptr=strchr(buffer,'\r')) || (ptr=strchr(buffer,'\n'))) //check for both + *ptr='\0'; + if(strstr(buffer, "//") != NULL) + { + continue; + } + if(!strcmp(buffer, "END_TEST_DATA")) + { + if(bKey && bBlock && bEdflag && bOutput) + { + return KErrNone; + } + return KErrNotFound; + } + if(strstr(buffer, "KEY") != NULL) + { + // Read the key + + // Get bytes... + pTemp = strstr(buffer, ":"); + if(pTemp != NULL) + { + pTemp++; + pTemp = TrimWhiteSpaces(pTemp); + GetBitVector(key, pTemp); + } + bKey = true; + continue; + } + if(strstr(buffer, "DATA_BLOCK") != NULL) + { + // Read the data block + + pTemp = strstr(buffer, ":"); + if(pTemp != NULL) + { + pTemp++; + pTemp = TrimWhiteSpaces(pTemp); + GetBitVector(block, pTemp); + } + bBlock = true; + continue; + } + if(strstr(buffer, "ED_FLAG") != NULL) + { + // Read the ed_flag parameter + + pTemp = strstr(buffer, ":"); + if(pTemp != NULL) + { + pTemp++; + pTemp = TrimWhiteSpaces(pTemp); + *edflag = (*pTemp) - '0'; + } + bEdflag = true; + continue; + } + if(strstr(buffer, "EXPECTED_OUTPUT") != NULL) + { + // Read the bit vector for the expected output + + pTemp = strstr(buffer, ":"); + if(pTemp != NULL) + { + pTemp++; + pTemp = TrimWhiteSpaces(pTemp); + GetBitVector(output, pTemp); + } + bOutput = true; + continue; + } + } + + return KErrNotFound; +} + +// ----------------------------------------------------------------------------- +// CTestCrypt::Crypt +// Test function to perform crypt() on the input data +// ----------------------------------------------------------------------------- +// +TInt CTestCrypt::Crypt() +{ + static int tId = 0; + char pTemp[30]; + memset(pTemp, 0, 30); + sprintf(pTemp, "CRYPT_TEST_DATA_%d", ++tId); + INFO_PRINTF2(_L("Begin CRYPT_TEST_DATA_%d\n"), tId); + + // locate "test_data_id" from within the file + if(!RepositionFilePointer(pTemp)) + { + // String not found...invalid test data ID + INFO_PRINTF1(_L("Requested test data ID could not be found\n")); + return KErrNotFound; + } + + char password[34] = + { + '\0' + }; + char salt[30] = + { + '\0' + }; + char output[35] = + { + '\0' + }; + + if(GetCryptTestData(password, salt, output) != KErrNone) + { + // Data not in the expected format or is invalid + INFO_PRINTF1(_L("Test data not found or is not present in the expected format\n")); + return KErrNotFound; + } + + char *crypt_output = NULL; + // Invoke crypt() + crypt_output = crypt(password,salt); + if(!strcmp(output,"")) + { + // Since salt is NULL, the expected output is ignored... + return KErrNone; + } + if(!strcmp(salt, "")) + { + // salt is NULL, so skip the first byte from the crypt output + if(crypt_output != NULL) + { + crypt_output++; + if(!strcmp(crypt_output, &output[0])) + { + INFO_PRINTF2(_L("End: CRYPT_TEST_DATA_%d\n"), tId); + return KErrNone; + } + INFO_PRINTF1(_L("Output from the crypt() function does not match the \"expected output\"")); + return KErrNotFound; + } + } + else + { + // salt is not NULL + if(!strcmp(crypt_output, output)) + { + INFO_PRINTF2(_L("End: CRYPT_TEST_DATA_%d\n"), tId); + return KErrNone; + } + INFO_PRINTF1(_L("Output from the crypt() function does not match the \"expected output\"")); + return KErrNotFound; + } + return KErrNotFound; +} + +// ----------------------------------------------------------------------------- +// CTestCrypt::GetCryptTestData +// To retrieve the test data for crypt() API +// ----------------------------------------------------------------------------- +// +TInt CTestCrypt::GetCryptTestData(char password[], char salt[], char output[]) +{ + char buffer[256]; + char *p = NULL; + char *pTemp = NULL; + int nLength = 0; + bool bPassword = false, + bSalt = false, + bOutput = false; + char * ptr = NULL; + + while((p = fgets(buffer, 256, iTestDataFile)) != NULL) + { + ptr = NULL; + + if((ptr=strchr(buffer,'\r')) || (ptr=strchr(buffer,'\n'))) //check for both + *ptr='\0'; + if(strstr(buffer, "//") != NULL) // skip the comments + { + // "//" could appear within password or salt, so further + // check is required + + // Since judicious use of whitespaces is allowed only from within + // the comment lines, the comment line will always start with + // "//" + if(buffer[0] == '/' && buffer[1] == '/') + { + continue; + } + } + if(!strcmp(buffer, "END_TEST_DATA")) + { + if(bPassword && bSalt && bOutput) + { + return KErrNone; + } + return KErrNotFound; + } + + // Verify if the input buffer has "data". Data is followed by ":" + pTemp = strstr(buffer, ":"); + if(pTemp != NULL) + { + pTemp++; + pTemp = TrimWhiteSpaces(pTemp); + nLength = strlen(pTemp); + if(strstr(buffer, "PASSWORD") != NULL) + { + strncpy(password,pTemp,nLength); + bPassword = true; + continue; + } + else if(strstr(buffer, "SALT") != NULL) + { + strncpy(salt,pTemp,nLength); + bSalt = true; + continue; + } + else if(strstr(buffer, "EXPECTED_OUTPUT") != NULL) + { + strncpy(output,pTemp,nLength); + bOutput = true; + continue; + } + else + { + // Unexpected output + return KErrNotFound; + } + } + } + return KErrNotFound; +} + +// End of File + diff -r e5d77a29bdca -r 79045913e4e9 stdlibs/libcrypt/test/src/tcryptserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdlibs/libcrypt/test/src/tcryptserver.cpp Thu Aug 05 23:23:13 2010 +0530 @@ -0,0 +1,112 @@ +/* +* 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 + +#if defined (__WINS__) +#define PDD_NAME _L("ECDRV") +#else +#define PDD_NAME _L("EUART1") +#define PDD2_NAME _L("EUART2") +#define PDD3_NAME _L("EUART3") +#define PDD4_NAME _L("EUART4") +#endif + +#define LDD_NAME _L("ECOMM") + +/** + * @file + * + * Pipe test server implementation + */ +#include "tcryptserver.h" +#include "tcrypt.h" + +_LIT(KServerName, "tcrypt"); + +CTestCryptServer* CTestCryptServer::NewL() + { + CTestCryptServer *server = new(ELeave) CTestCryptServer(); + CleanupStack::PushL(server); + server->ConstructL(KServerName); + CleanupStack::Pop(server); + return server; + } + +static void InitCommsL() + { + TInt ret = User::LoadPhysicalDevice(PDD_NAME); + User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret); + +#ifndef __WINS__ + ret = User::LoadPhysicalDevice(PDD2_NAME); + ret = User::LoadPhysicalDevice(PDD3_NAME); + ret = User::LoadPhysicalDevice(PDD4_NAME); +#endif + + ret = User::LoadLogicalDevice(LDD_NAME); + User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret); + ret = StartC32(); + User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret); + } +LOCAL_C void MainL() + { + // Leave the hooks in for platform security +#if (defined __DATA_CAGING__) + RProcess().DataCaging(RProcess::EDataCagingOn); + RProcess().SecureApi(RProcess::ESecureApiOn); +#endif + //InitCommsL(); + CActiveScheduler* sched=NULL; + sched=new(ELeave) CActiveScheduler; + CActiveScheduler::Install(sched); + CTestCryptServer* server = NULL; + // Create the CTestServer derived server + TRAPD(err, server = CTestCryptServer::NewL()); + if(!err) + { + // Sync with the client and enter the active scheduler + RProcess::Rendezvous(KErrNone); + sched->Start(); + } + delete server; + delete sched; + } + +/** + * Server entry point + * @return Standard Epoc error code on exit + */ +TInt main() + { + TRAP_IGNORE(MainL()); + return KErrNone; + } + +CTestStep* CTestCryptServer::CreateTestStep(const TDesC& aStepName) + { + CTestStep* testStep = NULL; + + // This server creates just one step but create as many as you want + // They are created "just in time" when the worker thread is created + // install steps + if (aStepName == KEncrypt) + testStep = new CTestCrypt(aStepName); + else if (aStepName == KCrypt) + testStep = new CTestCrypt(aStepName); + return testStep; + }