glib/tsrc/glib_nonstif/src/dir_test.c
branchRCL_3
changeset 57 2efc27d87e1c
parent 0 e4d67989cc36
equal deleted inserted replaced
56:acd3cd4aaceb 57:2efc27d87e1c
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #undef G_DISABLE_ASSERT
       
    22 #undef G_LOG_DOMAIN
       
    23 
       
    24 #include <stdio.h>
       
    25 #include <string.h>
       
    26 #include <sys/stat.h>
       
    27 #include "glib.h"
       
    28 
       
    29 #ifdef __SYMBIAN32__
       
    30 #include "mrt2_glib2_test.h"
       
    31 #endif /*__SYMBIAN32__*/
       
    32 
       
    33 
       
    34 int main (int   argc,char *argv[])
       
    35 {
       
    36 	GDir *dir;
       
    37 	GError *error;	
       
    38 	int ret;
       
    39 	ret = mkdir("c:\\temp", 0666);
       
    40 	g_print("mkdir for temp returns %d and error is %d", ret, errno);
       
    41 	ret = mkdir("c:\\temp\\tmp", 0666);
       
    42 	g_print("mkdir for temp returns %d and error is %d", ret, errno);
       
    43 	#ifdef __SYMBIAN32__
       
    44 	g_log_set_handler (NULL,  G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING | G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG, &mrtLogHandler, NULL);
       
    45 	g_set_print_handler(mrtPrintHandler);	
       
    46 	#endif /*SYMBIAN*/
       
    47 	
       
    48 	dir = g_dir_open("c:\\temp",0,&error);
       
    49 	
       
    50 	g_assert(dir != NULL);
       
    51 	
       
    52 	g_assert(!strcmp(g_dir_read_name(dir),"tmp"));
       
    53 	
       
    54 	g_dir_close(dir);
       
    55 	
       
    56 	#if __SYMBIAN32__
       
    57   	testResultXml("dir_test");
       
    58   	#endif /* EMULATOR */
       
    59 
       
    60 	rmdir("c:\\temp\\tmp");
       
    61 	rmdir("c:\\temp");
       
    62 	return 0;
       
    63 }