1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <QtTest/QtTest> |
|
20 #include <QObject> |
|
21 #include <qtestcase.h> |
|
22 #include <t_s60qconversions.h> |
|
23 |
|
24 |
|
25 void TestS60QConversions::initTestCase() |
|
26 { |
|
27 |
|
28 mS60QConversions=0; |
|
29 } |
|
30 |
|
31 |
|
32 void TestS60QConversions::Tests60DescToQString() |
|
33 { |
|
34 HBufC* temp = HBufC::NewLC(10); |
|
35 temp->Des().Copy(_L("Sometext")); |
|
36 |
|
37 QString text= S60QConversions::s60DescToQString(temp->Des()); |
|
38 QVERIFY(text==QString("Sometext")); |
|
39 CleanupStack::PopAndDestroy(temp); |
|
40 |
|
41 } |
|
42 |
|
43 void TestS60QConversions::TestqStringToS60Desc() |
|
44 { |
|
45 QString str ="ExampleText"; |
|
46 HBufC* s60text = S60QConversions::qStringToS60Desc(str); |
|
47 QVERIFY(str==QString("ExampleText")); |
|
48 |
|
49 } |
|
50 |
|
51 void TestS60QConversions::Tests60Desc8ToQString() |
|
52 { |
|
53 HBufC8* temp = HBufC8::NewLC(10); |
|
54 temp->Des().Copy(_L("Sometext")); |
|
55 |
|
56 QString text= S60QConversions::s60Desc8ToQString(temp->Des() ); |
|
57 QVERIFY(text==QString("Sometext")); |
|
58 |
|
59 CleanupStack::PopAndDestroy(temp); |
|
60 } |
|
61 |
|
62 void TestS60QConversions::TestqStringToS60Desc8() |
|
63 { |
|
64 QString str ="ExampleText"; |
|
65 _LIT8(qStr8,"ExampleText"); |
|
66 HBufC8* s60text = S60QConversions::qStringToS60Desc8(str); |
|
67 QVERIFY(s60text->Des() == qStr8); |
|
68 |
|
69 } |
|
70 |
|
71 void TestS60QConversions::cleanupTestCase() |
|
72 { |
|
73 delete mS60QConversions; |
|
74 } |
|
75 |
|
76 |
|
77 |
|
78 |
|