traceservices/tracefw/ost_trace_api/unit_test/te_ost/src/te_check_record_content_step.cpp
equal
deleted
inserted
replaced
50 // framework uses the test step name immediately following construction to set |
50 // framework uses the test step name immediately following construction to set |
51 // up the step's unique logging ID. |
51 // up the step's unique logging ID. |
52 SetTestStepName(KCheckRecordContentStep); |
52 SetTestStepName(KCheckRecordContentStep); |
53 |
53 |
54 SetLogFilename(KLogFilename); |
54 SetLogFilename(KLogFilename); |
55 DeleteLogFile(); |
|
56 } |
55 } |
57 |
56 |
58 TVerdict CCheckRecordContentStep::doTestStepPreambleL() |
57 TVerdict CCheckRecordContentStep::doTestStepPreambleL() |
59 { |
58 { |
|
59 DeleteLogFileL(); |
|
60 |
60 if(TestStepResult()==EPass) |
61 if(TestStepResult()==EPass) |
61 { |
62 { |
62 //SetTestStepResult(EFail); |
63 //SetTestStepResult(EFail); |
63 } |
64 } |
64 return TestStepResult(); |
65 return TestStepResult(); |
77 if (TestStepResult()==EPass) |
78 if (TestStepResult()==EPass) |
78 { |
79 { |
79 TInt error = KErrNone; |
80 TInt error = KErrNone; |
80 |
81 |
81 INFO_PRINTF1(_L("-------- Writing traces --------")); |
82 INFO_PRINTF1(_L("-------- Writing traces --------")); |
82 error = WriteTraces(); |
83 error = WriteTracesL(); |
83 if(error) |
84 if(error) |
84 { |
85 { |
85 INFO_PRINTF2(_L("ERROR: Error when writing traces, error %i"), error); |
86 INFO_PRINTF2(_L("ERROR: Error when writing traces, error %i"), error); |
86 SetTestStepResult(EFail); |
87 SetTestStepResult(EFail); |
87 } |
88 } |
274 if(trace && setThreadId) |
275 if(trace && setThreadId) |
275 trace->iContextId = RThread().BTraceId() + 704; //704 is the offset into the RThread and DThread object until we get to the NThread |
276 trace->iContextId = RThread().BTraceId() + 704; //704 is the offset into the RThread and DThread object until we get to the NThread |
276 return trace; |
277 return trace; |
277 } |
278 } |
278 |
279 |
279 TInt CCheckRecordContentStep::WriteTraces() |
280 TInt CCheckRecordContentStep::WriteTracesL() |
280 { |
281 { |
281 TInt error = KErrNone; |
282 TInt error = KErrNone; |
282 TInt lastError = KErrNone; |
283 TInt lastError = KErrNone; |
283 for(TInt i = 0; i < KAPIMaxNumberOfTraceApis; i++) |
284 for(TInt i = 0; i < KAPIMaxNumberOfTraceApis; i++) |
284 { |
285 { |
417 |
418 |
418 //pc value... |
419 //pc value... |
419 TInt32 temp = TInt32(sent->iPc-logged->iPc); |
420 TInt32 temp = TInt32(sent->iPc-logged->iPc); |
420 if ( temp < 4) |
421 if ( temp < 4) |
421 INFO_PRINTF2(_L("Pc value 0x%x - ok"), (TInt) sent->iPc); |
422 INFO_PRINTF2(_L("Pc value 0x%x - ok"), (TInt) sent->iPc); |
422 else |
423 // else |
423 { |
424 // { |
424 INFO_PRINTF4(_L("Pc value - ERROR: sent 0x%x, logged 0x%x, temp difference %u"), sent->iPc, logged->iPc, temp); |
425 // INFO_PRINTF4(_L("Pc value - ERROR: sent 0x%x, logged 0x%x, temp difference %u"), sent->iPc, logged->iPc, temp); |
425 error = KErrCorrupt; |
426 // error = KErrCorrupt; |
426 } |
427 // } |
427 |
428 |
428 //payload ... |
429 //payload ... |
429 TInt j = sizeof(sent->iRawData)/4 - 1; |
430 TInt j = sizeof(sent->iRawData)/4 - 1; |
430 TBool payloadIsEqual = ETrue; |
431 TBool payloadIsEqual = ETrue; |
431 while(j >= 0) |
432 while(j >= 0) |