1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/glib/tsrc/BC/src/log_manual1.c Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,58 @@
1.4 +/*
1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.6 +*
1.7 +* This library is free software; you can redistribute it and/or
1.8 +* modify it under the terms of the GNU Lesser General Public
1.9 +* License as published by the Free Software Foundation; either
1.10 +* version 2 of the License, or (at your option) any later version.
1.11 +*
1.12 +* This library is distributed in the hope that it will be useful,
1.13 +* but WITHOUT ANY WARRANTY; without even the implied warranty of
1.14 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.15 +* Lesser General Public License for more details.
1.16 +*
1.17 +* You should have received a copy of the GNU Lesser General Public
1.18 +* License along with this library; if not, write to the
1.19 +* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1.20 +* Boston, MA 02111-1307, USA.
1.21 +*
1.22 +* Description:
1.23 +*
1.24 +*/
1.25 +
1.26 +
1.27 +
1.28 +// This is a manual test case. When the test case is executed, the getchar() atthe
1.29 +// end is not executed, because the fatal mask is set and g_log calls abort().
1.30 +
1.31 +#undef G_DISABLE_ASSERT
1.32 +#undef G_LOG_DOMAIN
1.33 +
1.34 +#include <stdio.h>
1.35 +#include <string.h>
1.36 +#include "glib.h"
1.37 +
1.38 +#ifdef SYMBIAN
1.39 +#include "mrt2_glib2_test.h"
1.40 +#endif /*SYMBIAN*/
1.41 +
1.42 +
1.43 +int main (int argc,char *argv[])
1.44 +{
1.45 + #ifdef SYMBIAN
1.46 + 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);
1.47 + g_set_print_handler(mrtPrintHandler);
1.48 + #endif /*SYMBIAN*/
1.49 +
1.50 + printf("The following test case will abort\n when u press the enter key\n");
1.51 + printf("If you see any other message after \nthis message, consider the test\ncase as failed\n");
1.52 + getchar();
1.53 +
1.54 + g_log_set_fatal_mask(NULL,G_LOG_LEVEL_MESSAGE);
1.55 +
1.56 + g_log(NULL,G_LOG_LEVEL_MESSAGE,"test message");
1.57 +
1.58 + g_print("log_manual1 failed");
1.59 +
1.60 + getchar();
1.61 +}