author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 11 Jun 2010 15:02:23 +0300 | |
changeset 152 | 657f875b013e |
parent 109 | b3a1d9898418 |
child 257 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 2007-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 the License "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 |
// |
|
17 |
||
18 |
||
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
19 |
#define __E32TEST_EXTENSION__ |
0 | 20 |
#include <f32file.h> |
33
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
21 |
#include <e32ldr.h> |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
22 |
#include <e32ldr_private.h> |
0 | 23 |
#include <e32test.h> |
24 |
#include <hal.h> |
|
25 |
#include "t_server.h" |
|
26 |
#include "f32dbg.h" |
|
27 |
||
28 |
||
29 |
GLDEF_D RTest test(_L("T_CP_PLUGIN")); |
|
30 |
||
31 |
// function decalarations |
|
32 |
void DoCodePagePluginTest(); |
|
33 |
void TestUnicodeVolumeLabel(); |
|
34 |
void TestShortNameBoundary(); |
|
35 |
void TestConsistentShortNameGeneration(); |
|
36 |
void TestConsistentShortNameExtGeneration(); |
|
37 |
void TestDuplicateLongFileNames(); |
|
38 |
void TestDuplicateLongDirNames(); |
|
39 |
void TestLeadingE5Handling(); |
|
40 |
void TestDEF130334(); |
|
41 |
void TestINC127905(); |
|
42 |
void DeleteTestDirectory(); |
|
43 |
void TestCompatibility(); |
|
44 |
void TestINC126563(); |
|
45 |
||
46 |
||
47 |
TInt LoadCodePageDll(const TDesC& aCodePageDllName) |
|
48 |
{ |
|
49 |
RDebug::Printf("++ T_CP_PLUGIN.CPP LoadCodePageDll"); |
|
50 |
||
51 |
TInt err = KErrNone; |
|
52 |
if(aCodePageDllName.Length()) |
|
53 |
{ |
|
54 |
RDebug::Print(_L("IS: codepageDllName = %S"), &aCodePageDllName); |
|
55 |
RLoader loader; |
|
56 |
err = loader.Connect(); |
|
57 |
if (err==KErrNone) |
|
58 |
{ |
|
59 |
err = loader.SendReceive(ELoadCodePage, TIpcArgs(0, &aCodePageDllName, 0)); |
|
60 |
RDebug::Printf("\n T_CP_PLUGIN.CPP : LoadCodePageDll : loader.SendReceive == %d", err); |
|
61 |
loader.Close(); |
|
62 |
} |
|
63 |
} |
|
64 |
RDebug::Printf("-- T_CP_PLUGIN.CPP LoadCodePageDll"); |
|
65 |
return err; |
|
66 |
} |
|
67 |
||
68 |
void DoCodePagePluginTest() |
|
69 |
{ |
|
70 |
RDebug::Printf("++ T_CP_PLUGIN.CPP DoCodePagePluginTestL"); |
|
71 |
||
72 |
CreateTestDirectory(_L("\\F32-TST\\T_CP_PLUGIN\\")); |
|
73 |
TestUnicodeVolumeLabel(); |
|
74 |
TestShortNameBoundary(); |
|
75 |
TestConsistentShortNameGeneration(); |
|
76 |
TestConsistentShortNameExtGeneration(); |
|
77 |
TestDuplicateLongFileNames(); |
|
78 |
TestDuplicateLongDirNames(); |
|
79 |
TestLeadingE5Handling(); |
|
80 |
TestDEF130334(); |
|
81 |
TestINC127905(); |
|
82 |
DeleteTestDirectory(); |
|
83 |
TestCompatibility(); |
|
84 |
TestINC126563(); |
|
85 |
||
86 |
RDebug::Printf("-- T_CP_PLUGIN.CPP DoCodePagePluginTestL"); |
|
87 |
} |
|
88 |
||
89 |
||
90 |
void CallTestsL(void) |
|
91 |
{ |
|
92 |
||
93 |
test.Title(); |
|
94 |
test.Start(_L("Starting T_CP_PLUGIN tests")); |
|
95 |
||
96 |
#if defined(_DEBUG) || defined(_DEBUG_RELEASE) |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
97 |
// Codepage dll name |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
98 |
_LIT(KCP932Name,"T_CP932"); |
0 | 99 |
// Test only runs on Fat file systems |
100 |
TheFs.SessionPath(gSessionPath); |
|
101 |
TInt driveNum = CurrentDrive(); |
|
102 |
TFSName name; |
|
103 |
TInt r = TheFs.FileSystemName(name, driveNum); |
|
104 |
if (KErrNone == r) |
|
105 |
{ |
|
106 |
if (name.Compare(_L("Fat")) != 0) |
|
107 |
{ |
|
108 |
test.Printf(_L("Test only runs on 'FAT' drives")); |
|
109 |
} |
|
110 |
else |
|
111 |
{ |
|
112 |
TBuf<16> CodepageDllName(KCP932Name); |
|
113 |
r = LoadCodePageDll(CodepageDllName); |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
114 |
test_Value(r, r == KErrNone || r == KErrAlreadyExists); |
0 | 115 |
|
116 |
if(r == KErrNone) |
|
117 |
{ |
|
118 |
// should not allow loading again codepage dll. |
|
119 |
r = LoadCodePageDll(CodepageDllName); |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
120 |
test_Value(r, r == KErrAlreadyExists); |
0 | 121 |
|
122 |
} |
|
123 |
||
124 |
// Enables codepage dll implementation of LocaleUtils functions |
|
125 |
TInt r = TheFs.ControlIo(CurrentDrive(), KControlIoEnableFatUtilityFunctions); |
|
126 |
test(KErrNone == r); |
|
127 |
||
128 |
DoCodePagePluginTest(); |
|
129 |
||
130 |
// Disables codepage dll implementation of LocaleUtils functions for other base tests |
|
131 |
r = TheFs.ControlIo(driveNum, KControlIoDisableFatUtilityFunctions); |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
132 |
test_KErrNone(r); |
0 | 133 |
} |
134 |
} |
|
135 |
else |
|
136 |
{ |
|
137 |
test.Printf(_L("Drive %C: is not ready!"), 'A'+driveNum); |
|
138 |
test(EFalse); |
|
139 |
} |
|
140 |
#else |
|
141 |
test.Printf(_L("Test only runs on DEBUG builds, see test logs of debug builds for details.")); |
|
142 |
#endif // _DEBUG) || _DEBUG_RELEASE |
|
143 |
test.End(); |
|
144 |
} |
|
145 |