49 // Destroy functions |
49 // Destroy functions |
50 |
50 |
51 TInt KillProcess(const TDesC& aProcessName) |
51 TInt KillProcess(const TDesC& aProcessName) |
52 { |
52 { |
53 TFullName name; |
53 TFullName name; |
54 //RDebug::Print(_L("Find and kill \"%S\" process.\n"), &aProcessName); |
|
55 TBuf<64> pattern(aProcessName); |
54 TBuf<64> pattern(aProcessName); |
56 TInt length = pattern.Length(); |
55 TInt length = pattern.Length(); |
57 pattern += _L("*"); |
56 pattern += _L("*"); |
58 TFindProcess procFinder(pattern); |
57 TFindProcess procFinder(pattern); |
59 |
58 |
98 void Check(TInt aValue, TInt aLine) |
95 void Check(TInt aValue, TInt aLine) |
99 { |
96 { |
100 if(!aValue) |
97 if(!aValue) |
101 { |
98 { |
102 DestroyTestEnv(); |
99 DestroyTestEnv(); |
|
100 TheTest.Printf(_L("*** Expression evaluated to false\r\n")); |
103 TheTest(EFalse, aLine); |
101 TheTest(EFalse, aLine); |
104 } |
102 } |
105 } |
103 } |
106 void Check(TInt aValue, TInt aExpected, TInt aLine) |
104 void Check(TInt aValue, TInt aExpected, TInt aLine) |
107 { |
105 { |
108 if(aValue != aExpected) |
106 if(aValue != aExpected) |
109 { |
107 { |
110 DestroyTestEnv(); |
108 DestroyTestEnv(); |
111 RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); |
109 TheTest.Printf(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); |
112 TheTest(EFalse, aLine); |
110 TheTest(EFalse, aLine); |
113 } |
111 } |
114 } |
112 } |
115 #define TEST(arg) ::Check((arg), __LINE__) |
113 #define TEST(arg) ::Check((arg), __LINE__) |
116 #define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__) |
114 #define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__) |