kerneltest/f32test/server/t_cp_plugin.cpp
changeset 109 b3a1d9898418
parent 33 0173bcd7697c
child 257 3e88ff8f41d5
equal deleted inserted replaced
102:ef2a444a7410 109:b3a1d9898418
    14 // 
    14 // 
    15 //
    15 //
    16 //
    16 //
    17 
    17 
    18 
    18 
       
    19 #define __E32TEST_EXTENSION__
    19 #include <f32file.h>
    20 #include <f32file.h>
    20 #include <e32ldr.h>
    21 #include <e32ldr.h>
    21 #include <e32ldr_private.h>
    22 #include <e32ldr_private.h>
    22 #include <e32test.h>
    23 #include <e32test.h>
    23 #include <hal.h>
    24 #include <hal.h>
    40 void TestINC127905();
    41 void TestINC127905();
    41 void DeleteTestDirectory();
    42 void DeleteTestDirectory();
    42 void TestCompatibility();
    43 void TestCompatibility();
    43 void TestINC126563();
    44 void TestINC126563();
    44 
    45 
    45 // Codepage dll name
       
    46 _LIT(KCP932Name,"T_CP932");
       
    47 
    46 
    48 TInt LoadCodePageDll(const TDesC& aCodePageDllName)
    47 TInt LoadCodePageDll(const TDesC& aCodePageDllName)
    49 	{
    48 	{
    50 	RDebug::Printf("++ T_CP_PLUGIN.CPP LoadCodePageDll");
    49 	RDebug::Printf("++ T_CP_PLUGIN.CPP LoadCodePageDll");
    51 	
    50 	
    93 
    92 
    94 	test.Title();
    93 	test.Title();
    95 	test.Start(_L("Starting T_CP_PLUGIN tests"));
    94 	test.Start(_L("Starting T_CP_PLUGIN tests"));
    96 
    95 
    97 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
    96 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
    98 
    97 	// Codepage dll name
       
    98 	_LIT(KCP932Name,"T_CP932");
    99 	// Test only runs on Fat file systems
    99 	// Test only runs on Fat file systems
   100 	TheFs.SessionPath(gSessionPath);
   100 	TheFs.SessionPath(gSessionPath);
   101 	TInt driveNum = CurrentDrive();
   101 	TInt driveNum = CurrentDrive();
   102 	TFSName name;
   102 	TFSName name;
   103 	TInt r = TheFs.FileSystemName(name, driveNum);
   103 	TInt r = TheFs.FileSystemName(name, driveNum);
   109 			}
   109 			}
   110 		else
   110 		else
   111 			{
   111 			{
   112 			TBuf<16> CodepageDllName(KCP932Name);
   112 			TBuf<16> CodepageDllName(KCP932Name);
   113 			r = LoadCodePageDll(CodepageDllName);
   113 			r = LoadCodePageDll(CodepageDllName);
   114 			test(r == KErrNone || r == KErrAlreadyExists);
   114 			test_Value(r, r == KErrNone || r == KErrAlreadyExists);
   115 
   115 
   116 			if(r == KErrNone)
   116 			if(r == KErrNone)
   117 				{
   117 				{
   118 				// should not allow loading again codepage dll.
   118 				// should not allow loading again codepage dll.
   119 				r = LoadCodePageDll(CodepageDllName);
   119 				r = LoadCodePageDll(CodepageDllName);
   120 				test(r == KErrAlreadyExists);
   120 				test_Value(r, r == KErrAlreadyExists);
   121 
   121 
   122 				}
   122 				}
   123 
   123 
   124 			// Enables codepage dll implementation of LocaleUtils functions
   124 			// Enables codepage dll implementation of LocaleUtils functions
   125 			TInt r = TheFs.ControlIo(CurrentDrive(), KControlIoEnableFatUtilityFunctions);
   125 			TInt r = TheFs.ControlIo(CurrentDrive(), KControlIoEnableFatUtilityFunctions);
   127 
   127 
   128 			DoCodePagePluginTest();
   128 			DoCodePagePluginTest();
   129 
   129 
   130 			// Disables codepage dll implementation of LocaleUtils functions for other base tests
   130 			// Disables codepage dll implementation of LocaleUtils functions for other base tests
   131 			r = TheFs.ControlIo(driveNum, KControlIoDisableFatUtilityFunctions);
   131 			r = TheFs.ControlIo(driveNum, KControlIoDisableFatUtilityFunctions);
   132 			test(r == KErrNone);
   132 			test_KErrNone(r);
   133 			}
   133 			}
   134 		}
   134 		}
   135 	else
   135 	else
   136 		{
   136 		{
   137 		test.Printf(_L("Drive %C: is not ready!"), 'A'+driveNum);
   137 		test.Printf(_L("Drive %C: is not ready!"), 'A'+driveNum);