os/ossrv/glib/tsrc/BC/src/log_manual1.c
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
sl@0
     3
*
sl@0
     4
* This library is free software; you can redistribute it and/or
sl@0
     5
* modify it under the terms of the GNU Lesser General Public
sl@0
     6
* License as published by the Free Software Foundation; either
sl@0
     7
* version 2 of the License, or (at your option) any later version.
sl@0
     8
*
sl@0
     9
* This library is distributed in the hope that it will be useful,
sl@0
    10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
sl@0
    11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
sl@0
    12
* Lesser General Public License for more details.
sl@0
    13
*
sl@0
    14
* You should have received a copy of the GNU Lesser General Public
sl@0
    15
* License along with this library; if not, write to the
sl@0
    16
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
sl@0
    17
* Boston, MA 02111-1307, USA.
sl@0
    18
*
sl@0
    19
* Description:
sl@0
    20
*
sl@0
    21
*/
sl@0
    22
sl@0
    23
sl@0
    24
sl@0
    25
// This is a manual test case. When the test case is executed, the getchar() atthe 
sl@0
    26
// end is not executed, because the fatal mask is set and g_log calls abort().
sl@0
    27
sl@0
    28
#undef G_DISABLE_ASSERT
sl@0
    29
#undef G_LOG_DOMAIN
sl@0
    30
sl@0
    31
#include <stdio.h>
sl@0
    32
#include <string.h>
sl@0
    33
#include "glib.h"
sl@0
    34
sl@0
    35
#ifdef SYMBIAN
sl@0
    36
#include "mrt2_glib2_test.h"
sl@0
    37
#endif /*SYMBIAN*/
sl@0
    38
sl@0
    39
sl@0
    40
int main (int argc,char *argv[])
sl@0
    41
{
sl@0
    42
	#ifdef SYMBIAN
sl@0
    43
    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);
sl@0
    44
	g_set_print_handler(mrtPrintHandler);
sl@0
    45
	#endif /*SYMBIAN*/
sl@0
    46
	
sl@0
    47
	printf("The following test case will abort\n when u press the enter key\n");
sl@0
    48
	printf("If you see any other message after \nthis message, consider the test\ncase as failed\n");
sl@0
    49
	getchar();
sl@0
    50
	
sl@0
    51
	g_log_set_fatal_mask(NULL,G_LOG_LEVEL_MESSAGE);
sl@0
    52
	
sl@0
    53
	g_log(NULL,G_LOG_LEVEL_MESSAGE,"test message");
sl@0
    54
	
sl@0
    55
	g_print("log_manual1 failed");
sl@0
    56
	
sl@0
    57
	getchar();
sl@0
    58
}