|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include <e32test.h> |
|
17 #include <ecom/ecom.h> |
|
18 #include <charconv.h> |
|
19 |
|
20 #include <xml/attribute.h> |
|
21 #include <xml/documentparameters.h> |
|
22 #include <xml/stringdictionarycollection.h> |
|
23 #include <xml/taginfo.h> |
|
24 #include <xml/xmlframeworkerrors.h> |
|
25 #include <xml/plugins/dictionarycodepage.h> |
|
26 #include <xml/plugins/charsetconverter.h> |
|
27 |
|
28 #include "t_componenttests.h" |
|
29 #include "t_testconstants.h" |
|
30 #include "t_stringdictionary00.h" |
|
31 #include "t_stringdictionary00tagtable.h" |
|
32 |
|
33 using namespace Xml; |
|
34 |
|
35 |
|
36 _LIT(KTest,"t_ComponentTests"); |
|
37 |
|
38 static RTest test(KTest); |
|
39 |
|
40 _LIT8 (KTestString1, "This is a test string1."); |
|
41 _LIT8 (KTestString2, "This is a test string2."); |
|
42 _LIT8 (KTestString3, "This is a test string3."); |
|
43 _LIT8 (KTestString4, "This is a test string4."); |
|
44 _LIT8 (KTestString5, "This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text."); |
|
45 |
|
46 _LIT8 (KCharSetName, "Test Charset name."); |
|
47 _LIT8 (KDictionaryUri, "-//TestStringDictionary//DTD TestStringDictionary 1.1//EN~0"); |
|
48 _LIT8 (KAddElement, "Add"); |
|
49 |
|
50 TBuf16<600> largebuf16 = _L16("This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text."); |
|
51 TBuf8<600> largebuf8 = _L8("This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text. This is a very large test string containing lots and lots and lots and lots of text."); |
|
52 |
|
53 _LIT8 (KEncoding, "UTF-8"); |
|
54 const TInt KMibEnum = 106; |
|
55 |
|
56 const TInt KUnloadedCodePage = 999; |
|
57 const TInt KUnknownToken = 999; |
|
58 |
|
59 |
|
60 |
|
61 CComponentTests* CComponentTests::NewL() |
|
62 { |
|
63 CComponentTests* self = new(ELeave) CComponentTests(); |
|
64 return self; |
|
65 } |
|
66 |
|
67 |
|
68 CComponentTests::CComponentTests() |
|
69 { |
|
70 // do nothing; |
|
71 } |
|
72 |
|
73 |
|
74 CComponentTests::~CComponentTests() |
|
75 { |
|
76 // do nothing; |
|
77 } |
|
78 |
|
79 |
|
80 //---------------------------------------------------------------------------- |
|
81 |
|
82 |
|
83 /** |
|
84 @SYMTestCaseID SYSLIB-XML-CT-1271 |
|
85 @SYMTestCaseDesc Tests for RTagInfo::Uri(),RTagInfo::Prefix(),RTagInfo::LocalName() functions |
|
86 @SYMTestPriority High |
|
87 @SYMTestActions Tests for heap leak,and open handles |
|
88 @SYMTestExpectedResults Test must not fail |
|
89 @SYMREQ REQ0000 |
|
90 */ |
|
91 void CComponentTests::Test1L() |
|
92 { |
|
93 test.Next(_L(" @SYMTestCaseID:SYSLIB-XML-CT-1271 Test1L ")); |
|
94 |
|
95 // RTagInfo Test |
|
96 // |
|
97 // =========================================== |
|
98 |
|
99 // Set up for heap leak checking |
|
100 __UHEAP_MARK; |
|
101 |
|
102 // and leaking thread handles |
|
103 TInt startProcessHandleCount; |
|
104 TInt startThreadHandleCount; |
|
105 TInt endProcessHandleCount; |
|
106 TInt endThreadHandleCount; |
|
107 |
|
108 RThread thisThread; |
|
109 thisThread.HandleCount(startProcessHandleCount, startThreadHandleCount); |
|
110 |
|
111 // Test Starts... |
|
112 |
|
113 iStringPool.OpenL(); |
|
114 CleanupClosePushL(iStringPool); |
|
115 |
|
116 RString string1 = iStringPool.OpenStringL(KTestString1); |
|
117 CleanupClosePushL(string1); |
|
118 |
|
119 RString string2 = iStringPool.OpenStringL(KTestString2); |
|
120 CleanupClosePushL(string2); |
|
121 |
|
122 RString string3 = iStringPool.OpenStringL(KTestString3); |
|
123 |
|
124 CleanupStack::Pop(&string2); |
|
125 CleanupStack::Pop(&string1); |
|
126 CleanupStack::Pop(&iStringPool); |
|
127 |
|
128 RTagInfo tagInfo; |
|
129 tagInfo.Open(string1, string2, string3); |
|
130 |
|
131 const RString& uri = tagInfo.Uri(); |
|
132 const RString& prefix = tagInfo.Prefix(); |
|
133 const RString& localName = tagInfo.LocalName(); |
|
134 |
|
135 test (KTestString1() == uri.DesC()); |
|
136 test (KTestString2() == prefix.DesC()); |
|
137 test (KTestString3() == localName.DesC()); |
|
138 |
|
139 tagInfo.Close(); |
|
140 iStringPool.Close(); |
|
141 |
|
142 //-------------- |
|
143 // Check for open handles |
|
144 thisThread.HandleCount(endProcessHandleCount, endThreadHandleCount); |
|
145 |
|
146 test(startThreadHandleCount == endThreadHandleCount); |
|
147 |
|
148 // Test Ends... |
|
149 |
|
150 __UHEAP_MARKEND; |
|
151 } |
|
152 |
|
153 |
|
154 //---------------------------------------------------------------------------- |
|
155 |
|
156 |
|
157 /** |
|
158 @SYMTestCaseID SYSLIB-XML-CT-1272 |
|
159 @SYMTestCaseDesc Test for RTagInfo copy constructor,assignment operator,Copy functions |
|
160 @SYMTestPriority High |
|
161 @SYMTestActions Create three RTagInfo objects using assignment operator,copy constructor,and Copy function with the same information that describes an element. |
|
162 Tests for the integrity of the data of all the three objects. |
|
163 Tests for heap leak and for open handles at the end of the test |
|
164 @SYMTestExpectedResults Test must not fail |
|
165 @SYMREQ REQ0000 |
|
166 */ |
|
167 void CComponentTests::Test2L() |
|
168 { |
|
169 test.Next(_L(" @SYMTestCaseID:SYSLIB-XML-CT-1272 Test2L ")); |
|
170 |
|
171 // RTagInfo Test |
|
172 // |
|
173 // =========================================== |
|
174 |
|
175 // Set up for heap leak checking |
|
176 __UHEAP_MARK; |
|
177 |
|
178 // and leaking thread handles |
|
179 TInt startProcessHandleCount; |
|
180 TInt startThreadHandleCount; |
|
181 TInt endProcessHandleCount; |
|
182 TInt endThreadHandleCount; |
|
183 |
|
184 RThread thisThread; |
|
185 thisThread.HandleCount(startProcessHandleCount, startThreadHandleCount); |
|
186 |
|
187 // Test Starts... |
|
188 |
|
189 iStringPool.OpenL(); |
|
190 CleanupClosePushL(iStringPool); |
|
191 |
|
192 RString string1 = iStringPool.OpenStringL(KTestString1); |
|
193 CleanupClosePushL(string1); |
|
194 |
|
195 RString string2 = iStringPool.OpenStringL(KTestString2); |
|
196 CleanupClosePushL(string2); |
|
197 |
|
198 RString string3 = iStringPool.OpenStringL(KTestString3); |
|
199 |
|
200 CleanupStack::Pop(&string2); |
|
201 CleanupStack::Pop(&string1); |
|
202 CleanupStack::Pop(&iStringPool); |
|
203 |
|
204 RTagInfo tagInfo; |
|
205 tagInfo.Open(string1, string2, string3); |
|
206 RTagInfo tagInfo2 = tagInfo; |
|
207 RTagInfo tagInfo3 (tagInfo); |
|
208 RTagInfo tagInfo4 = tagInfo.Copy(); |
|
209 |
|
210 const RString& uri = tagInfo.Uri(); |
|
211 const RString& prefix = tagInfo.Prefix(); |
|
212 const RString& localName = tagInfo.LocalName(); |
|
213 |
|
214 test (KTestString1() == uri.DesC()); |
|
215 test (KTestString2() == prefix.DesC()); |
|
216 test (KTestString3() == localName.DesC()); |
|
217 |
|
218 test (KTestString1() == tagInfo2.Uri().DesC()); |
|
219 test (KTestString2() == tagInfo2.Prefix().DesC()); |
|
220 test (KTestString3() == tagInfo2.LocalName().DesC()); |
|
221 |
|
222 test (KTestString1() == tagInfo3.Uri().DesC()); |
|
223 test (KTestString2() == tagInfo3.Prefix().DesC()); |
|
224 test (KTestString3() == tagInfo3.LocalName().DesC()); |
|
225 |
|
226 test (KTestString1() == tagInfo4.Uri().DesC()); |
|
227 test (KTestString2() == tagInfo4.Prefix().DesC()); |
|
228 test (KTestString3() == tagInfo4.LocalName().DesC()); |
|
229 |
|
230 tagInfo.Close(); |
|
231 tagInfo4.Close(); |
|
232 iStringPool.Close(); |
|
233 |
|
234 //-------------- |
|
235 // Check for open handles |
|
236 thisThread.HandleCount(endProcessHandleCount, endThreadHandleCount); |
|
237 |
|
238 test(startThreadHandleCount == endThreadHandleCount); |
|
239 |
|
240 // Test Ends... |
|
241 |
|
242 __UHEAP_MARKEND; |
|
243 } |
|
244 |
|
245 |
|
246 //---------------------------------------------------------------------------- |
|
247 |
|
248 |
|
249 /** |
|
250 @SYMTestCaseID SYSLIB-XML-CT-1273 |
|
251 @SYMTestCaseDesc Tests for RTagInfo created from RAttribute class |
|
252 @SYMTestPriority High |
|
253 @SYMTestActions Tests for the information of RTagInfo objects. |
|
254 Tests for heap leak and for open handles at the end of the test |
|
255 @SYMTestExpectedResults Test must not fail |
|
256 @SYMREQ REQ0000 |
|
257 */ |
|
258 void CComponentTests::Test3L() |
|
259 { |
|
260 test.Next(_L(" @SYMTestCaseID:SYSLIB-XML-CT-1273 Test3L ")); |
|
261 |
|
262 // RAttribute Test |
|
263 // |
|
264 // =========================================== |
|
265 |
|
266 // Set up for heap leak checking |
|
267 __UHEAP_MARK; |
|
268 |
|
269 // and leaking thread handles |
|
270 TInt startProcessHandleCount; |
|
271 TInt startThreadHandleCount; |
|
272 TInt endProcessHandleCount; |
|
273 TInt endThreadHandleCount; |
|
274 |
|
275 RThread thisThread; |
|
276 thisThread.HandleCount(startProcessHandleCount, startThreadHandleCount); |
|
277 |
|
278 // Test Starts... |
|
279 |
|
280 iStringPool.OpenL(); |
|
281 CleanupClosePushL(iStringPool); |
|
282 |
|
283 RString string1 = iStringPool.OpenStringL(KTestString1); |
|
284 CleanupClosePushL(string1); |
|
285 |
|
286 RString string2 = iStringPool.OpenStringL(KTestString2); |
|
287 CleanupClosePushL(string2); |
|
288 |
|
289 RString string3 = iStringPool.OpenStringL(KTestString3); |
|
290 CleanupClosePushL(string3); |
|
291 |
|
292 RString string4 = iStringPool.OpenStringL(KTestString4); |
|
293 |
|
294 CleanupStack::Pop(&string3); |
|
295 CleanupStack::Pop(&string2); |
|
296 CleanupStack::Pop(&string1); |
|
297 CleanupStack::Pop(&iStringPool); |
|
298 |
|
299 RAttribute attribute; |
|
300 attribute.Open(string1, string2, string3); |
|
301 attribute.SetValue(string4); |
|
302 |
|
303 const RTagInfo& tagInfo = attribute.Attribute(); |
|
304 const RString& value = attribute.Value(); |
|
305 TAttributeType type = attribute.Type(); |
|
306 |
|
307 test (KTestString1() == tagInfo.Uri().DesC()); |
|
308 test (KTestString2() == tagInfo.Prefix().DesC()); |
|
309 test (KTestString3() == tagInfo.LocalName().DesC()); |
|
310 test (KTestString4() == value.DesC()); |
|
311 test (EAttributeType_NONE == type); |
|
312 |
|
313 attribute.Close(); |
|
314 iStringPool.Close(); |
|
315 |
|
316 //-------------- |
|
317 // Check for open handles |
|
318 thisThread.HandleCount(endProcessHandleCount, endThreadHandleCount); |
|
319 |
|
320 test(startThreadHandleCount == endThreadHandleCount); |
|
321 |
|
322 // Test Ends... |
|
323 |
|
324 __UHEAP_MARKEND; |
|
325 } |
|
326 |
|
327 |
|
328 //---------------------------------------------------------------------------- |
|
329 |
|
330 |
|
331 /** |
|
332 @SYMTestCaseID SYSLIB-XML-CT-1274 |
|
333 @SYMTestCaseDesc Tests for RTagInfo created from RAttribute::Uri,Prefix,LocalName functions |
|
334 @SYMTestPriority High |
|
335 @SYMTestActions Create three RAttribute objects using copy constructor,assignment operator and Copy function.Test for information of RAttribute objects |
|
336 Tests for heap leak and for open handles at the end of the test |
|
337 @SYMTestExpectedResults Test must not fail |
|
338 @SYMREQ REQ0000 |
|
339 */ |
|
340 void CComponentTests::Test4L() |
|
341 { |
|
342 test.Next(_L(" @SYMTestCaseID:SYSLIB-XML-CT-1274 Test4L ")); |
|
343 |
|
344 // RAttribute Test |
|
345 // |
|
346 // =========================================== |
|
347 |
|
348 // Set up for heap leak checking |
|
349 __UHEAP_MARK; |
|
350 |
|
351 // and leaking thread handles |
|
352 TInt startProcessHandleCount; |
|
353 TInt startThreadHandleCount; |
|
354 TInt endProcessHandleCount; |
|
355 TInt endThreadHandleCount; |
|
356 |
|
357 RThread thisThread; |
|
358 thisThread.HandleCount(startProcessHandleCount, startThreadHandleCount); |
|
359 |
|
360 // Test Starts... |
|
361 |
|
362 iStringPool.OpenL(); |
|
363 CleanupClosePushL(iStringPool); |
|
364 |
|
365 RString string1 = iStringPool.OpenStringL(KTestString1); |
|
366 CleanupClosePushL(string1); |
|
367 |
|
368 RString string2 = iStringPool.OpenStringL(KTestString2); |
|
369 CleanupClosePushL(string2); |
|
370 |
|
371 RString string3 = iStringPool.OpenStringL(KTestString3); |
|
372 CleanupClosePushL(string3); |
|
373 |
|
374 RString string4 = iStringPool.OpenStringL(KTestString4); |
|
375 |
|
376 CleanupStack::Pop(&string3); |
|
377 CleanupStack::Pop(&string2); |
|
378 CleanupStack::Pop(&string1); |
|
379 CleanupStack::Pop(&iStringPool); |
|
380 |
|
381 RAttribute attribute; |
|
382 attribute.Open(string1, string2, string3, string4); |
|
383 RAttribute attribute2 = attribute; |
|
384 RAttribute attribute3 (attribute); |
|
385 RAttribute attribute4 = attribute.Copy(); |
|
386 |
|
387 const RTagInfo& tagInfo = attribute.Attribute(); |
|
388 const RString& value = attribute.Value(); |
|
389 TAttributeType type = attribute.Type(); |
|
390 |
|
391 test (KTestString1() == tagInfo.Uri().DesC()); |
|
392 test (KTestString2() == tagInfo.Prefix().DesC()); |
|
393 test (KTestString3() == tagInfo.LocalName().DesC()); |
|
394 test (KTestString4() == value.DesC()); |
|
395 test (EAttributeType_NONE == type); |
|
396 |
|
397 test (KTestString1() == attribute2.Attribute().Uri().DesC()); |
|
398 test (KTestString2() == attribute2.Attribute().Prefix().DesC()); |
|
399 test (KTestString3() == attribute2.Attribute().LocalName().DesC()); |
|
400 test (KTestString4() == attribute2.Value().DesC()); |
|
401 test (EAttributeType_NONE == attribute2.Type()); |
|
402 |
|
403 test (KTestString1() == attribute3.Attribute().Uri().DesC()); |
|
404 test (KTestString2() == attribute3.Attribute().Prefix().DesC()); |
|
405 test (KTestString3() == attribute3.Attribute().LocalName().DesC()); |
|
406 test (KTestString4() == attribute3.Value().DesC()); |
|
407 test (EAttributeType_NONE == attribute3.Type()); |
|
408 |
|
409 test (KTestString1() == attribute4.Attribute().Uri().DesC()); |
|
410 test (KTestString2() == attribute4.Attribute().Prefix().DesC()); |
|
411 test (KTestString3() == attribute4.Attribute().LocalName().DesC()); |
|
412 test (KTestString4() == attribute4.Value().DesC()); |
|
413 test (EAttributeType_NONE == attribute4.Type()); |
|
414 |
|
415 attribute.Close(); |
|
416 attribute4.Close(); |
|
417 iStringPool.Close(); |
|
418 |
|
419 //-------------- |
|
420 // Check for open handles |
|
421 thisThread.HandleCount(endProcessHandleCount, endThreadHandleCount); |
|
422 |
|
423 test(startThreadHandleCount == endThreadHandleCount); |
|
424 |
|
425 // Test Ends... |
|
426 |
|
427 __UHEAP_MARKEND; |
|
428 } |
|
429 |
|
430 |
|
431 //---------------------------------------------------------------------------- |
|
432 |
|
433 |
|
434 /** |
|
435 @SYMTestCaseID SYSLIB-XML-CT-1275 |
|
436 @SYMTestCaseDesc Tests for RTagInfo created from RAttribute::Uri,Prefix,LocalName functions |
|
437 @SYMTestPriority High |
|
438 @SYMTestActions Create RAttribute Test for information of RAttribute objects |
|
439 Tests for heap leak and for open handles at the end of the test |
|
440 @SYMTestExpectedResults Test must not fail |
|
441 @SYMREQ REQ0000 |
|
442 */ |
|
443 void CComponentTests::Test5L() |
|
444 { |
|
445 test.Next(_L(" @SYMTestCaseID:SYSLIB-XML-CT-1275 Test5L ")); |
|
446 |
|
447 // RAttribute Test |
|
448 // |
|
449 // =========================================== |
|
450 |
|
451 // Set up for heap leak checking |
|
452 __UHEAP_MARK; |
|
453 |
|
454 // and leaking thread handles |
|
455 TInt startProcessHandleCount; |
|
456 TInt startThreadHandleCount; |
|
457 TInt endProcessHandleCount; |
|
458 TInt endThreadHandleCount; |
|
459 |
|
460 RThread thisThread; |
|
461 thisThread.HandleCount(startProcessHandleCount, startThreadHandleCount); |
|
462 |
|
463 // Test Starts... |
|
464 |
|
465 iStringPool.OpenL(); |
|
466 CleanupClosePushL(iStringPool); |
|
467 |
|
468 RString string1 = iStringPool.OpenStringL(KTestString1); |
|
469 CleanupClosePushL(string1); |
|
470 |
|
471 RString string2 = iStringPool.OpenStringL(KTestString2); |
|
472 CleanupClosePushL(string2); |
|
473 |
|
474 RString string3 = iStringPool.OpenStringL(KTestString3); |
|
475 CleanupClosePushL(string3); |
|
476 |
|
477 RString string4 = iStringPool.OpenStringL(KTestString4); |
|
478 |
|
479 CleanupStack::Pop(&string3); |
|
480 CleanupStack::Pop(&string2); |
|
481 CleanupStack::Pop(&string1); |
|
482 CleanupStack::Pop(&iStringPool); |
|
483 |
|
484 RAttribute attribute; |
|
485 attribute.Open(string1, string2, string3, string4); |
|
486 |
|
487 const RTagInfo& tagInfo = attribute.Attribute(); |
|
488 const RString& value = attribute.Value(); |
|
489 TAttributeType type = attribute.Type(); |
|
490 |
|
491 test (KTestString1() == tagInfo.Uri().DesC()); |
|
492 test (KTestString2() == tagInfo.Prefix().DesC()); |
|
493 test (KTestString3() == tagInfo.LocalName().DesC()); |
|
494 test (KTestString4() == value.DesC()); |
|
495 test (EAttributeType_NONE == type); |
|
496 |
|
497 attribute.Close(); |
|
498 iStringPool.Close(); |
|
499 |
|
500 //-------------- |
|
501 // Check for open handles |
|
502 thisThread.HandleCount(endProcessHandleCount, endThreadHandleCount); |
|
503 |
|
504 test(startThreadHandleCount == endThreadHandleCount); |
|
505 |
|
506 // Test Ends... |
|
507 |
|
508 __UHEAP_MARKEND; |
|
509 } |
|
510 |
|
511 |
|
512 //---------------------------------------------------------------------------- |
|
513 |
|
514 |
|
515 /** |
|
516 @SYMTestCaseID SYSLIB-XML-CT-1276 |
|
517 @SYMTestCaseDesc Tests for information of the document to be passed to client RDocumentParameters::CharacterSetName() functions |
|
518 @SYMTestPriority High |
|
519 @SYMTestActions Tests for the character set name of document. |
|
520 Tests for heap leak and for open handles at the end of the test |
|
521 @SYMTestExpectedResults Test must not fail |
|
522 @SYMREQ REQ0000 |
|
523 */ |
|
524 void CComponentTests::Test6L() |
|
525 { |
|
526 test.Next(_L(" @SYMTestCaseID:SYSLIB-XML-CT-1276 Test6L ")); |
|
527 |
|
528 // RDocumentParameters Test |
|
529 // |
|
530 // =========================================== |
|
531 |
|
532 // Set up for heap leak checking |
|
533 __UHEAP_MARK; |
|
534 |
|
535 // and leaking thread handles |
|
536 TInt startProcessHandleCount; |
|
537 TInt startThreadHandleCount; |
|
538 TInt endProcessHandleCount; |
|
539 TInt endThreadHandleCount; |
|
540 |
|
541 RThread thisThread; |
|
542 thisThread.HandleCount(startProcessHandleCount, startThreadHandleCount); |
|
543 |
|
544 // Test Starts... |
|
545 |
|
546 iStringPool.OpenL(); |
|
547 CleanupClosePushL(iStringPool); |
|
548 |
|
549 RString characterSetName = iStringPool.OpenStringL(KCharSetName); |
|
550 |
|
551 CleanupStack::Pop(&iStringPool); |
|
552 |
|
553 RDocumentParameters docParam; |
|
554 docParam.Open(characterSetName); |
|
555 |
|
556 test (KCharSetName() == docParam.CharacterSetName().DesC()); |
|
557 |
|
558 docParam.Close(); |
|
559 iStringPool.Close(); |
|
560 |
|
561 |
|
562 //-------------- |
|
563 // Check for open handles |
|
564 thisThread.HandleCount(endProcessHandleCount, endThreadHandleCount); |
|
565 |
|
566 test(startThreadHandleCount == endThreadHandleCount); |
|
567 |
|
568 // Test Ends... |
|
569 |
|
570 __UHEAP_MARKEND; |
|
571 } |
|
572 |
|
573 |
|
574 //---------------------------------------------------------------------------- |
|
575 |
|
576 |
|
577 /** |
|
578 @SYMTestCaseID SYSLIB-XML-CT-1277 |
|
579 @SYMTestCaseDesc Tests for information of the document to be passed to client RDocumentParameters::CharacterSetName functions |
|
580 @SYMTestPriority High |
|
581 @SYMTestActions Tests for the character set name of document |
|
582 Tests for heap leak and for open handles at the end of the test |
|
583 @SYMTestExpectedResults Test must not fail |
|
584 @SYMREQ REQ0000 |
|
585 */ |
|
586 void CComponentTests::Test7L() |
|
587 { |
|
588 test.Next(_L(" @SYMTestCaseID:SYSLIB-XML-CT-1277 Test7L ")); |
|
589 |
|
590 // RDocumentParameters Test |
|
591 // |
|
592 // =========================================== |
|
593 |
|
594 // Set up for heap leak checking |
|
595 __UHEAP_MARK; |
|
596 |
|
597 // and leaking thread handles |
|
598 TInt startProcessHandleCount; |
|
599 TInt startThreadHandleCount; |
|
600 TInt endProcessHandleCount; |
|
601 TInt endThreadHandleCount; |
|
602 |
|
603 RThread thisThread; |
|
604 thisThread.HandleCount(startProcessHandleCount, startThreadHandleCount); |
|
605 |
|
606 // Test Starts... |
|
607 |
|
608 iStringPool.OpenL(); |
|
609 CleanupClosePushL(iStringPool); |
|
610 |
|
611 RString characterSetName = iStringPool.OpenStringL(KCharSetName); |
|
612 CleanupStack::Pop(&iStringPool); |
|
613 |
|
614 RDocumentParameters docParam; |
|
615 docParam.Open(characterSetName); |
|
616 |
|
617 test (KCharSetName() == docParam.CharacterSetName().DesC()); |
|
618 |
|
619 docParam.Close(); |
|
620 iStringPool.Close(); |
|
621 |
|
622 //-------------- |
|
623 // Check for open handles |
|
624 thisThread.HandleCount(endProcessHandleCount, endThreadHandleCount); |
|
625 |
|
626 test(startThreadHandleCount == endThreadHandleCount); |
|
627 |
|
628 // Test Ends... |
|
629 |
|
630 __UHEAP_MARKEND; |
|
631 } |
|
632 |
|
633 |
|
634 //---------------------------------------------------------------------------- |
|
635 |
|
636 |
|
637 /** |
|
638 @SYMTestCaseID SYSLIB-XML-CT-1278 |
|
639 @SYMTestCaseDesc Tests for RStringDictionaryCollection::CompareThisDictionary(),SwitchCodePage, |
|
640 ElementL,AttributeL,AttributeValuePairL,AttributeValueL functions |
|
641 @SYMTestPriority High |
|
642 @SYMTestActions Tests for no error,unsupported XML value,XML unsupported Element, |
|
643 XML unsupported Attribute,XML unsupported AttributeValue |
|
644 Tests for heap leak and for open handles at the end of the test |
|
645 @SYMTestExpectedResults Test must not fail |
|
646 @SYMREQ REQ0000 |
|
647 */ |
|
648 void CComponentTests::Test8L() |
|
649 { |
|
650 test.Next(_L(" @SYMTestCaseID:SYSLIB-XML-CT-1278 Test8L ")); |
|
651 |
|
652 // RStringDictionaryCollection Test |
|
653 // |
|
654 // =========================================== |
|
655 |
|
656 // Set up for heap leak checking |
|
657 __UHEAP_MARK; |
|
658 |
|
659 // and leaking thread handles |
|
660 TInt startProcessHandleCount; |
|
661 TInt startThreadHandleCount; |
|
662 TInt endProcessHandleCount; |
|
663 TInt endThreadHandleCount; |
|
664 |
|
665 RThread thisThread; |
|
666 thisThread.HandleCount(startProcessHandleCount, startThreadHandleCount); |
|
667 |
|
668 // Test Starts... |
|
669 |
|
670 RStringDictionaryCollection nsCollection; |
|
671 CleanupClosePushL(nsCollection); |
|
672 |
|
673 nsCollection.OpenL(); |
|
674 |
|
675 nsCollection.OpenDictionaryL (KDictionaryUri); |
|
676 |
|
677 RString nsUri = nsCollection.StringPool().OpenStringL(KDictionaryUri); |
|
678 CleanupClosePushL(nsUri); |
|
679 |
|
680 RString element; |
|
681 RString attribute; |
|
682 RString value; |
|
683 |
|
684 CleanupClosePushL(element); |
|
685 CleanupClosePushL(attribute); |
|
686 CleanupClosePushL(value); |
|
687 |
|
688 |
|
689 test (nsCollection.CurrentDictionaryL().CompareThisDictionary(nsUri) == (TInt) ETrue); |
|
690 |
|
691 test (nsCollection.CurrentDictionaryL().SwitchCodePage(KUnloadedCodePage) == KErrXmlMissingStringDictionary); |
|
692 |
|
693 TRAPD(err, nsCollection.CurrentDictionaryL().ElementL(CTestStringDictionary00::ETokenValueAdd, element)); |
|
694 test (err == KErrNone); |
|
695 test (element.DesC() == KAddElement); |
|
696 element.Close(); // as we are reassigning |
|
697 |
|
698 TRAP (err, nsCollection.CurrentDictionaryL().ElementL(KUnknownToken, element)); |
|
699 test (err == KErrXmlUnsupportedElement); |
|
700 |
|
701 TRAP (err, nsCollection.CurrentDictionaryL().AttributeL(KUnknownToken, attribute)); |
|
702 test (err == KErrXmlUnsupportedAttribute); |
|
703 attribute.Close(); // as we are reassigning |
|
704 |
|
705 TRAP (err, nsCollection.CurrentDictionaryL().AttributeValuePairL(KUnknownToken, attribute, value)); |
|
706 test (err == KErrXmlUnsupportedAttribute); |
|
707 attribute.Close(); // as we are reassigning |
|
708 value.Close(); // as we are reassigning |
|
709 |
|
710 TRAP (err, nsCollection.CurrentDictionaryL().AttributeValueL(KUnknownToken, value)); |
|
711 test (err == KErrXmlUnsupportedAttributeValue); |
|
712 value.Close(); // as we are reassigning |
|
713 |
|
714 CleanupStack::PopAndDestroy(&value); |
|
715 CleanupStack::PopAndDestroy(&attribute); |
|
716 CleanupStack::PopAndDestroy(&element); |
|
717 CleanupStack::PopAndDestroy(&nsUri); // on the stringpool |
|
718 |
|
719 nsCollection.Close(); |
|
720 |
|
721 CleanupStack::Pop(&nsCollection); |
|
722 |
|
723 |
|
724 //-------------- |
|
725 // Check for open handles |
|
726 thisThread.HandleCount(endProcessHandleCount, endThreadHandleCount); |
|
727 |
|
728 test(startThreadHandleCount == endThreadHandleCount); |
|
729 |
|
730 // Test Ends... |
|
731 |
|
732 __UHEAP_MARKEND; |
|
733 } |
|
734 |
|
735 |
|
736 //---------------------------------------------------------------------------- |
|
737 |
|
738 |
|
739 /** |
|
740 @SYMTestCaseID SYSLIB-XML-CT-1279 |
|
741 @SYMTestCaseDesc Tests for CCharSetConverter functions |
|
742 @SYMTestPriority High |
|
743 @SYMTestActions Tests for UTF-8 to Unicode and Unicode to UTF-8 character set conversions. |
|
744 Tests for no error , no memory error |
|
745 Tests for heap leak and for open handles at the end of the test |
|
746 @SYMTestExpectedResults Test must not fail |
|
747 @SYMREQ REQ0000 |
|
748 */ |
|
749 void CComponentTests::Test9L() |
|
750 { |
|
751 test.Next(_L(" @SYMTestCaseID:SYSLIB-XML-CT-1279 Test9L ")); |
|
752 |
|
753 // CCharSetConverter Test |
|
754 // |
|
755 // =========================================== |
|
756 |
|
757 // Set up for heap leak checking |
|
758 __UHEAP_MARK; |
|
759 |
|
760 // and leaking thread handles |
|
761 TInt startProcessHandleCount; |
|
762 TInt startThreadHandleCount; |
|
763 TInt endProcessHandleCount; |
|
764 TInt endThreadHandleCount; |
|
765 |
|
766 RThread thisThread; |
|
767 thisThread.HandleCount(startProcessHandleCount, startThreadHandleCount); |
|
768 |
|
769 // Test Starts... |
|
770 |
|
771 CCharSetConverter* charSet = CCharSetConverter::NewL(); |
|
772 CleanupStack::PushL(charSet); |
|
773 |
|
774 TInt err = KErrNone; |
|
775 TUint charSetUid = 0; |
|
776 |
|
777 TRAP (err, charSet->PrepareCharConvL(charSetUid, KEncoding)); |
|
778 // extra clause for OOM tests |
|
779 test (err == KErrNone || err == KErrNoMemory); |
|
780 |
|
781 TRAP (err, charSet->PrepareCharConvL(charSetUid, KMibEnum)); |
|
782 // extra clause for OOM tests |
|
783 test (err == KErrNone || err == KErrNoMemory); |
|
784 |
|
785 // convert to unicode from utf-8 |
|
786 HBufC16* unicodeConversion = NULL; |
|
787 err = charSet->ConvertToUnicodeL(charSetUid, KTestString1, unicodeConversion); |
|
788 CleanupStack::PushL(unicodeConversion); |
|
789 test (err == KErrNone); |
|
790 TBuf16<100> compare; |
|
791 compare.Copy(KTestString1); |
|
792 test (*unicodeConversion == compare); |
|
793 |
|
794 // convert to utf-8 from unicode |
|
795 HBufC8* utf8Conversion = NULL; |
|
796 err = charSet->ConvertFromUnicodeL(*unicodeConversion, charSetUid, utf8Conversion); |
|
797 CleanupStack::PushL(utf8Conversion); |
|
798 test (err == KErrNone); |
|
799 test (*utf8Conversion == KTestString1()); |
|
800 |
|
801 CleanupStack::PopAndDestroy(utf8Conversion); |
|
802 CleanupStack::PopAndDestroy(unicodeConversion); |
|
803 |
|
804 // really a test of CharConv as we call it directly. |
|
805 TRAP (err, charSet->PrepareToConvertToOrFromL(charSetUid)); |
|
806 // extra clause for OOM tests |
|
807 test (err == KErrNone || err == KErrNoMemory); |
|
808 |
|
809 |
|
810 const TInt KUcs4Count = 23; |
|
811 TUint32 ucs4 [KUcs4Count] = {0}; |
|
812 ucs4 [0] = 'T'; |
|
813 ucs4 [1] = 'h'; |
|
814 ucs4 [2] = 'i'; |
|
815 ucs4 [3] = 's'; |
|
816 ucs4 [4] = ' '; |
|
817 ucs4 [5] = 'i'; |
|
818 ucs4 [6] = 's'; |
|
819 ucs4 [7] = ' '; |
|
820 ucs4 [8] = 'a'; |
|
821 ucs4 [9] = ' '; |
|
822 ucs4 [10] = 't'; |
|
823 ucs4 [11] = 'e'; |
|
824 ucs4 [12] = 's'; |
|
825 ucs4 [13] = 't'; |
|
826 ucs4 [14] = ' '; |
|
827 ucs4 [15] = 's'; |
|
828 ucs4 [16] = 't'; |
|
829 ucs4 [17] = 'r'; |
|
830 ucs4 [18] = 'i'; |
|
831 ucs4 [19] = 'n'; |
|
832 ucs4 [20] = 'g'; |
|
833 ucs4 [21] = '1'; |
|
834 ucs4 [22] = '.'; |
|
835 |
|
836 utf8Conversion = NULL; |
|
837 err = charSet->ConvertUcs4CharactersToEncodingL(ucs4, KUcs4Count, KCharacterSetIdentifierUtf8, utf8Conversion); |
|
838 CleanupStack::PushL(utf8Conversion); |
|
839 test (err == KErrNone); |
|
840 test (*utf8Conversion == KTestString1()); |
|
841 CleanupStack::PopAndDestroy(utf8Conversion); |
|
842 |
|
843 HBufC8* Output8 = NULL; |
|
844 err = charSet->ConvertFromUnicodeL(largebuf16, charSetUid, Output8); |
|
845 CleanupStack::PushL(Output8); |
|
846 test (err == KErrNone); |
|
847 test(largebuf8 == *Output8); |
|
848 |
|
849 HBufC16* Output16 = NULL; |
|
850 err = charSet->ConvertToUnicodeL(charSetUid, largebuf8, Output16); |
|
851 CleanupStack::PushL(Output16); |
|
852 test (err == KErrNone); |
|
853 test(largebuf16 == *Output16); |
|
854 |
|
855 CleanupStack::PopAndDestroy(Output16); |
|
856 CleanupStack::PopAndDestroy(Output8); |
|
857 CleanupStack::PopAndDestroy(charSet); |
|
858 |
|
859 //-------------- |
|
860 // Check for open handles |
|
861 thisThread.HandleCount(endProcessHandleCount, endThreadHandleCount); |
|
862 |
|
863 test(startThreadHandleCount == endThreadHandleCount); |
|
864 |
|
865 // Test Ends... |
|
866 |
|
867 __UHEAP_MARKEND; |
|
868 } |
|
869 |
|
870 |
|
871 //---------------------------------------------------------------------------- |
|
872 |
|
873 |
|
874 /** |
|
875 @SYMTestCaseID SYSLIB-XML-UT-3718 |
|
876 @SYMTestCaseDesc CDictionaryCodePage tests |
|
877 @SYMTestPriority Medium |
|
878 @SYMTestActions Creating a link between indicies and tokens. Checking a token returns an index from the string pool and then |
|
879 checking if an index return a token. |
|
880 @SYMTestExpectedResults Indicies and tokens are returns (and not returned) when expected. |
|
881 @SYMDEF DEF071977 |
|
882 */ |
|
883 void CComponentTests::Test10L() |
|
884 { |
|
885 test.Next(_L(" @SYMTestCaseID:SYSLIB-XML-UT-3718 Test10L ")); |
|
886 |
|
887 // Set up for heap leak checking |
|
888 __UHEAP_MARK; |
|
889 |
|
890 // and leaking thread handles |
|
891 TInt startProcessHandleCount; |
|
892 TInt startThreadHandleCount; |
|
893 TInt endProcessHandleCount; |
|
894 TInt endThreadHandleCount; |
|
895 TInt index; |
|
896 TInt token; |
|
897 |
|
898 RThread thisThread; |
|
899 thisThread.HandleCount(startProcessHandleCount, startThreadHandleCount); |
|
900 |
|
901 |
|
902 |
|
903 iStringPool.OpenL(t_StringDictionary00TagTable::Table); |
|
904 CleanupClosePushL(iStringPool); |
|
905 |
|
906 CDictionaryCodePage* codepage = CDictionaryCodePage::NewL(&t_StringDictionary00TagTable::Table, &t_StringDictionary00TagTable::Table, &t_StringDictionary00TagTable::Table, 0); |
|
907 CleanupStack::PushL(codepage); |
|
908 |
|
909 // Construct the correlation mapping |
|
910 codepage->ConstructIndexMappingL(iCodePage00, CDictionaryCodePage::EStringTypeElement); |
|
911 codepage->ConstructIndexMappingL(iCodePage00, CDictionaryCodePage::EStringTypeAttribute); |
|
912 codepage->ConstructIndexMappingL(iCodePage00, CDictionaryCodePage::EStringTypeAttributeValue); |
|
913 |
|
914 index = codepage->StringPoolIndexFromToken(CTestStringDictionary00::ETokenValueAdd, CDictionaryCodePage::EStringTypeElement); |
|
915 test(index!=KErrXmlStringPoolTableNotFound); |
|
916 |
|
917 index = codepage->StringPoolIndexFromToken(KUnknownToken, CDictionaryCodePage::EStringTypeElement); |
|
918 test(index==KErrXmlStringPoolTableNotFound); |
|
919 |
|
920 index = codepage->StringPoolIndexFromToken(CTestStringDictionary00::ETokenValueAdd,CDictionaryCodePage::EStringTypeAttribute); |
|
921 test(index!=KErrXmlStringPoolTableNotFound); |
|
922 |
|
923 index = codepage->StringPoolIndexFromToken(KUnknownToken, CDictionaryCodePage::EStringTypeAttribute); |
|
924 test(index==KErrXmlStringPoolTableNotFound); |
|
925 |
|
926 index = codepage->StringPoolIndexFromToken(CTestStringDictionary00::ETokenValueAdd,CDictionaryCodePage::EStringTypeAttributeValue); |
|
927 test(index!=KErrXmlStringPoolTableNotFound); |
|
928 |
|
929 index = codepage->StringPoolIndexFromToken(KUnknownToken, CDictionaryCodePage::EStringTypeAttributeValue); |
|
930 test(index==KErrXmlStringPoolTableNotFound); |
|
931 |
|
932 token = codepage->TokenFromStringPoolIndex(0,CDictionaryCodePage::EStringTypeElement); |
|
933 test(token==CTestStringDictionary00::ETokenValueAdd); |
|
934 |
|
935 token = codepage->TokenFromStringPoolIndex(0,CDictionaryCodePage::EStringTypeAttribute); |
|
936 test(token==CTestStringDictionary00::ETokenValueAdd); |
|
937 |
|
938 token = codepage->TokenFromStringPoolIndex(0,CDictionaryCodePage::EStringTypeAttributeValue); |
|
939 test(token==CTestStringDictionary00::ETokenValueAdd); |
|
940 |
|
941 test(codepage->CodePage()==0); |
|
942 |
|
943 |
|
944 const RString& aPubId = iStringPool.String(t_StringDictionary00TagTable::EFormalPublicId, |
|
945 *(codepage->StringTable(CDictionaryCodePage::EStringTypeElement))); |
|
946 |
|
947 TPtrC8 ades = aPubId.DesC(); |
|
948 test(ades.Compare(KDictionaryUri)==0); |
|
949 |
|
950 const RString& aPubId1 = iStringPool.String(t_StringDictionary00TagTable::EFormalPublicId, |
|
951 *(codepage->StringTable(CDictionaryCodePage::EStringTypeAttribute))); |
|
952 TPtrC8 ades1 = aPubId1.DesC(); |
|
953 test(ades1.Compare(KDictionaryUri)==0); |
|
954 |
|
955 const RString& aPubId2 = iStringPool.String(t_StringDictionary00TagTable::EFormalPublicId, |
|
956 *(codepage->StringTable(CDictionaryCodePage::EStringTypeAttributeValue))); |
|
957 TPtrC8 ades2 = aPubId2.DesC(); |
|
958 test(ades1.Compare(KDictionaryUri)==0); |
|
959 |
|
960 |
|
961 CleanupStack::PopAndDestroy(codepage); |
|
962 |
|
963 CleanupStack::PopAndDestroy(&iStringPool); |
|
964 |
|
965 |
|
966 |
|
967 //-------------- |
|
968 // Check for open handles |
|
969 thisThread.HandleCount(endProcessHandleCount, endThreadHandleCount); |
|
970 |
|
971 test(startThreadHandleCount == endThreadHandleCount); |
|
972 |
|
973 // Test Ends... |
|
974 __UHEAP_MARKEND; |
|
975 |
|
976 } |
|
977 |
|
978 |
|
979 //---------------------------------------------------------------------------- |
|
980 |
|
981 |
|
982 /** |
|
983 @SYMTestCaseID SYSLIB-XML-UT-1577 |
|
984 @SYMTestCaseDesc Tests the TPtr Overloaded CCharSetConverter functions, making sure they |
|
985 function correctly. |
|
986 @SYMTestPriority High |
|
987 @SYMTestActions Tests for UTF-8 to Unicode and Unicode to UTF-8 character set conversions. |
|
988 Tests for heap leak and for open handles at the end of the test. |
|
989 @SYMTestExpectedResults Test must not fail |
|
990 @SYMDEF DEF075739 |
|
991 */ |
|
992 void CComponentTests::Test11L() |
|
993 { |
|
994 test.Next(_L(" @SYMTestCaseID:SYSLIB-XML-UT-1577 Test11L ")); |
|
995 |
|
996 // CCharSetConverter Test |
|
997 // |
|
998 // =========================================== |
|
999 |
|
1000 // Set up for heap leak checking |
|
1001 __UHEAP_MARK; |
|
1002 |
|
1003 TPtr8 conversionOutput8(0,0); |
|
1004 TPtr16 conversionOutput16(0,0); |
|
1005 |
|
1006 // and leaking thread handles |
|
1007 TInt startProcessHandleCount; |
|
1008 TInt startThreadHandleCount; |
|
1009 TInt endProcessHandleCount; |
|
1010 TInt endThreadHandleCount; |
|
1011 |
|
1012 RThread thisThread; |
|
1013 thisThread.HandleCount(startProcessHandleCount, startThreadHandleCount); |
|
1014 |
|
1015 // Test Starts... |
|
1016 |
|
1017 CCharSetConverter* charSet = CCharSetConverter::NewL(); |
|
1018 CleanupStack::PushL(charSet); |
|
1019 |
|
1020 TInt err = KErrNone; |
|
1021 TUint charSetUid = 0; |
|
1022 |
|
1023 TRAP (err, charSet->PrepareCharConvL(charSetUid, KEncoding)); |
|
1024 // extra clause for OOM tests |
|
1025 test (err == KErrNone || err == KErrNoMemory); |
|
1026 |
|
1027 TRAP (err, charSet->PrepareCharConvL(charSetUid, KMibEnum)); |
|
1028 // extra clause for OOM tests |
|
1029 test (err == KErrNone || err == KErrNoMemory); |
|
1030 |
|
1031 // convert to unicode from utf-8 |
|
1032 err = charSet->ConvertToUnicodeL(charSetUid, KTestString1, conversionOutput16); |
|
1033 test (err == KErrNone); |
|
1034 TBuf16<100> compare; |
|
1035 compare.Copy(KTestString1); |
|
1036 test (conversionOutput16 == compare); |
|
1037 |
|
1038 // convert to utf-8 from unicode |
|
1039 err = charSet->ConvertFromUnicodeL(conversionOutput16, charSetUid, conversionOutput8); |
|
1040 test (err == KErrNone); |
|
1041 test (conversionOutput8 == KTestString1()); |
|
1042 |
|
1043 // really a test of CharConv as we call it directly. |
|
1044 TRAP (err, charSet->PrepareToConvertToOrFromL(charSetUid)); |
|
1045 // extra clause for OOM tests |
|
1046 test (err == KErrNone || err == KErrNoMemory); |
|
1047 |
|
1048 //Try converting a large amount of data, will require the output buffer to increase in size |
|
1049 //Using the TPtr overload |
|
1050 err = charSet->ConvertFromUnicodeL(largebuf16, charSetUid, conversionOutput8); |
|
1051 test (err == KErrNone); |
|
1052 test(largebuf8 == conversionOutput8); |
|
1053 |
|
1054 //Try converting a large amount of data, will require the output buffer to increase in size |
|
1055 //Using the TPtr overload |
|
1056 err = charSet->ConvertToUnicodeL(charSetUid, largebuf8, conversionOutput16); |
|
1057 test (err == KErrNone); |
|
1058 test(largebuf16 == conversionOutput16); |
|
1059 |
|
1060 CleanupStack::PopAndDestroy(charSet); |
|
1061 |
|
1062 //-------------- |
|
1063 // Check for open handles |
|
1064 thisThread.HandleCount(endProcessHandleCount, endThreadHandleCount); |
|
1065 |
|
1066 test(startThreadHandleCount == endThreadHandleCount); |
|
1067 |
|
1068 // Test Ends... |
|
1069 |
|
1070 __UHEAP_MARKEND; |
|
1071 } |
|
1072 |
|
1073 |
|
1074 //---------------------------------------------------------------------------- |
|
1075 |
|
1076 |
|
1077 /** |
|
1078 @SYMTestCaseID SYSLIB-XML-UT-1662 |
|
1079 @SYMTestCaseDesc Tests the CCharSetConverter::ConvertToUnicodeL function to ensure that an inputBuffer which is |
|
1080 larger than 32kB doesn't cause the CCharSetConverter::iConversionBufferSize to overflow. |
|
1081 @SYMTestPriority High |
|
1082 @SYMTestActions Tests CCharSetConverter::ConvertToUnicodeL(TUint32 aSrcCharset, const TDesC8& aInput, TPtr16& aOutput) with aInput > 32kB. |
|
1083 Tests for heap leak and for open handles at the end of the test |
|
1084 @SYMTestExpectedResults Test must not fail |
|
1085 @SYMDEF DEF081549 |
|
1086 */ |
|
1087 void CComponentTests::Test12L() |
|
1088 { |
|
1089 test.Next(_L(" @SYMTestCaseID:SYSLIB-XML-UT-1662 Test12L ")); |
|
1090 |
|
1091 // Testing CCharSetConverter::ConvertToUnicodeL(TUint32 aSrcCharset, const TDesC8& aInput, TPtr16& aOutput) |
|
1092 // with aInput > 32kB. |
|
1093 // |
|
1094 // =========================================== |
|
1095 |
|
1096 // Set up for heap leak checking |
|
1097 __UHEAP_MARK; |
|
1098 |
|
1099 // and leaking thread handles |
|
1100 TInt startProcessHandleCount; |
|
1101 TInt startThreadHandleCount; |
|
1102 TInt endProcessHandleCount; |
|
1103 TInt endThreadHandleCount; |
|
1104 |
|
1105 RThread thisThread; |
|
1106 thisThread.HandleCount(startProcessHandleCount, startThreadHandleCount); |
|
1107 |
|
1108 // Test Starts... |
|
1109 |
|
1110 CCharSetConverter* charSet = CCharSetConverter::NewL(); |
|
1111 CleanupStack::PushL(charSet); |
|
1112 |
|
1113 TInt err = KErrNone; |
|
1114 TUint charSetUid = 0; |
|
1115 |
|
1116 TRAP (err, charSet->PrepareCharConvL(charSetUid, KEncoding)); |
|
1117 // extra clause for OOM tests |
|
1118 test (err == KErrNone || err == KErrNoMemory); |
|
1119 |
|
1120 TRAP (err, charSet->PrepareCharConvL(charSetUid, KMibEnum)); |
|
1121 // extra clause for OOM tests |
|
1122 test (err == KErrNone || err == KErrNoMemory); |
|
1123 |
|
1124 // convert large string (>32kB) to unicode |
|
1125 TPtr16 largeUnicodeConversion(0,0); |
|
1126 err = charSet->ConvertToUnicodeL(charSetUid, KTestString5, largeUnicodeConversion); |
|
1127 test (err == KErrNone); |
|
1128 |
|
1129 CleanupStack::PopAndDestroy(charSet); |
|
1130 |
|
1131 //-------------- |
|
1132 // Check for open handles |
|
1133 thisThread.HandleCount(endProcessHandleCount, endThreadHandleCount); |
|
1134 |
|
1135 test(startThreadHandleCount == endThreadHandleCount); |
|
1136 |
|
1137 // Test Ends... |
|
1138 |
|
1139 __UHEAP_MARKEND; |
|
1140 } |
|
1141 |
|
1142 |
|
1143 //---------------------------------------------------------------------------- |
|
1144 |
|
1145 |
|
1146 class CTest : public CBase |
|
1147 { |
|
1148 public: |
|
1149 void MainL(); |
|
1150 }; |
|
1151 |
|
1152 |
|
1153 typedef void (CComponentTests::*ClassFuncPtrL) (void); |
|
1154 |
|
1155 |
|
1156 //---------------------------------------------------------------------------- |
|
1157 |
|
1158 |
|
1159 /** |
|
1160 @SYMTestCaseID SYSLIB-XML-CT-1280 |
|
1161 @SYMTestCaseDesc Tests for out of memory conditions |
|
1162 @SYMTestPriority High |
|
1163 @SYMTestActions Tests all basic components for memory errors |
|
1164 @SYMTestExpectedResults Test must not fail |
|
1165 @SYMREQ REQ0000 |
|
1166 */ |
|
1167 static void DoOomTestL(CComponentTests* aObjectPtr, ClassFuncPtrL testFuncL) |
|
1168 { |
|
1169 test.Start(_L(" @SYMTestCaseID:SYSLIB-XML-CT-1280 OOM test ")); |
|
1170 TInt err, tryCount = 0; |
|
1171 do |
|
1172 { |
|
1173 User::__DbgSetAllocFail(RHeap::EUser, RHeap::EFailNext, ++tryCount); |
|
1174 User::__DbgMarkStart(RHeap::EUser); |
|
1175 TRAP(err, (aObjectPtr->*testFuncL)()); |
|
1176 User::__DbgMarkEnd(RHeap::EUser, 0); |
|
1177 } while(err==KErrNoMemory); |
|
1178 |
|
1179 if(err==KErrNone) |
|
1180 { |
|
1181 // Reset |
|
1182 User::__DbgSetAllocFail(RHeap::EUser,RHeap::ENone,1); |
|
1183 } |
|
1184 else |
|
1185 { |
|
1186 User::Panic(_L("Unexpected leave reason"),err); |
|
1187 } |
|
1188 |
|
1189 test.Printf(_L("- server succeeded at heap failure rate of %i\n"), tryCount); |
|
1190 test.End(); |
|
1191 } |
|
1192 |
|
1193 |
|
1194 //---------------------------------------------------------------------------- |
|
1195 |
|
1196 |
|
1197 static void BasicComponentTestsL() |
|
1198 { |
|
1199 test.Next(_L("BasicComponentTests...")); |
|
1200 |
|
1201 __UHEAP_MARK; |
|
1202 |
|
1203 CComponentTests* client1 = CComponentTests::NewL(); |
|
1204 CleanupStack::PushL(client1); |
|
1205 client1->Test1L(); |
|
1206 CleanupStack::PopAndDestroy(client1); |
|
1207 |
|
1208 CComponentTests* client2 = CComponentTests::NewL(); |
|
1209 CleanupStack::PushL(client2); |
|
1210 client2->Test2L(); |
|
1211 CleanupStack::PopAndDestroy(client2); |
|
1212 |
|
1213 CComponentTests* client3 = CComponentTests::NewL(); |
|
1214 CleanupStack::PushL(client3); |
|
1215 client3->Test3L(); |
|
1216 CleanupStack::PopAndDestroy(client3); |
|
1217 |
|
1218 CComponentTests* client4 = CComponentTests::NewL(); |
|
1219 CleanupStack::PushL(client4); |
|
1220 client4->Test4L(); |
|
1221 CleanupStack::PopAndDestroy(client4); |
|
1222 |
|
1223 CComponentTests* client5 = CComponentTests::NewL(); |
|
1224 CleanupStack::PushL(client5); |
|
1225 client5->Test5L(); |
|
1226 CleanupStack::PopAndDestroy(client5); |
|
1227 |
|
1228 CComponentTests* client6 = CComponentTests::NewL(); |
|
1229 CleanupStack::PushL(client6); |
|
1230 client6->Test6L(); |
|
1231 CleanupStack::PopAndDestroy(client6); |
|
1232 |
|
1233 CComponentTests* client7 = CComponentTests::NewL(); |
|
1234 CleanupStack::PushL(client7); |
|
1235 client7->Test7L(); |
|
1236 CleanupStack::PopAndDestroy(client7); |
|
1237 |
|
1238 CComponentTests* client8 = CComponentTests::NewL(); |
|
1239 CleanupStack::PushL(client8); |
|
1240 client8->Test8L(); |
|
1241 CleanupStack::PopAndDestroy(client8); |
|
1242 |
|
1243 CComponentTests* client9 = CComponentTests::NewL(); |
|
1244 CleanupStack::PushL(client9); |
|
1245 client9->Test9L(); |
|
1246 CleanupStack::PopAndDestroy(client9); |
|
1247 |
|
1248 CComponentTests* client10 = CComponentTests::NewL(); |
|
1249 CleanupStack::PushL(client10); |
|
1250 client10->Test10L(); |
|
1251 CleanupStack::PopAndDestroy(client10); |
|
1252 |
|
1253 CComponentTests* client11 = CComponentTests::NewL(); |
|
1254 CleanupStack::PushL(client11); |
|
1255 client11->Test11L(); |
|
1256 CleanupStack::PopAndDestroy(client11); |
|
1257 |
|
1258 CComponentTests* client12 = CComponentTests::NewL(); |
|
1259 CleanupStack::PushL(client12); |
|
1260 client12->Test12L(); |
|
1261 CleanupStack::PopAndDestroy(client12); |
|
1262 |
|
1263 __UHEAP_MARKEND; |
|
1264 } |
|
1265 |
|
1266 |
|
1267 //---------------------------------------------------------------------------- |
|
1268 |
|
1269 |
|
1270 static void OomTestsL() |
|
1271 { |
|
1272 test.Next(_L("OOM Tests ...")); |
|
1273 |
|
1274 __UHEAP_MARK; |
|
1275 |
|
1276 CComponentTests* client1 = CComponentTests::NewL(); |
|
1277 CleanupStack::PushL(client1); |
|
1278 DoOomTestL(client1, &CComponentTests::Test1L); |
|
1279 CleanupStack::PopAndDestroy(client1); |
|
1280 |
|
1281 CComponentTests* client2 = CComponentTests::NewL(); |
|
1282 CleanupStack::PushL(client2); |
|
1283 DoOomTestL(client2, &CComponentTests::Test2L); |
|
1284 CleanupStack::PopAndDestroy(client2); |
|
1285 |
|
1286 CComponentTests* client3 = CComponentTests::NewL(); |
|
1287 CleanupStack::PushL(client3); |
|
1288 DoOomTestL(client3, &CComponentTests::Test3L); |
|
1289 CleanupStack::PopAndDestroy(client3); |
|
1290 |
|
1291 CComponentTests* client4 = CComponentTests::NewL(); |
|
1292 CleanupStack::PushL(client4); |
|
1293 DoOomTestL(client4, &CComponentTests::Test4L); |
|
1294 CleanupStack::PopAndDestroy(client4); |
|
1295 |
|
1296 CComponentTests* client5 = CComponentTests::NewL(); |
|
1297 CleanupStack::PushL(client5); |
|
1298 DoOomTestL(client5, &CComponentTests::Test5L); |
|
1299 CleanupStack::PopAndDestroy(client5); |
|
1300 |
|
1301 CComponentTests* client6 = CComponentTests::NewL(); |
|
1302 CleanupStack::PushL(client6); |
|
1303 DoOomTestL(client6, &CComponentTests::Test6L); |
|
1304 CleanupStack::PopAndDestroy(client6); |
|
1305 |
|
1306 CComponentTests* client7 = CComponentTests::NewL(); |
|
1307 CleanupStack::PushL(client7); |
|
1308 DoOomTestL(client7, &CComponentTests::Test7L); |
|
1309 CleanupStack::PopAndDestroy(client7); |
|
1310 |
|
1311 CComponentTests* client8 = CComponentTests::NewL(); |
|
1312 CleanupStack::PushL(client8); |
|
1313 DoOomTestL(client8, &CComponentTests::Test8L); |
|
1314 CleanupStack::PopAndDestroy(client8); |
|
1315 |
|
1316 CComponentTests* client9 = CComponentTests::NewL(); |
|
1317 CleanupStack::PushL(client9); |
|
1318 DoOomTestL(client9, &CComponentTests::Test9L); |
|
1319 CleanupStack::PopAndDestroy(client9); |
|
1320 |
|
1321 CComponentTests* client10 = CComponentTests::NewL(); |
|
1322 CleanupStack::PushL(client10); |
|
1323 DoOomTestL(client10, &CComponentTests::Test10L); |
|
1324 CleanupStack::PopAndDestroy(client10); |
|
1325 |
|
1326 CComponentTests* client11 = CComponentTests::NewL(); |
|
1327 CleanupStack::PushL(client11); |
|
1328 DoOomTestL(client11, &CComponentTests::Test11L); |
|
1329 CleanupStack::PopAndDestroy(client11); |
|
1330 |
|
1331 CComponentTests* client12 = CComponentTests::NewL(); |
|
1332 CleanupStack::PushL(client12); |
|
1333 DoOomTestL(client12, &CComponentTests::Test12L); |
|
1334 CleanupStack::PopAndDestroy(client12); |
|
1335 |
|
1336 __UHEAP_MARKEND; |
|
1337 } |
|
1338 |
|
1339 |
|
1340 //---------------------------------------------------------------------------- |
|
1341 |
|
1342 |
|
1343 static void MainL() |
|
1344 { |
|
1345 BasicComponentTestsL(); |
|
1346 OomTestsL(); |
|
1347 } |
|
1348 |
|
1349 |
|
1350 //---------------------------------------------------------------------------- |
|
1351 |
|
1352 |
|
1353 TInt E32Main() |
|
1354 { |
|
1355 __UHEAP_MARK; |
|
1356 test.Title(); |
|
1357 test.Start(_L("initialising")); |
|
1358 |
|
1359 CTrapCleanup* c=CTrapCleanup::New(); |
|
1360 |
|
1361 // start the loader |
|
1362 RFs fs; |
|
1363 test (fs.Connect()==KErrNone); |
|
1364 fs.Close(); |
|
1365 |
|
1366 test (c!=0); |
|
1367 TRAPD(r,MainL()); |
|
1368 test.End(); |
|
1369 test (r==KErrNone); |
|
1370 delete c; |
|
1371 test.Close(); |
|
1372 __UHEAP_MARKEND; |
|
1373 return KErrNone; |
|
1374 } |