traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-file/uloggerfileplugintest.cpp
branchRCL_3
changeset 24 cc28652e0254
parent 23 26645d81f48d
equal deleted inserted replaced
23:26645d81f48d 24:cc28652e0254
    34 	INFO_PRINTF1(_L("Checking that pointer returned by CFileWriter::NewL() is not NULL"));
    34 	INFO_PRINTF1(_L("Checking that pointer returned by CFileWriter::NewL() is not NULL"));
    35 	ASSERT_NOT_NULL(fileWriter);
    35 	ASSERT_NOT_NULL(fileWriter);
    36 	delete fileWriter;
    36 	delete fileWriter;
    37 	}
    37 	}
    38 /*
    38 /*
    39  * TestUnlockResourcesL: Test that the CloseOutputPlugin method ???
    39  * TestUnlockResources: Test that the CloseOutputPlugin method ???
    40  *
    40  *
    41  * Expected Verdict: PASS/FAIL/PANIC
    41  * Expected Verdict: PASS/FAIL/PANIC
    42  *
    42  *
    43  * Prerequisites:
    43  * Prerequisites:
    44  *
    44  *
    45  * Description: Retrieve and print some data from an external ini data file
    45  * Description: Retrieve and print some data from an external ini data file
    46  *
    46  *
    47  */
    47  */
    48 void CFile0Step::TestUnlockResourcesL()
    48 void CFile0Step::TestUnlockResources()
    49 	{
    49 	{
    50 	CFileWriter* fileWriter = CFileWriter::NewL();
    50 	CFileWriter* fileWriter = CFileWriter::NewL();
    51 	INFO_PRINTF1(_L("Invoking CFileWriter::CloseOutputPlugin(). CloseOutputPlugin() is supposed to do nothing."));
    51 	INFO_PRINTF1(_L("Invoking CFileWriter::CloseOutputPlugin(). CloseOutputPlugin() is supposed to do nothing."));
    52 	fileWriter->CloseOutputPlugin();
    52 	fileWriter->CloseOutputPlugin();
    53 	ASSERT_TRUE(ETrue);
    53 	ASSERT_TRUE(ETrue);
    54 	delete fileWriter;
    54 	delete fileWriter;
    55 	}
    55 	}
    56 
    56 
    57 /*
    57 /*
    58  * TestSettingsL: Test that the Settings method ???
    58  * TestSettings: Test that the Settings method ???
    59  *
    59  *
    60  * Expected Verdict: PASS/FAIL/PANIC
    60  * Expected Verdict: PASS/FAIL/PANIC
    61  *
    61  *
    62  * Prerequisites:
    62  * Prerequisites:
    63  *
    63  *
    64  * Description: Retrieve and print some data from an external ini data file
    64  * Description: Retrieve and print some data from an external ini data file
    65  *
    65  *
    66  */
    66  */
    67 void CFile0Step::TestSettingsL()
    67 void CFile0Step::TestSettings()
    68 	{
    68 	{
    69 	CFileWriter* fileWriter = CFileWriter::NewL();
    69 	CFileWriter* fileWriter = CFileWriter::NewL();
    70 	INFO_PRINTF1(_L("Passing empty RPointerArray to CFileWriter::ConfigureOutputPlugin()"));
    70 	INFO_PRINTF1(_L("Passing empty RPointerArray to CFileWriter::ConfigureOutputPlugin()"));
    71 	RPointerArray<TPluginConfiguration> emptyPointerArray;
    71 	RPointerArray<TPluginConfiguration> emptyPointerArray;
    72 	fileWriter->ConfigureOutputPlugin(emptyPointerArray);
    72 	fileWriter->ConfigureOutputPlugin(emptyPointerArray);
    73 
    73 
    74 	delete fileWriter;
    74 	delete fileWriter;
    75 	}
    75 	}
    76 
    76 
    77 /*
    77 /*
    78  * TestWriteL: Test that the Write method ???
    78  * TestWrite: Test that the Write method ???
    79  *
    79  *
    80  * Expected Verdict: PASS/FAIL/PANIC
    80  * Expected Verdict: PASS/FAIL/PANIC
    81  *
    81  *
    82  * Prerequisites:
    82  * Prerequisites:
    83  *
    83  *
    84  * Description: Invoke CFileWriter::Write() and check that test string is
    84  * Description: Invoke CFileWriter::Write() and check that test string is
    85  *              written to KLogDefaultFileName correctly.
    85  *              written to KLogDefaultFileName correctly.
    86  *
    86  *
    87  */
    87  */
    88 // The implementation for this is not working correctly! Check this
    88 // The implementation for this is not working correctly! Check this
    89 void CFile0Step::TestWriteL()
    89 void CFile0Step::TestWrite()
    90 	{
    90 	{
    91 	INFO_PRINTF1(_L("Checking that CFileWriter::Write(const TDesC8&) writes a String correctly to C:\\logs\\log.txt"));
    91 	INFO_PRINTF1(_L("Checking that CFileWriter::Write(const TDesC8&) writes a String correctly to C:\\logs\\log.txt"));
    92 
    92 
    93 	// Create new CFileWriter instance
    93 	// Create new CFileWriter instance
    94 	CFileWriter* fileWriter = CFileWriter::NewL();
    94 	CFileWriter* fileWriter = CFileWriter::NewL();
   134  */
   134  */
   135 	{	
   135 	{	
   136 	  if (TestStepResult()==EPass)
   136 	  if (TestStepResult()==EPass)
   137 		{
   137 		{
   138 		TestNewL();
   138 		TestNewL();
   139 		TestUnlockResourcesL();
   139 		TestUnlockResources();
   140 		TestSettingsL();
   140 		TestSettings();
   141 		TestWriteL();
   141 		TestWrite();
   142 		
   142 		
   143 		if(iErrors == 0)
   143 		if(iErrors == 0)
   144 			SetTestStepResult(EPass);
   144 			SetTestStepResult(EPass);
   145 		else
   145 		else
   146 			{
   146 			{