--- a/charconvfw/fatfilenameconversionplugins/test/T_CP950.CPP Tue Aug 31 17:01:26 2010 +0300
+++ b/charconvfw/fatfilenameconversionplugins/test/T_CP950.CPP Wed Sep 01 12:39:40 2010 +0100
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -16,20 +16,10 @@
*/
-#include "T_CP950.h"
+#include <e32test.h>
#include <e32des8.h>
-#define test(cond) \
- { \
- TBool __bb = (cond); \
- TEST(__bb); \
- if (!__bb) \
- { \
- ERR_PRINTF1(_L("ERROR: Test Failed")); \
- User::Leave(1); \
- } \
- }
-
+LOCAL_D RTest test(_L("T_CP950.exe"));
_LIT16(Uni_1, "\x0053\x3125\x3122\xAAAA\x9673\x2593\xFA0C\x3000");
_LIT8(CP950_1, "\x53\xA3\xB6\xA3\xB3\x5F\xB3\xAF\xF9\xFE\xC9\x4A\xA1\x40");
@@ -51,9 +41,9 @@
@SYMTestActions Tests for conversions from/to Unicode, using a function pointer
@SYMTestExpectedResults Test must not fail
*/
-void CT_CP950::TestL()
+void Test()
{
- INFO_PRINTF1(_L("@SYMTestCaseID:SYSLIB-FATCHARSETCONV-CT-1776"));
+ test.Next(_L("@SYMTestCaseID:SYSLIB-FATCHARSETCONV-CT-1776"));
RLibrary lib;
const TUidType serverUid(KNullUid,KNullUid,KPluginUid);
@@ -107,7 +97,7 @@
}
// test code for INC080460: FATCharsetConv panics - stops china build booting
-void CT_CP950::TestINC080460L()
+void TestINC080460()
{
RLibrary lib;
const TUidType serverUid(KNullUid,KNullUid,KPluginUid);
@@ -202,9 +192,9 @@
@SYMTestActions Tests for correct character conversion on certain chinese characters for CP936
@SYMTestExpectedResults Test must not fail
*/
-void CT_CP950::TestINC090073L()
+void TestINC090073()
{
- INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-FATCHARSETCONV-CT-1847-0003 "));
+ test.Next(_L(" @SYMTestCaseID:SYSLIB-FATCHARSETCONV-CT-1847-0003 "));
_LIT16(unicode, "\x7C91\x8026\x8160\x7633\x6DFC\x715C\x6600\x9785\x86D8\x7A37\x61A9\x80B1\x86A3\x89E5\x80F2\x9B48\x6C19\x7B71\x946B\x6B46\x6615");
_LIT8(CP950Code, "\xD3\x4A\xBD\xA2\xDF\x73\xEA\x6F\xD9\xE7\xB7\xD4\xA9\xFB\xBB\xDF\xDB\xB1\xBD\x5E\xBE\xCD\xAA\xD0\xB0\x47\xDF\xFD\xD3\x6A\xEF\x69\xCB\x49\xDF\x4E\xF8\xCA\xDD\xF5\xA9\xFD");
@@ -235,9 +225,9 @@
lib.Close();
}
-void CT_CP950::OOMTestL()
+void OOMTest()
{
- INFO_PRINTF1(_L("OOM testing"));
+ test.Next(_L("OOM testing"));
TInt err, tryCount = 0;
do
{
@@ -250,7 +240,7 @@
// Setting Heap failure for OOM test
__UHEAP_SETFAIL(RHeap::EDeterministic, ++tryCount);
- TRAP(err,TestL());
+ TRAP(err,Test());
__UHEAP_SETFAIL(RHeap::ENone, 0);
@@ -266,33 +256,32 @@
}while (err == KErrNoMemory);
test(err == KErrNone);
- INFO_PRINTF2(_L("- server succeeded at heap failure rate of %i\n"), tryCount);
+ test.Printf(_L("- server succeeded at heap failure rate of %i\n"), tryCount);
}
-CT_CP950::CT_CP950()
- {
- SetTestStepName(KTestStep_T_CP950);
- }
-
+LOCAL_C void DoE32MainL()
+ {
+ Test();
+ TestINC090073();
+ TestINC080460();
+ OOMTest();
+ }
-TVerdict CT_CP950::doTestStepL()
- {
- SetTestStepResult(EFail);
-
- __UHEAP_MARK;
+GLDEF_C TInt E32Main()
+ {
+ __UHEAP_MARK;
- TRAPD(error1, TestL());
- TRAPD(error2, TestINC090073L());
- TRAPD(error3, TestINC080460L());
- TRAPD(error4, OOMTestL());
+ test.Title();
+ test.Start(_L("CP950 test..."));
- __UHEAP_MARKEND;
+ CTrapCleanup* trapCleanup=CTrapCleanup::New();
+ TRAPD(error, DoE32MainL());
+ delete trapCleanup;
- if(error1 == KErrNone && error2 == KErrNone && error3 == KErrNone && error4 == KErrNone)
- {
- SetTestStepResult(EPass);
- }
+ test.End();
+ test.Close();
- return TestStepResult();
- }
+ __UHEAP_MARKEND;
+ return error;
+ }