sl@0: // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: //
sl@0: 
sl@0: #undef G_DISABLE_ASSERT
sl@0: #undef G_LOG_DOMAIN
sl@0: 
sl@0: #include <glib.h>
sl@0: #include <errno.h>
sl@0: #define LOG_FILE "c:\\logs\\unichar_test_log.txt"
sl@0: #include "std_log_result.h"
sl@0: #define LOG_FILENAME_LINE __FILE__, __LINE__
sl@0: 
sl@0: void create_xml(int result)
sl@0: {
sl@0:     if(result)
sl@0:         assert_failed = 1;
sl@0:     
sl@0:     testResultXml("unichar_testlog");
sl@0:     close_log_file();
sl@0: }
sl@0: 
sl@0: int main (int argc, char *argv[])
sl@0: {  
sl@0:     gunichar ret;
sl@0:     gunichar mark = 0x0BCA; //spacing mark. Tamil letter. 
sl@0:     gunichar title = 0x01F2; //Latin letter.
sl@0:     gunichar square = 0x25A1; //white square
sl@0:     gunichar space = 0x200B; //zero width space
sl@0:     gunichar tel_symbol = 0x32C0; //telegraphic symbol for january
sl@0:     gunichar CR = 0x000D; //carriage return
sl@0:     GUnicodeBreakType type;
sl@0:     
sl@0:     g_unichar_get_mirror_char('(', &ret);
sl@0:     
sl@0:     if(!(')' == ret))
sl@0:         {
sl@0:         std_log(LOG_FILENAME_LINE,"g_unichar_get_mirror_char didnt work as expected");
sl@0:         assert_failed = 1;
sl@0:         }
sl@0:     
sl@0:     
sl@0:     if(!g_unichar_ismark(mark))
sl@0:         {
sl@0:         std_log(LOG_FILENAME_LINE,"g_unichar_ismark didnt work as expected");
sl@0:         assert_failed = 1;
sl@0:         }
sl@0:     
sl@0:     if(!g_unichar_istitle(title))
sl@0:         {
sl@0:         std_log(LOG_FILENAME_LINE,"g_unichar_istitle didnt work as expected");
sl@0:         assert_failed = 1;
sl@0:         }
sl@0:     
sl@0:     if(!g_unichar_isdefined(square))
sl@0:         {
sl@0:         std_log(LOG_FILENAME_LINE,"g_unichar_isdefined didnt work as expected");
sl@0:         assert_failed = 1;
sl@0:         }
sl@0:     
sl@0:     if(!g_unichar_iszerowidth(space))
sl@0:         {
sl@0:         std_log(LOG_FILENAME_LINE,"g_unichar_iszerowidth didnt work as expected");
sl@0:         assert_failed = 1;
sl@0:         }
sl@0:     
sl@0:     if(!g_unichar_iswide(tel_symbol))
sl@0:         {
sl@0:         std_log(LOG_FILENAME_LINE,"g_unichar_iswide didnt work as expected");
sl@0:         assert_failed = 1;
sl@0:         }
sl@0:     
sl@0:     if(!g_unichar_iswide_cjk(tel_symbol))
sl@0:         {
sl@0:         std_log(LOG_FILENAME_LINE,"g_unichar_iswide_cjk didnt work as expected");
sl@0:         assert_failed = 1;
sl@0:         }
sl@0:     
sl@0:     ret = g_unichar_totitle('a');
sl@0:     if(!(ret == 'A'))
sl@0:         {
sl@0:         std_log(LOG_FILENAME_LINE,"g_unichar_totitle didnt work as expected");
sl@0:         assert_failed = 1;
sl@0:         }
sl@0:     
sl@0:     type = g_unichar_break_type(CR);
sl@0:     if(type != G_UNICODE_BREAK_CARRIAGE_RETURN)
sl@0:         {
sl@0:         std_log(LOG_FILENAME_LINE,"g_unichar_break_type didnt work as expected");
sl@0:         assert_failed = 1;
sl@0:         }
sl@0:     
sl@0: 	if(assert_failed)
sl@0:           std_log(LOG_FILENAME_LINE,"Test Failed");
sl@0:     else
sl@0:           std_log(LOG_FILENAME_LINE,"Test Successful");
sl@0: 	
sl@0:     create_xml(0);
sl@0: 
sl@0: 	return 0;
sl@0: }