1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
83 static void Check(TInt aValue, TInt aLine) |
83 static void Check(TInt aValue, TInt aLine) |
84 { |
84 { |
85 if(!aValue) |
85 if(!aValue) |
86 { |
86 { |
87 DeleteTestFiles(); |
87 DeleteTestFiles(); |
|
88 Print("*** Expression evaluated to false\r\n"); |
88 TestTestLine(EFalse, aLine); |
89 TestTestLine(EFalse, aLine); |
89 } |
90 } |
90 } |
91 } |
91 static void Check(TInt aValue, TInt aExpected, TInt aLine) |
92 static void Check(TInt aValue, TInt aExpected, TInt aLine) |
92 { |
93 { |
93 if(aValue != aExpected) |
94 if(aValue != aExpected) |
94 { |
95 { |
95 DeleteTestFiles(); |
96 DeleteTestFiles(); |
96 RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); |
97 PrintIII("*** Expected error: %d, got: %d. Ignore: %d\r\n", aExpected, aValue, 0); |
97 TestTestLine(EFalse, aLine); |
98 TestTestLine(EFalse, aLine); |
98 } |
99 } |
99 } |
100 } |
100 #define TEST(arg) ::Check((arg), __LINE__) |
101 #define TEST(arg) ::Check((arg), __LINE__) |
101 #define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__) |
102 #define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__) |
103 /////////////////////////////////////////////////////////////////////////////////////// |
104 /////////////////////////////////////////////////////////////////////////////////////// |
104 |
105 |
105 static TInt KillProcess(const TDesC& aProcessName) |
106 static TInt KillProcess(const TDesC& aProcessName) |
106 { |
107 { |
107 TFullName name; |
108 TFullName name; |
108 //RDebug::Print(_L("Find and kill \"%S\" process.\n"), &aProcessName); |
|
109 TBuf<64> pattern(aProcessName); |
109 TBuf<64> pattern(aProcessName); |
110 TInt length = pattern.Length(); |
110 TInt length = pattern.Length(); |
111 pattern += _L("*"); |
111 pattern += _L("*"); |
112 TFindProcess procFinder(pattern); |
112 TFindProcess procFinder(pattern); |
113 |
113 |