|
1 // Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32test\ost\flush_page_cache.cpp |
|
15 // Overview: |
|
16 // Tests WDP TraceCore |
|
17 // kernel - side APIs |
|
18 // |
|
19 |
|
20 #define __E32TEST_EXTENSION__ |
|
21 #include <e32std.h> |
|
22 #include <dptest.h> |
|
23 #include "t_rtest_panic.h" |
|
24 |
|
25 RTest test(_L("FLUSH_PAGE_CACHE")); |
|
26 |
|
27 TInt ContinueFlushingPageCache() |
|
28 { |
|
29 RTimer timer; |
|
30 TRequestStatus status; |
|
31 TInt ret = timer.CreateLocal(); |
|
32 if (ret!=KErrNone) |
|
33 { |
|
34 test.Printf(_L("\nUnable to create RTimer object. Error: %d"), ret); |
|
35 return ret; |
|
36 } |
|
37 //repeat flush for 7 minutes |
|
38 timer.After(status, 420000000); |
|
39 |
|
40 while (status==KRequestPending) |
|
41 { |
|
42 //Flush the cache |
|
43 DPTest::FlushCache(); |
|
44 //wait for 100 microseconds |
|
45 User::After(100); |
|
46 } |
|
47 return KErrNone; |
|
48 } |
|
49 |
|
50 |
|
51 |
|
52 GLDEF_C TInt E32Main() |
|
53 { |
|
54 |
|
55 test.Title(); |
|
56 test.Start(_L("Flushing Page Cache")); |
|
57 |
|
58 test.Next(_L("Flush every 100us for 7 minutes")); |
|
59 TInt err = ContinueFlushingPageCache(); |
|
60 |
|
61 TEST_KErrNone(err); |
|
62 |
|
63 test.Printf(_L("\nFinished Flushing Page Cache!!!")); |
|
64 |
|
65 test.End(); |
|
66 test.Close(); |
|
67 return (0); |
|
68 } |