charconvfw/Charconv/ongoing/test/source/main/tautodetect.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 25 May 2010 14:39:28 +0300
branchRCL_3
changeset 28 26914f8d1faf
parent 0 1fb32624e06b
child 16 56cd22a7a1cb
permissions -rw-r--r--
Revision: 201019 Kit: 2010121
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2000-2004 Nokia Corporation and/or its subsidiary(-ies). 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:      
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <e32std.h>
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include <e32base.h>
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
#include <e32test.h>
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
#include <f32file.h>
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
#include <charconv.h>
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
_LIT8(KUnicode,"Hi there");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
_LIT8(KUnicode2, "\xff\xfe\x48\x00\x69\x00\x20\x00\x74\x00\x68\x00\x65\x00\x72\x00\x65\x00");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
_LIT8(KUnicode3, "\xfe\xff\x48\x00\x69\x00\x20\x00\x74\x00\x68\x00\x65\x00\x72\x00\x65\x00");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
_LIT8(KSJISPhrase, "\x81@\x81y\x83o\x83\x93\x83R\x83N\x82Q\x82T\x93\xfa\x81\x81\x89\xaa\x93""c\x8e\xa0\x8ds\x81z\x83\x84\x83\x93\x83S\x83\x93\x82\xa9\x82\xe7\x82\xcc\x8f\xee\x95\xf1\x82\xc9\x82\xe6\x82\xe9\x82\xc6\x81""A\x83~\x83\x83\x83\x93\x83}\x81[\x82\xcc\x96\xaf\x8e\xe5\x89\xbb\x89^\x93\xae\x8ew\x93\xb1\x8e\xd2\x83""A\x83""E\x83\x93\x81""E\x83T\x83\x93\x81""E\x83X\x81[\x81""E\x83`\x81[\x82\xb3\x82\xf1\x82\xe7\x8d\x91\x96\xaf\x96\xaf\x8e\xe5\x98""A\x96\xbf\x81i\x82m\x82k\x82""c\x81j\x82\xcc\x83\x81\x83\x93\x83o\x81[\x82\xaa\x93\xf1\x8f\\x8el\x93\xfa\x81""A\x8e\xd4\x82\xc5\x83\x84\x83\x93\x83S\x83\x93\x8dx\x8aO\x82\xc9\x8fo\x82\xbd\x82\xc6\x82\xb1\x82\xeb\x81""A\x8cR\x90\xad\x93\x96\x8b\xc7\x82\xc9\x90\xa7\x8e~\x82\xb3\x82\xea\x82\xbd\x82\xbd\x82\xdf\x81""A\x93\xb9\x98H\x82\xed\x82\xab\x82\xc9\x88\xda\x82\xb3\x82\xea\x82\xbd\x8e\xd4\x93\xf1\x91\xe4\x82\xcc\x92\x86\x82\xc5\x82\xeb\x82\xa4\x8f\xe9\x82\xf0\x8en\x82\xdf\x82\xbd\x81""B\x83X\x81[\x81""E\x83`\x81[\x82\xb3\x82\xf1\x82\xaa\x81""A\x93\x96\x8b\xc7\x82\xcc\x8ds\x93\xae\x90\xa7\x8c\xc0\x82\xf0\x94j\x82\xc1\x82\xc4\x8dx\x8aO\x82\xc9\x8fo\x82\xbd\x82\xcc\x82\xcd\x8b\xe3\x94\xaa\x94N\x94\xaa\x8c\x8e\x88\xc8\x97\x88\x81""A\x93\xf1\x94N\x82\xd4\x82\xe8\x81""B\x96\xaf\x8e\xe5\x89\xbb\x89^\x93\xae\x82\xd6\x82\xcc\x8d\x91\x8d\xdb\x93I\x82\xc8\x8ex\x8e\x9d\x8fW\x82\xdf\x82\xf0\x91_\x82\xc1\x82\xc4\x92\xb7\x8a\xfa\x82\xeb\x82\xa4\x8f\xe9\x82\xf0\x8ds\x82\xa4\x89\xc2\x94\\x90\xab\x82\xe0\x82\xa0\x82\xe8\x81""A\x8cR\x90\xad\x91\xa4\x82\xcd\x91\xce\x89\x9e\x82\xc9\x8b\xea\x97\xb6\x82\xb5\x82\xc4\x82\xa2\x82\xe9\x81""B<p>");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
_LIT8(KBig5, "\xa1@\xa1@\xa5\xbb\xb3\xf8\xb0T\xa1]\xb0O\xaa\xcc\xb1\xe4\xd9y\xa1^\xac\xb0\xb3""e\xb9\xfd\xb8\xa8\xb9\xea\xa4\xa4\xa5\xa1\xa6\xe8\xb3\xa1\xa4j\xb6}\xb5o\xbe\xd4\xb2\xa4\xa9M\xa7\xf5\xb4P\xb2M\xb0\xc6\xc1`\xb2z\xc3\xf6\xa4_\xb1\xd0\xa8|\xb9\xef\xa4""f\xa4\xe4\xb4\xa9\xab\xfc\xa5\xdc\xba\xeb\xaf\xab\xa1""A\xa5\xbb\xa5\xab\xb1N\xb2\xd5\xc2\xb4\xb1\xd0\xaev\xb9\xce\xadu\xa4\xba\xbbX\xa5j\xb6}\xaei\xb9\xef\xa4""f\xa4\xe4\xb4\xa9\xa1""A\xad\xba\xa7\xe5""115\xa6W\xb1\xd0\xaev\xb1N\xa6""b\xb7s\xbe\xc7\xb4\xc1\xb6}\xbe\xc7\xa4\xa7\xbb\xda\xb1\xd2\xb5{\xadu\xa4\xba\xbbX\xa5j\xa1""C\xacQ\xa4\xd1\xa4W\xa4\xc8\xa1""A\xa5\xab\xa9""e\xae\xd1\xb0O");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
_LIT8(KEUP, "\xa1\xcb\xa1\xa3\xa4\xb3\xa4\xec\xa4\xcf\xa1\xa4\xb9\xe2\xc9\xe9\xb2\xd9\xa4\xce\xa5\xd9\xa5\xf3\xa5\xc1\xa5\xde\xa1\xbc\xa5\xaf\xa4\xe4\xa5\xa2\xa5\xd7\xa5\xea\xa5\xb1\xa1\xbc\xa5\xb7\xa5\xe7\xa5\xf3\xa4\xf2\xbc\xc2\xb9\xd4\xa4\xb9\xa4\xeb\xa4\xc8\xa1\xa4\xbd\xe8\xcd\xfd\xa4\xac\xb4\xb0\xce\xbb\xa4\xb9\xa4\xeb\xc1\xb0\xa4\xcb\xa5\xd5\xa5\xea\xa1\xbc\xa5\xba\xa4\xb9\xa4\xeb\xc9\xd4\xb6\xf1\xb9\xe7\xa4\xac\xb3\xce\xc7\xa7\xa4\xb5\xa4\xec\xa4\xbf\xa4\xbf\xa4\xe1\xa1\xa3\xa4\xb7\xa4\xab\xa4\xb7\xcc\xe4\xc2\xea\xa4\xcf\xa1\xa4\xa4\xbd\xa4\xce\xb8\xb6\xb0\xf8\xa4\xac\xa1\xd6\xa5\xb7\xa5\xea\xa5\xb3\xa5\xf3\xa4\xce\xa5\xde\xa1\xbc\xa5\xb8\xa5\xf3\xc9\xd4\xc2\xad\xa1\xd7\xa4\xc0\xa4\xc3\xa4\xbf\xc5\xc0\xa4\xc0\xa1\xa3");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
_LIT8(KEUC2, "Enlightenment\xa4\xce\xa5\xc6\xa1\xbc\xa5\xde\xa4\xc8\xa4\xcf\xa1\xa2\xa5\xa6\xa5\xa3\xa5\xf3\xa5\xc9\xa5\xa6\xa5\xde\xa5\xcd\xa1\xbc\xa5\xb8\xa5\xe3\xa4\xce\xb3\xb0\xb4\xd1\xc9\xf4\xca\xac\xa4\xce\xcd\xd7\xc1\xc7\xa4\xf2\xa4\xd2\xa4\xc8\xa4\xde\xa4\xc8\xa4\xe1\xa4\xcb\xa4\xb7\xa4\xc6\xc0\xda\xa4\xea\xc2\xd8\xa4\xa8\xa4\xe9\xa4\xec\xa4\xeb\xa4\xe8\xa4\xa6\xa4\xcb\xa4\xb7\xa4\xbf\xa4\xe2\xa4\xce\xa1\xa2\xa4\xc8\xb9\xcd\xa4\xa8\xa4\xeb\xa4\xb3\xa4\xc8\xa4\xac\xa4\xc7\xa4\xad\xa4\xde\xa4\xb9\xa1\xa3\xa4\xc4\xa4\xde\xa4\xea\xa1\xa2""1\xa4\xc4\xa4\xce\xa5\xa6\xa5\xa3\xa5\xf3\xa5\xc9\xa5\xa6\xa5\xde\xa5\xcd\xa1\xbc\xa5\xb8\xa5\xe3\xa4\xca\xa4\xce\xa4\xcb\xa1\xa2Windows\xc9\xf7\xa4\xcb\xa4\xe2\xa1\xa2Mac\xc9\xf7\xa4\xcb\xa4\xe2\xa1\xa2\xa4\xb5\xa4\xde\xa4\xb6\xa4\xde\xa4\xcb\xa5\xab\xa5\xb9\xa5\xbf\xa5\xde\xa5\xa4\xa5\xba\xa4\xb9\xa4\xeb\xa4\xb3\xa4\xc8\xa4\xac\xa4\xc7\xa4\xad\xa4\xde\xa4\xb9\xa1\xa3");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
_LIT8(KSJIS, "\x82\xb1\x82\xcc\x83z\x81[\x83\x80\x83y\x81[\x83W\x82\xcd\x81""A\x82\xa9\x82\xed\x82\xa2\x82\xa2\x83L\x83\x83\x83\x89\x83N\x83^\x81[\x81g\x83s\x83\x93\x83O\x81[\x81h\x82\xf0\x82\xbd\x82\xad\x82\xb3\x82\xf1\x82\xcc\x90l\x82\xbd\x82\xbf\x82\xc9\x8f\xd0\x89\xee\x82\xb5\x81""A\x82\xdc\x82\xbd\x81""A\x8c\xf0\x97\xac\x82\xf0\x8e\x9d\x82\xc1\x82\xc4\x82\xa2\x82\xbd\x82\xbe\x82\xab\x82\xbd\x82\xa2\x82\xc6\x8ev\x82\xc1\x82\xc4\x8d\xec\x90\xac\x82\xb3\x82\xea\x82\xbd\x83y\x81[\x83W\x82\xc5\x82\xb7\x81""B<B>\x82\xb1\x82\xcc\x83z\x81[\x83\x80\x83y\x81[\x83W\x82\xcd\x8a""F\x82\xb3\x82\xf1\x82\xcc\x81g\x83N\x83`\x83R\x83~\x81h\x82\xc5\x90\xac\x82\xe8\x97\xa7\x82\xc1\x82\xc4\x82\xa2\x82\xdc\x82\xb7\x81""B</B>\x82\xba\x82\xd0\x8f\xee\x95\xf1\x82\xf0\x82\xa8\x8a\xf1\x82\xb9\x89\xba\x82\xb3\x82\xa2\x81I");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
_LIT8(SJISNET, "20\x94NTRUSTe\x93\xfa\x96{\x82\xcd\x81""A\x8f\xee\x95\xf1\x82\xcc\x8aJ\x8e\xa6\x82\xc6\x8d\x90\x92m\x8b`\x96\xb1\x82\xc9\x8a\xd6\x82\xb7\x82\xe9\x8c\xb4\x91\xa5\x82\xf0\x8dL\x82\xdf\x82\xe9\x82\xb1\x82\xc6\x82\xc9\x82\xe6\x82\xe8\x81""A\x83""C\x83\x93\x83^\x81[\x83l\x83""b\x83g\x8f\xe3\x82\xc9\x82\xa8\x82\xaf\x82\xe9\x83\x86\x81[\x83U\x81[\x82\xc6\x82\xcc\x8f\xee\x95\xf1\x8aJ\x8e\xa6\x82\xc9\x8a\xd6\x82\xb7\x82\xe9\x90M\x97\x8a\x8a\xd6\x8cW\x82\xf0\x91\xc5\x82\xbf\x97\xa7\x82\xc4\x82\xe9\x82\xb1\x82\xc6\x82\xf0\x8eg\x96\xbd\x82\xc6\x82\xb7\x82\xe9\x81""A\x93\xc6\x97\xa7\x82\xcc\x94\xf1\x89""c\x97\x98\x91g\x90""D\x82\xc5\x82\xb7\x81""B\x82\xb1\x82\xcc\x83""E\x83""F\x83u\x83T\x83""C\x83g\x82\xcd\x8bM\x93""a\x82\xcc\x83v\x83\x89\x83""C\x83o\x83V\x81[\x82\xc9\x91\xce\x82\xb7\x82\xe9\x82\xbb\x82\xcc\x8c\xf6\x96\xf1\x82\xf0\x8e\xc0\x8f\xd8\x82\xb7\x82\xe9\x88\xd3\x96\xa1\x82\xc5\x81""A\x82\xb1\x82\xb1\x82\xc9\x8f\xee\x95\xf1\x82\xcc\x8e\xe6\x82\xe8\x88\xb5\x82\xa2\x8a\xee\x8f\x80\x82\xf0\x8aJ\x8e\xa6\x82\xb5\x82\xbd\x82\xe0\x82\xcc\x82\xc5\x81""A\x82\xb1\x82\xcc\x83v\x83\x89\x83""C\x83o\x83V\x81[\x8e\xe6\x82\xe8\x88\xb5\x82\xa2\x8a\xee\x8f\x80\x82\xc9\x82\xc2\x82\xa2\x82\xc4\x82\xcd\x81""ATRUSTe\x82\xc9\x82\xe6\x82\xe8\x81""A\x82\xbb\x82\xcc\x8f\x87\x8e\xe7\x82\xc9\x8a\xd6\x82\xb7\x82\xe9\x8c\x9f\x93\xa2\x82\xc6\x8a\xc4\x8d\xb8\x82\xc6\x82\xf0\x8e\xf3\x82\xaf\x82\xbd\x82\xe0\x82\xcc\x82\xc5\x82\xb7\x81""B");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
_LIT8(BIG5A, "\xb0\xea\xae""a\xbcs\xbc\xbd\xb9q\xb5\xf8\xbd\xe8\xb6q\xba\xca\xb7\xfe\xc0\xcb\xc5\xe7\xb4\xfa\xb8\xd5\xa4\xa4\xa4\xdf</a> - \xb9\xef\xad\xb5\xb5\xf8\xc0W\xb2\xa3\xab~\xaa\xba\xb1`\xb7\xc5\xb9q\xa9\xca\xaf\xe0\xa1""B\xa6w\xa5\xfe\xa1""B\xb9q\xba\xcf\xad\xdd\xae""e\xa7@\xc0\xf4\xb9\xd2\xb4\xfa\xb8\xd5\xa9M\xba\xca\xb7\xfe\xa9\xe2\xac""d");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
_LIT8(BIG5C, "\xac\xfc \xb0\xea \xb0\xc8 \xb0| \xa8\xc8 \xa4\xd3 \xb0\xc6 \xa7U \xad\xeb \xc1\xc2 \xb2Q \xc4R \xa4\xb5 \xa4\xe9 \xa6""b \xa6\xb9 \xb6\xa1 \xa4@ \xa6\xb8 \xbcy \xaf\xac \xa4\xa4 \xa6@ \xab\xd8 \xac""F \xa4\xad \xa4Q \xa9P \xa6~ \xaa\xba \xa4j \xab\xac \xac\xe3 \xb0Q \xb7| \xa4\xa4 \xaa\xed \xa5\xdc \xa1""A \xa4\xa4 \xa6@ \xc0\xb3 \xb8\xd3 \xb9\xef \xa5x \xc6W \xb1\xc4");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
_LIT8(GB2312B, "\xd0\xc2\xce\xc5, \xd0\xa1\xcb\xb5\xa3\xac\xd4\xd3\xd6\xbe\xa3\xac\xb6\xc1\xd5\xdf\xa3\xac\xc2\xdb\xcc\xb3\xa3\xac\xce\xc4\xd5\xaa\xa3\xac\xb1\xa8\xd6\xbd\xa3\xac\xd0\xa6\xbb\xb0\xa3\xac\xcc\xe5\xd3\xfd\xa3\xac\xc7\xe9\xb8\xd0\xa3\xac\xc1\xf4\xd1\xa7\xa3\xac\xbf\xe1\xd5\xbe\xa3\xac");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
_LIT8(GB2312C,       "\xa1\xa1\xa1\xf1\xcd\xf5\xbb\xdb\xa3\xa8\xb1\xbe\xb1\xa8\xcc\xd8\xd4\xbc\xa3\xa9\xb1\xb1\xbe\xa9\xb1\xa8\xb5\xc0<p>\xa1\xa1\xa1\xa1\xc0\xfa\xbd\xec\xb0\xc2\xd4\xcb\xbb\xe1\xca\xd7");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
_LIT8(GB2312Corrupt, "\xa1\xa1\xa1\xf1\xcd\xf5\xbb\xdb\xa3""fff\xb1\xbe\xb1\xa8\xcc\xd8\xd4\xbc\xa3\xa9""ff\xb1\xb1\xbe\xa9\xb1\xa8\xb5\xc0<pddd>\xa1\xa1\xa1\xa1\xc0\xfa\xbd\xec\xb0\xc2\xd4\xcb\xbb\xe1\xca\xd7");//FAILED
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
_LIT8(BIG5Corrupt, "\xac\xfc \xb0\xea \xb0\xc8 \xb0| \xa8\xc8 \xa4\xd3 \xb0\xc6 \xa7U ddd\xad\xeb \xc1\xc2 \xb2Q \xc4R \xa4""ddd\xb5 \xa4\xe9 \xa6""b \xa6\xb9 \xb6\xa1 \xa4@ \xa6\xb8 \xbcy \xaf\xac \xa4\xa4 \xa6@ \xab\xd8 \xac""F \xa4\xad \xa4Q \xa9P \xa6~ \xaa\xba \xa4j \xab\xac \xac\xe3 \xb0Q \xb7| \xa4\xa4 \xaa\xed \xa5\xdc \xa1""A \xa4\xa4 \xa6@ddd \xc0\xb3 \xb8\xd3 \xb9\xef \xa5x \xc6W \xb1\xc4");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
_LIT8(BIG5Ahalf, "this is to test the data with ASCII mixured \xea\xae""a\xbcs\xbc\xbd\xb9q\xb5\xf8\xbd\xe8\xb6q\xba\xca\xb7\xfe\xc0\xcb\xc5\xe7\xb4\xfa\xb8\xd5\xa4\xa4\xa4\xdf</a> - \xb9\xef\xad\xb5\xb5\xf8\xc0W\xb2\xa3\xab~\xaa\xba\xb1`\xb7\xc5\xb9q\xa9\xca\xaf\xe0\xa1""B\xa6w\xa5\xfe\xa1""B\xb9q\xba\xcf\xad\xdd\xae""e\xa7@\xc0\xf4\xb9\xd2\xb4\xfa\xb8\xd5\xa9M\xba\xca\xb7\xfe\xa9\xe2\xac""d");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
_LIT8(KASCII, "SO what result do I get for a text that is pure Ascii and nothing else. Not something stupid I hope!");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
_LIT8(KUTF8, "\xe4\xbc\x80\xe6\xac\x80\xe2\x80\x80\xe5\x8c\x80\xe6\xbc\x80\xe2\x80\x80\xe4\xa0\x80\xe6\x94\x80\xe7\x88\x80\xe6\x94\x80\xe2\x80\x80\xe6\xa4\x80\xe7\x8c\x80\xe2\x80\x80\xe6\x84\x80\xe2\x80\x80\xe7\x90\x80\xe6\x94\x80\xe7\xa0\x80\xe7\x90\x80\xe2\x80\x80\xe7\x90\x80\xe6\xa0\x80\xe6\x84\x80\xe7\x90\x80\xe2\x80\x80\xe7\x9c\x80\xe6\xa4\x80\xe6\xb0\x80\xe6\xb0\x80\xe2\x80\x80\xe6\x88\x80\xe6\x94\x80\xe2\x80\x80\xe6\x8c\x80\xe6\xbc\x80\xe6\xb8\x80\xe7\x98\x80\xe6\x94\x80\xe7\x88\x80\xe7\x90\x80\xe6\x94\x80\xe6\x90\x80\xe2\x80\x80\xe6\xa4\x80\xe6\xb8\x80\xe7\x90\x80\xe6\xbc\x80\xe2\x80\x80\xe6\x84\x80\xe2\x80\x80\xe5\x94\x80\xe5\x90\x80\xe4\x98\x80\xe2\xb4\x80\xe3\x9c\x80\xe2\x80\x80\xe7\xb8\x80\xe2\x80\x80\xe5\x90\x80\xe6\x94\x80\xe7\xa0\x80\xe7\x90\x80");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
_LIT8(KDodgyShiftJIS,"͒a悤ꂵȂ`");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
_LIT8(KDodgyShiftJIS2,"20000222T100000Z;;;\x92\xa9\x82\xbe\x82\xe6\x8b\x4e\x82\xab\x82\xeb\x82\xa7\x81\x60\x81\x60\x81\x49\x81\x49\x81\x49");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
_LIT8(KDodgyShiftJIS3,"\x83\x5c\x83\x5c\x83\x5c\x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x83\x5c\x83\x5c\x83\x5c\x82\xa9\x82\xab\x82\xad\x82\xaf\x82\xb1\x82\x5c");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
_LIT8(KISO,"\x6d\x6f\x72\x6f\x0d\x0a\x6d\x69\x74\xe4\x20\x6b\x75\x75\x6c\x75\x75\x3f");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
_LIT8(KSomeISO, "\x48\x65\x6a\x21\x20\x0d\x0a\x0d\x0a\x68\xe4\x72\x20\x6b\x6f\x6d\x6d\x65\x72\x20\x65\x74\x74\x20\x6d\x61\x69\x6c\x20\x6d\x65\x64\x20\x6d\x61\x73\x73\x61\x20\x74\x65\x78\x74\x20\x6f\x63\x68\x20\x65\x74\x74\x20\x61\x74\x74\x61\x63\x68\x6d\x65\x6e\x74\x2e\x20\x44\x65\x74\x74\x61\x20\x6c\x69\x6c\x6c\x61\x20\x6d\x61\x69\x6c");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
_LIT8(KUnicodeFail,"\x0d");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
_LIT8(KISODEF,"\xd7\x6d\x30\xf7"); // Test for defect raised in 6.1 (EXT-5HLEKN)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
/**
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
* Work around for DEF063276.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
* These literals are now loaded from a z:\test\data\KLittleEndian.dat and
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
* z:\test\data\KBigEndian.dat respectivly.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
* Bullseye Coverage corrupts these literals to avoid this they are stored in files as to not be touched by Bullseye Coverage.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
*/	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
// Test for defect INC037743 - Charconv recognises Little Endian as Big Endian
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
/*_LIT8(KLittleEndian,
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
	"\x43\x00\x68\x00\x61\x00\x74\x00\x20\x00\x68\x00\x69\x00\x73\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
	"\x74\x00\x6F\x00\x72\x00\x79\x00\x20\x00\x32\x00\x0A\x00\x43\x00" 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
	"\x68\x00\x61\x00\x74\x00\x20\x00\x72\x00\x6F\x00\x6F\x00\x6D\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
	"\x20\x00\x27\x00\x77\x00\x76\x00\x3A\x00\x6A\x00\x75\x00\x68\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
	"\x61\x00\x75\x00\x74\x00\x69\x00\x6F\x00\x2F\x00\x32\x00\x30\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
	"\x70\x00\x6D\x00\x74\x00\x40\x00\x6E\x00\x6F\x00\x6B\x00\x69\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
	"\x61\x00\x2E\x00\x63\x00\x6F\x00\x6D\x00\x27\x00\x0A\x00\x53\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
	"\x74\x00\x61\x00\x72\x00\x74\x00\x3A\x00\x20\x00\x30\x00\x31\x00" 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
	"\x2F\x00\x30\x00\x39\x00\x2F\x00\x32\x00\x30\x00\x30\x00\x33\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
	"\x20\x00\x32\x00\x32\x00\x3A\x00\x34\x00\x33\x00\x3A\x00\x32\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
	"\x38\x00\x0A\x00\x49\x00\x76\x00\x61\x00\x6E\x00\x20\x00\x57\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
	"\x65\x00\x6C\x00\x63\x00\x6F\x00\x6D\x00\x65\x00\x20\x00\x74\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
	"\x6F\x00\x20\x00\x63\x00\x68\x00\x61\x00\x74\x00\x20\x00\x72\x00" 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
	"\x6F\x00\x6F\x00\x6D\x00\x21\x00\x20\x00\x54\x00\x6F\x00\x70\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
	"\x69\x00\x63\x00\x20\x00\x69\x00\x73\x00\x20\x00\x59\x00\x6C\x00" 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
	"\x65\x00\x69\x00\x73\x00\x74\x00\xE4\x00\x20\x00\x76\x00\x65\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
	"\x6C\x00\x6C\x00\x6F\x00\x6E\x00\x74\x00\x61\x00\x61\x00\x2E\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
	"\x0A\x00\x4D\x00\x69\x00\x6B\x00\x61\x00\x54\x00\x20\x00\x6A\x00"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
	"\x6F\x00\x69\x00\x6E\x00\x65\x00\x64\x00\x0A\x00");		 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
_LIT8(KBigEndian,
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
	"\x00\x43\x00\x68\x00\x61\x00\x74\x00\x20\x00\x68\x00\x69\x00\x73"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
	"\x00\x74\x00\x6F\x00\x72\x00\x79\x00\x20\x00\x32\x00\x0A\x00\x43" 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
	"\x00\x68\x00\x61\x00\x74\x00\x20\x00\x72\x00\x6F\x00\x6F\x00\x6D"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
	"\x00\x20\x00\x27\x00\x77\x00\x76\x00\x3A\x00\x6A\x00\x75\x00\x68"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
	"\x00\x61\x00\x75\x00\x74\x00\x69\x00\x6F\x00\x2F\x00\x32\x00\x30"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
	"\x00\x70\x00\x6D\x00\x74\x00\x40\x00\x6E\x00\x6F\x00\x6B\x00\x69"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
	"\x00\x61\x00\x2E\x00\x63\x00\x6F\x00\x6D\x00\x27\x00\x0A\x00\x53"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
	"\x00\x74\x00\x61\x00\x72\x00\x74\x00\x3A\x00\x20\x00\x30\x00\x31" 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
	"\x00\x2F\x00\x30\x00\x39\x00\x2F\x00\x32\x00\x30\x00\x30\x00\x33"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
	"\x00\x20\x00\x32\x00\x32\x00\x3A\x00\x34\x00\x33\x00\x3A\x00\x32"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
	"\x00\x38\x00\x0A\x00\x49\x00\x76\x00\x61\x00\x6E\x00\x20\x00\x57"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
	"\x00\x65\x00\x6C\x00\x63\x00\x6F\x00\x6D\x00\x65\x00\x20\x00\x74"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
	"\x00\x6F\x00\x20\x00\x63\x00\x68\x00\x61\x00\x74\x00\x20\x00\x72" 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
	"\x00\x6F\x00\x6F\x00\x6D\x00\x21\x00\x20\x00\x54\x00\x6F\x00\x70"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
	"\x00\x69\x00\x63\x00\x20\x00\x69\x00\x73\x00\x20\x00\x59\x00\x6C" 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
	"\x00\x65\x00\x69\x00\x73\x00\x74\x00\xE4\x00\x20\x00\x76\x00\x65"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
	"\x00\x6C\x00\x6C\x00\x6F\x00\x6E\x00\x74\x00\x61\x00\x61\x00\x2E"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
	"\x00\x0A\x00\x4D\x00\x69\x00\x6B\x00\x61\x00\x54\x00\x20\x00\x6A"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
	"\x00\x6F\x00\x69\x00\x6E\x00\x65\x00\x64\x00\x0A\x00");*/
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
// test file for INC037705 - SS66 - Charconv autodetect recognises Swedish as Shift-JIS 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
// These tests currently fail as the test detects KCharacterSetIdentifierShiftJis. 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
/* This defect was rejected, so the test code has been commented out
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
_LIT8(KInc037705,
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
  	"\x0d\x0a\x2A\x8E\x99\x99\x20\x53\x99\x46\x8F\x53\x8F\x20\x94\x73"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
  	"\x64\x66\x84\x73\x64\x94\x73\x64\x20\x53\x8F\x99\x99\x20\x73\x99"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
    "\x46\x8f\x8e\x99\x20\x73\x46\x99\x8f\x53\x44\x0D\x0A\x53\x8F\x46"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
    "\x4C\x99\x20\x50\x8F\x4C\x84\x20\x4C\x50\x8F\x53\x46\x8F\x8E\x20"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
  	"\x4C\x50\x53\x46\x44\x8E\x20\x50\x4C\x53\x44\x46\x20\x50\x4C\x53"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
  	"\x4C\x50\x6C\x84\x84\x73\x6C\x84\x6C\x84\x94\x84\x0D\x0A\x20\x53"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
  	"\x46\x99\x6C\x73\x86\x70\x94\x66\x84\x0D\x0A\x27\x86\x27\x22\x94"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
  	"\x20\x94\x27\x84\x20\x94\x8F\x53\x46\x20\x84\x27\x94\x27\x86\x73" 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
  	"\x94\x20\x86\x94\x73\x27\x0D\x0A\x0D\x0A\x0D\x0A\x0D\x0A"); 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
*/  	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
// Swedish test file for INC037705, This is "test2.txt" from the defect
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
_LIT8(KSwedish,
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
	"\x55\x74\x61\x6E\x73\x6B\x72\x69\x66\x74\x65\x6E\x3A\x0D\x0A\x53"	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
	"\x65\x72\x65\x6E\x69\x73\x73\x69\x6D\x6F\x20\x65\x74\x20\x43\x6C"	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
	"\x61\x72\x69\x73\x73\x69\x6D\x6F\x20\x44\x6F\x6D\x69\x6E\x6F\x0D"	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
	"\x0A\x44\x6F\x6D\x69\x6E\x6F\x20\x47\x75\x73\x74\x61\x66\x66\x6F"	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
	"\x20\x53\x75\x65\x63\x6F\x72\x75\x6D\x0D\x0A\x65\x74\x20\x47\x6f"	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
	"\x74\x68\x6F\x72\x75\x6D\x20\x52\x65\x67\x69\x20\x44\x6F\x6D\x69"	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
	"\x6E\x6F\x20\x53\x75\x6F\x0D\x0A\x43\x6C\x65\x6D\x65\x6E\x74\x69"	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
	"\x70\x70\x69\x6D\x6F\x0D\x0A\x0D\x0A\x4E\xE5\x64\x20\x6F\x63\x68"	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
	); 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
// Finnish test file for INC037705, This is "test3.txt" from the defect
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
_LIT8(KFinnish,
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
	"\x59\x68\x64\x65\x73\x74\x6F\x69\x73\x74\x61\x20\x72\x75\x6E\x6F"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
	"\x0D\x0A\x0D\x0A\x56\x69\x6B\x61\x20\x6F\x6E\x20\x41\x68\x74\x69"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
	"\x61\x20\x73\x61\x6E\x6F\x61\x2C\x20\x76\x65\x69\x74\x69\x6B\x6B"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
	"\xE4\x74\xE4\x20\x76\x69\x65\x72\x65\x74\x65\x6C\x6C\xE4\x2E\x20"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
	"\x0D\x0A\x0D\x0A\x41\x68\x74\x69\x20\x70\x6F\x69\x6B\x61\x20\x53"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
	"\x61\x61\x72\x65\x6C\x61\x69\x6E\x65\x6E\x2C\x20\x74\x75\x6F\x20"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
	"\x6F\x6E\x20\x6C\x69\x65\x74\x6F\x20\x4C\x65\x6D\x6D\x69\x6E\x20"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
	"\x70\x6F\x69\x6B\x61\x2C\x20\x0D\x0A\x6B\x61\x73\x76\x6F\x69\x20"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
	); 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
// This is the last two lines from GotchaLog.txt 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
// from INC043016 - AV21 via BTH received TXT file could not be opened
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
// Which is enough to reproduce the defect
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
_LIT8(KGotcha,
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
	"\x0A\x0D\x0A\x4D\x65\x6D\x6F\x72\x79\x20\x74\x65\x73\x74\x20\x2D"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   151
	"\x6F\x64\x75\x6C\x65\x20\x65\x6E\x64\x0D\x0A\x2B\x2B\x2B\x2B\x2B"
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   152
	); 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   154
///////////////////////////////////////////////////////////////////////////////////////
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   155
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   156
RTest TheTest(_L("TAutoDetect"));
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
///////////////////////////////////////////////////////////////////////////////////////
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
///////////////////////////////////////////////////////////////////////////////////////
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   160
//Tests macroses and functions.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   161
//If (!aValue) then the test will be panicked, the test data files will be deleted.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   162
static void Check(TInt aValue, TInt aLine)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
	{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
	if(!aValue)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
		{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
		TheTest(EFalse, aLine);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
		}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
	}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
//If (aValue != aExpected) then the test will be panicked, the test data files will be deleted.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
static void Check(TInt aValue, TInt aExpected, TInt aLine)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
	{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
	if(aValue != aExpected)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
		{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
		RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
		TheTest(EFalse, aLine);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
		}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
	}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
//Use these to test conditions.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
#define TEST(arg) ::Check((arg), __LINE__)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
#define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
/**
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   183
* Utility for DEF063276 fix.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   184
*/
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
_LIT(KLittleEndianFilename, "z:\\test\\data\\KLittleEndian.dat");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
_LIT(KBigEndianFilename, "z:\\test\\data\\KBigEndian.dat");
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   189
static void ReadDesc(TDes8& aDes, const TDesC& aFilename, RFs& aFs)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   190
	{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
	RFile file;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
	TInt err = file.Open(aFs, aFilename, EFileRead);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
	TEST2(err, KErrNone);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
	CleanupClosePushL(file);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
	err = file.Read(aDes);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
	TEST2(err, KErrNone);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
	CleanupStack::PopAndDestroy(&file);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
	}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
///////////////////////////////////////////////////////////////////////////////////////
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
///////////////////////////////////////////////////////////////////////////////////////
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
		
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
const TInt KMinimumThresholdForConvertableCharacter=70;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
/**
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
@SYMTestCaseID          SYSLIB-CHARCONV-CT-0548
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
@SYMTestCaseDesc        Tests for auto detecting the character set
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
						Test for CCnvCharacterSetConverter::AutoDetectCharacterSetL() 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
@SYMTestPriority        Medium
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   211
@SYMTestActions         Attempt to determine the character set of the sample text from those supported on the phone
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
@SYMTestExpectedResults Test must not fail
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
@SYMREQ                 REQ0000
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   214
*/
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   215
LOCAL_C void TestAutodetectL(const CArrayFix<CCnvCharacterSetConverter::SCharacterSet>& aArrayOfCharacterSetsAvailable, const TDesC8& aSample, const TUint& aResult)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
	{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
	TInt Confidence = 0;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
	TUint Character = 0;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
	CCnvCharacterSetConverter::AutoDetectCharacterSetL (Confidence,Character, aArrayOfCharacterSetsAvailable,aSample);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
	TEST(Character==aResult);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
	TheTest.Printf(_L("."));
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   222
	}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
/**
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
@SYMTestCaseID          SYSLIB-CHARCONV-CT-1307
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   226
@SYMTestCaseDesc        Tests for auto detecting the character set
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
@SYMTestPriority        Medium
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
@SYMTestActions         Tests for CCnvCharacterSetConverter::AutoDetectCharSetL() 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   229
@SYMTestExpectedResults Test must not fail
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
@SYMREQ                 REQ0000
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
*/
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
LOCAL_C void TestAutodetect1L( 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
                              const CArrayFix<CCnvCharacterSetConverter::SCharacterSet>& aArrayOfCharacterSetsAvailable,
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
                              const TDesC8& aSample, 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
                              const TUint& aResult,
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
                              CCnvCharacterSetConverter* aConverter)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
	{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
	TInt Confidence = 0;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
	TUint Character = 0;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
	aConverter->AutoDetectCharSetL(Confidence,Character, aArrayOfCharacterSetsAvailable,aSample);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
	TEST(Character==aResult);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
	TheTest.Printf(_L("."));
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
	}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
/**
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
@SYMTestCaseID          SYSLIB-CHARCONV-CT-0549
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
@SYMTestCaseDesc        Tests for CCnvCharacterSetConverter::ConvertibleToCharacterSetL() function
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
@SYMTestPriority        Medium
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
@SYMTestActions         Tests the likelihood that a sample is encoded in a CharacterSetIdentifier
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   249
@SYMTestExpectedResults Test must not fail
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
@SYMREQ                 REQ0000
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
*/
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
LOCAL_C void TestConvertibleToCharacterL(const TUint aCharsetIdentifier, const CArrayFix<CCnvCharacterSetConverter::SCharacterSet>& aArrayOfCharacterSetsAvailable, const TDesC8& aSample, const TInt flag)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   253
	{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   254
	TInt confidence = 0;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
	CCnvCharacterSetConverter::ConvertibleToCharacterSetL(confidence,aCharsetIdentifier, aArrayOfCharacterSetsAvailable, aSample);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
	if (flag)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
		TEST(confidence >= KMinimumThresholdForConvertableCharacter );
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
	else
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   259
		TEST(confidence < KMinimumThresholdForConvertableCharacter );
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   260
	}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   262
const TInt KMaxSampleLengthForAutoDetection = 1024;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   263
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   264
/**
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   265
This test code uses the method as is used by notepad in \Notepad\LibSrc\NpdUtil.cpp
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   266
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   267
@SYMTestCaseID          SYSLIB-CHARCONV-CT-0550
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   268
@SYMTestCaseDesc        Tests to autodetect a character read from file 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   269
@SYMTestPriority        Medium
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   270
@SYMTestActions         Tests to determine the character set of the sample text read from a file 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   271
@SYMTestExpectedResults Test must not fail
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   272
@SYMREQ                 REQ0000
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   273
*/
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   274
LOCAL_C void TestAutoDetectFromFileL(const TDesC16& aFileName, const TUint& aResult )
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   275
	{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   276
	// get file server session and open file
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   277
    RFile file;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   278
	RFs fileServerSession;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   279
	CleanupClosePushL(fileServerSession);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   280
	User::LeaveIfError(fileServerSession.Connect());
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   281
    User::LeaveIfError(file.Open(fileServerSession, aFileName, EFileRead));
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   282
 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   283
	// get up to KMaxSampleLengthForAutoDetection bytes of file for autodetect
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   284
	TInt size(0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   285
    User::LeaveIfError( file.Size(size) );
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   286
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   287
    TBuf8<KMaxSampleLengthForAutoDetection> sample;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   288
    User::LeaveIfError( file.Read(sample, 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   289
    			size > KMaxSampleLengthForAutoDetection ?  KMaxSampleLengthForAutoDetection : size) );
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   290
     
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   291
    TInt confidence(0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   292
    TUint charset(0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   293
   
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   294
    // if the first two bytes say unicode, don't bother with autodetect            
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   295
    if ( size >= 2 && 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   296
                ( ( sample[0] == 0xfe && sample[1] == 0xff ) || 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   297
                    ( sample[0] == 0xff && sample[1] == 0xfe ) ) )
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   298
    	{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   299
        charset = 0; // Unicode
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   300
        }
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   301
    else
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   302
        {
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   303
        //ok, try autodetect, first get available character sets
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   304
        CArrayFix<CCnvCharacterSetConverter::SCharacterSet>* newlists =
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   305
                    new(ELeave) CArrayFixFlat<CCnvCharacterSetConverter::SCharacterSet> (10);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   306
        CleanupStack::PushL(newlists);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   307
                
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   308
        const CArrayFix<CCnvCharacterSetConverter::SCharacterSet>* 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   309
                    lists = CCnvCharacterSetConverter::
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   310
                        CreateArrayOfCharacterSetsAvailableLC( fileServerSession );
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   311
        
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   312
        // for some reason? remove Sms7bit from the list
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   313
        const TInt count( lists->Count() );
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   314
        for ( TInt i(0); i < count; i++ )
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   315
        	{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   316
                    switch ( (*lists)[i].Identifier() )
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   317
                        {
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   318
                        case KCharacterSetIdentifierSms7Bit:
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   319
                            // remove Sms7Bit from newlists
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   320
                            break;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   321
                        default:
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   322
                            newlists->AppendL((*lists)[i]);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   323
                            break;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   324
                        }
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   325
                    }
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   326
                    
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   327
        // now try AutoDetect            
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   328
      	CCnvCharacterSetConverter::AutoDetectCharacterSetL(confidence, charset, *newlists, sample);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   329
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   330
	    CleanupStack::PopAndDestroy(2); // filserver, lists	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   331
  		}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   332
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   333
 	TheTest.Printf(_L("file %S charset = 0x%x confidence %d expected 0x%x\n"), 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   334
 				&aFileName, charset, confidence, aResult );
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   335
   	                
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   336
	// check the character set expected was the one autodetected
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   337
	TEST(charset==aResult);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   338
               
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   339
    CleanupStack::PopAndDestroy(1); // fileserver
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   340
	}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   341
/**
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   342
@SYMTestCaseID          SYSLIB-CHARCONV-CT-0551
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   343
@SYMTestCaseDesc        Tests for conversion of characters read from a file to Unicode
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   344
@SYMTestPriority        Medium
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   345
@SYMTestActions         Logs out number  of uncoverted bytes left at end,number of uncovertable characters,
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   346
						index of first byte of first unconvertible character
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   347
@SYMTestExpectedResults Test must not fail
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   348
@SYMREQ                 REQ0000
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   349
*/
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   350
LOCAL_C void TestConvertFromFileL(const TDesC16& aFileName, const TUint& aCharacterSetIdentifier )
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   351
	{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   352
		// get file server session and open file
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   353
    RFile file;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   354
	RFs fileServerSession;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   355
	CleanupClosePushL(fileServerSession);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   356
	User::LeaveIfError(fileServerSession.Connect());
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   357
    User::LeaveIfError(file.Open(fileServerSession, aFileName, EFileRead));
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   358
 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   359
	// get up to KMaxSampleLengthForAutoDetection bytes of file for autodetect
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   360
	TInt size(0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   361
    User::LeaveIfError( file.Size(size) );
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   362
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   363
    TBuf8<KMaxSampleLengthForAutoDetection> sample;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   364
    User::LeaveIfError( file.Read(sample, 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   365
    			size > KMaxSampleLengthForAutoDetection ?  KMaxSampleLengthForAutoDetection : size) );
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   366
    
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   367
 	TheTest.Printf(_L("Comnverting to unicode file %S size = %d \n"), 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   368
 				&aFileName, size );
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   369
 				
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   370
    TInt NumberOfUnconvertibleCharacters=0;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   371
    TInt IndexOfFirstByteOfFirstUnconvertibleCharacter=0;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   372
    TInt state = CCnvCharacterSetConverter::KStateDefault;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   373
    TBuf16<KMaxSampleLengthForAutoDetection> result;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   374
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   375
    CCnvCharacterSetConverter *Converter = CCnvCharacterSetConverter::NewLC();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   376
    TRAPD( ConverterErr, Converter->PrepareToConvertToOrFromL( aCharacterSetIdentifier, fileServerSession)); 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   377
	if ( ConverterErr!= KErrNone )
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   378
		{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   379
	 	TheTest.Printf(_L("PrepareToConvertToOrFromL left on file %S ConverterErr = 0x%x \n"), 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   380
 				&aFileName, ConverterErr );
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   381
		}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   382
		
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   383
	TInt bytesLeft = Converter->ConvertToUnicode( result,
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   384
										    sample, 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   385
										    state,
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   386
											NumberOfUnconvertibleCharacters,
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   387
											IndexOfFirstByteOfFirstUnconvertibleCharacter); 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   388
	 	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   389
	TheTest.Printf(_L("ConvertToUnicode returned %d unconverted bytes left at the end\n"),bytesLeft );
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   390
	TheTest.Printf(_L("NumberOfUnconvertibleCharacters=%d \n"),NumberOfUnconvertibleCharacters);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   391
	TheTest.Printf(_L("IndexOfFirstByteOfFirstUnconvertibleCharacter=%d \n"),IndexOfFirstByteOfFirstUnconvertibleCharacter);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   392
	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   393
    CleanupStack::PopAndDestroy(2); // fileserver, CCnvCharacterSetConverter
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   395
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   396
/**
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   397
INC056019 	SS NTT - Character set recognition is not optimized.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   398
To improve a performace old static autodetection method was deprecated 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   399
and a new AutoDetectCharSet method introduced. 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   400
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   401
@SYMTestCaseID          SYSLIB-CHARCONV-CT-1308
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   402
@SYMTestCaseDesc        Performance test for auto detection of characters set
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   403
@SYMTestPriority        Medium
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   404
@SYMTestActions         Tests for the new AutoDetectCharSet() function
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   405
@SYMTestExpectedResults Test must not fail
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   406
@SYMREQ                 REQ0000
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   407
*/
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   408
LOCAL_C void TestAutoDetectionPerformanceL(
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   409
                const CArrayFix<CCnvCharacterSetConverter::SCharacterSet>* aArrayOfCharacterSetsAvailable)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   410
	{	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   411
	TInt i;	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   412
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   413
	/////////////////////////////////////////////////////////////////
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   414
	TheTest.Next(_L("Testing ten calls to Static AutoDetection"));
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   415
	TTime starttime;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   416
	starttime.UniversalTime();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   417
	for (i=0; i<10; i++)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   418
	    {
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   419
	    TheTest.Printf(_L("\n%d run "),i+1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   420
        TestAutodetectL(*aArrayOfCharacterSetsAvailable,KSomeISO, KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   421
	    }   
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   422
	TTime endtime;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   423
	endtime.UniversalTime();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   424
	TTimeIntervalMicroSeconds difftime=endtime.MicroSecondsFrom(starttime);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   425
	TheTest.Printf(_L("\nTen Static calls duration =%d  microseconds\n\n"), difftime.Int64());
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   426
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   427
	/////////////////////////////////////////////////////////////////
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   428
	TInt charsetCnvCount = aArrayOfCharacterSetsAvailable->Count();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   429
	TInt dllCharsetCnvCount = 0;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   430
	//Count the number of character set converter dlls.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   431
	for(i=0;i<charsetCnvCount;++i)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   432
		{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   433
		const CCnvCharacterSetConverter::SCharacterSet& charset = aArrayOfCharacterSetsAvailable->At(i);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   434
		if(charset.NameIsFileName())
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   435
			{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   436
			++dllCharsetCnvCount;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   437
			}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   438
		}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   439
	if(dllCharsetCnvCount == 0)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   440
		{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   441
		TheTest.Printf(_L("No character set converter dlls! Exit subtest.\n"));
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   442
		return;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   443
		}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   444
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   445
	/////////////////////////////////////////////////////////////////
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   446
	CCnvCharacterSetConverter* converter = CCnvCharacterSetConverter::NewLC();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   447
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   448
	/////////////////////////////////////////////////////////////////
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   449
    TheTest.Next(_L("Testing ten calls to optimized AutoDetection. Non-optimal cache size."));
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   450
	converter->SetMaxCacheSize(dllCharsetCnvCount / 2 + 1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   451
	//Fill the cache
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   452
	TestAutodetect1L(*aArrayOfCharacterSetsAvailable,KSomeISO, KCharacterSetIdentifierIso88591,converter);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   453
	//
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   454
	starttime.UniversalTime();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   455
    for (i=0; i<10; i++)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   456
	    {
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   457
	    TheTest.Printf(_L("\n%d run "),i+1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   458
        TestAutodetect1L(*aArrayOfCharacterSetsAvailable,KSomeISO, KCharacterSetIdentifierIso88591,converter);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   459
	    }
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   460
    endtime.UniversalTime();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   461
	difftime=endtime.MicroSecondsFrom(starttime);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   462
    TheTest.Printf(_L("\nTen non-static calls duration =%d  microseconds\n\n"), difftime.Int64());
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   463
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   464
	/////////////////////////////////////////////////////////////////
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   465
    TheTest.Next(_L("Testing ten calls to optimized AutoDetection. Optimal cache size."));
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   466
	converter->SetMaxCacheSize(dllCharsetCnvCount + 1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   467
	//Fill the cache
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   468
	TestAutodetect1L(*aArrayOfCharacterSetsAvailable,KSomeISO, KCharacterSetIdentifierIso88591,converter);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   469
	//
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   470
	starttime.UniversalTime();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   471
    for (i=0; i<10; i++)
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   472
	    {
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   473
	    TheTest.Printf(_L("\n%d run "),i+1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   474
        TestAutodetect1L(*aArrayOfCharacterSetsAvailable,KSomeISO, KCharacterSetIdentifierIso88591,converter);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   475
	    }
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   476
    endtime.UniversalTime();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   477
	difftime=endtime.MicroSecondsFrom(starttime);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   478
    TheTest.Printf(_L("\nTen non-static calls duration =%d  microseconds\n\n"), difftime.Int64());
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   479
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   480
	/////////////////////////////////////////////////////////////////
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   481
    CleanupStack::PopAndDestroy(converter);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   482
	}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   483
/**
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   484
@SYMTestCaseID          SYSLIB-CHARCONV-CT-0552
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   485
@SYMTestCaseDesc        AutoDetection of character tests  
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   486
@SYMTestPriority        Medium
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   487
@SYMTestActions         Calls up auto detection conversion test functions
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   488
@SYMTestExpectedResults Test must not fail
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   489
@SYMREQ                 REQ0000
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   490
*/
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   491
LOCAL_C void DoE32MainL()
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   492
	{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   493
	RFs fileServerSession;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   494
	CleanupClosePushL(fileServerSession);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   495
	User::LeaveIfError(fileServerSession.Connect());
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   496
	const CArrayFix<CCnvCharacterSetConverter::SCharacterSet>* arrayOfCharacterSetsAvailable=CCnvCharacterSetConverter::CreateArrayOfCharacterSetsAvailableLC(fileServerSession);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   497
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   498
	TheTest.Start(_L("About to start the AutoDetection\n"));
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   499
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   500
	TestConvertibleToCharacterL(KCharacterSetIdentifierUtf8,*arrayOfCharacterSetsAvailable,KUTF8,1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   501
	TestConvertibleToCharacterL(KCharacterSetIdentifierAscii,*arrayOfCharacterSetsAvailable,KASCII,1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   502
	TestConvertibleToCharacterL(KCharacterSetIdentifierUnicodeBig,*arrayOfCharacterSetsAvailable,KUnicode,1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   503
	TestConvertibleToCharacterL(KCharacterSetIdentifierUnicodeBig,*arrayOfCharacterSetsAvailable,KUnicode3,1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   504
	TestConvertibleToCharacterL(KCharacterSetIdentifierShiftJis,*arrayOfCharacterSetsAvailable,KSJISPhrase,1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   505
	TestConvertibleToCharacterL(KCharacterSetIdentifierShiftJis,*arrayOfCharacterSetsAvailable,KSJISPhrase,1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   506
	TestConvertibleToCharacterL(KCharacterSetIdentifierGb2312,*arrayOfCharacterSetsAvailable,GB2312B,1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   507
	TestConvertibleToCharacterL(KCharacterSetIdentifierEucJpPacked,*arrayOfCharacterSetsAvailable,KEUC2,1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   508
	TestConvertibleToCharacterL(KCharacterSetIdentifierEucJpPacked,*arrayOfCharacterSetsAvailable,KEUP,1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   509
	TestConvertibleToCharacterL(KCharacterSetIdentifierIso88591,*arrayOfCharacterSetsAvailable,KSomeISO,1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   510
	TestConvertibleToCharacterL(KCharacterSetIdentifierIso88591,*arrayOfCharacterSetsAvailable,KISODEF,1);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   511
	TestConvertibleToCharacterL(KCharacterSetIdentifierCodePage1252,*arrayOfCharacterSetsAvailable,KISODEF,0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   512
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   513
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   514
	TestConvertibleToCharacterL(KCharacterSetIdentifierEucJpPacked,*arrayOfCharacterSetsAvailable,KUTF8,0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   515
	TestConvertibleToCharacterL(KCharacterSetIdentifierHz,*arrayOfCharacterSetsAvailable,KASCII,0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   516
	TestConvertibleToCharacterL(KCharacterSetIdentifierCodePage1252,*arrayOfCharacterSetsAvailable,KUnicode,0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   517
	TestConvertibleToCharacterL(KCharacterSetIdentifierSms7Bit,*arrayOfCharacterSetsAvailable,KUnicode3,0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   518
	TestConvertibleToCharacterL(KCharacterSetIdentifierSms7Bit,*arrayOfCharacterSetsAvailable,KSJISPhrase,0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   519
	TestConvertibleToCharacterL(KCharacterSetIdentifierIso2022Jp,*arrayOfCharacterSetsAvailable,KSJISPhrase,0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   520
	TestConvertibleToCharacterL(KCharacterSetIdentifierIso2022Jp,*arrayOfCharacterSetsAvailable,GB2312B,0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   521
	TestConvertibleToCharacterL(KCharacterSetIdentifierIso2022Jp,*arrayOfCharacterSetsAvailable,KEUC2,0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   522
	TestConvertibleToCharacterL(KCharacterSetIdentifierIso2022Jp,*arrayOfCharacterSetsAvailable,KEUP,0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   523
	TestConvertibleToCharacterL(KCharacterSetIdentifierEucJpPacked,*arrayOfCharacterSetsAvailable,KSomeISO,0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   524
	TestConvertibleToCharacterL(KCharacterSetIdentifierEucJpPacked,*arrayOfCharacterSetsAvailable,KUnicodeFail,0);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   525
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   526
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KEUP,KCharacterSetIdentifierEucJpPacked);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   527
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KEUC2,KCharacterSetIdentifierEucJpPacked);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   528
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KUnicode,KCharacterSetIdentifierUnicodeLittle);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   529
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KUnicode2,KCharacterSetIdentifierUnicodeLittle);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   530
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KUnicode3,KCharacterSetIdentifierUnicodeBig);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   531
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KSJISPhrase,KCharacterSetIdentifierShiftJis);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   532
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KDodgyShiftJIS,KCharacterSetIdentifierShiftJis);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   533
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KDodgyShiftJIS2,KCharacterSetIdentifierShiftJis);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   534
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KDodgyShiftJIS3,KCharacterSetIdentifierShiftJis);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   535
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KBig5,KCharacterSetIdentifierBig5);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   536
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KSJIS,KCharacterSetIdentifierShiftJis);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   537
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KASCII,KCharacterSetIdentifierAscii);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   538
	TestAutodetectL(*arrayOfCharacterSetsAvailable,SJISNET,KCharacterSetIdentifierShiftJis);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   539
	TestAutodetectL(*arrayOfCharacterSetsAvailable,BIG5A,KCharacterSetIdentifierBig5);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   540
	TestAutodetectL(*arrayOfCharacterSetsAvailable,BIG5C,KCharacterSetIdentifierBig5);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   541
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KUTF8,KCharacterSetIdentifierUtf8);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   542
	TestAutodetectL(*arrayOfCharacterSetsAvailable,BIG5Corrupt,KCharacterSetIdentifierBig5);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   543
	TestAutodetectL(*arrayOfCharacterSetsAvailable,BIG5Ahalf,KCharacterSetIdentifierBig5);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   544
	TestAutodetectL(*arrayOfCharacterSetsAvailable,GB2312B,KCharacterSetIdentifierGbk);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   545
	TestAutodetectL(*arrayOfCharacterSetsAvailable,GB2312C,KCharacterSetIdentifierGbk);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   546
	TestAutodetectL(*arrayOfCharacterSetsAvailable,GB2312Corrupt,KCharacterSetIdentifierGbk);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   547
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KISO, KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   548
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KSomeISO, KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   549
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   550
	//test for INC037743 - Charconv recognises Little Endian as Big Endian
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   551
	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   552
	// Fix for DEF063276.
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   553
		
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   554
	TBuf8<300> buf;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   555
	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   556
	ReadDesc(buf, KLittleEndianFilename, fileServerSession);	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   557
	TestAutodetectL(*arrayOfCharacterSetsAvailable,buf, KCharacterSetIdentifierUnicodeLittle);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   558
	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   559
	ReadDesc(buf, KBigEndianFilename, fileServerSession);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   560
	TestAutodetectL(*arrayOfCharacterSetsAvailable,buf, KCharacterSetIdentifierUnicodeBig);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   561
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   562
	// End fix
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   563
	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   564
  	// test for INC037705 - SS66 - Charconv autodetect recognises Swedish as Shift-JIS
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   565
  	// These tests currently fail as the test detects KCharacterSetIdentifierShiftJis. 
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   566
  	// This defect was rejected, so the test code has been commented out
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   567
  	// TestAutodetectL(test,*arrayOfCharacterSetsAvailable,KInc037705, KCharacterSetIdentifierShiftJis);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   568
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   569
	// tests for INC037581 - SS66 - Long .txt note fails to open in msg centre inbox
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   570
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KFinnish, KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   571
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KSwedish, KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   572
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   573
	// tests for INC043016 - AV21 via BTH received TXT file could not be opened
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   574
	TestAutodetectL(*arrayOfCharacterSetsAvailable,KGotcha, KCharacterSetIdentifierUtf8);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   575
	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   576
	//test for INC037705 read in file and try to autodetect()
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   577
#ifdef __WINS__
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   578
	TestAutoDetectFromFileL(_L("C:\\test\\data\\finnish.txt"), KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   579
	TestAutoDetectFromFileL(_L("C:\\test\\data\\swedish.txt"), KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   580
#else
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   581
	TestAutoDetectFromFileL(_L("Z:\\test\\data\\finnish.txt"), KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   582
	TestAutoDetectFromFileL(_L("Z:\\test\\data\\swedish.txt"), KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   583
#endif
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   584
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   585
	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   586
	//test for INC037705: read in file and try to convertToUnicode()
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   587
#ifdef __WINS__
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   588
	TestConvertFromFileL(_L("C:\\test\\data\\finnish.txt"), KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   589
	TestConvertFromFileL(_L("C:\\test\\data\\swedish.txt"), KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   590
#else
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   591
	TestConvertFromFileL(_L("Z:\\test\\data\\finnish.txt"), KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   592
	TestConvertFromFileL(_L("Z:\\test\\data\\swedish.txt"), KCharacterSetIdentifierIso88591);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   593
#endif
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   594
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   595
    TestAutoDetectionPerformanceL(arrayOfCharacterSetsAvailable);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   596
	
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   597
	TheTest.Printf(_L("\n"));
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   598
	CleanupStack::PopAndDestroy(2);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   599
	}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   600
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   601
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   602
GLDEF_C TInt E32Main()
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   603
	{
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   604
	__UHEAP_MARK;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   605
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   606
	TheTest.Title();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   607
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   608
	CTrapCleanup* trapCleanup=CTrapCleanup::New();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   609
	TEST(trapCleanup != NULL);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   610
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   611
	TRAPD(error, DoE32MainL());
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   612
	TEST2(error, KErrNone);
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   613
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   614
	delete trapCleanup;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   615
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   616
	TheTest.End();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   617
	TheTest.Close();
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   618
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   619
	__UHEAP_MARKEND;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   620
	return KErrNone;
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   621
	}
1fb32624e06b Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   622