|
1 /* |
|
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * T_FMT.CPP |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include <e32test.h> |
|
21 #include <txtfmlyr.h> |
|
22 #include <txtrich.h> |
|
23 #include <txtfrmat.h> |
|
24 #include <gdi.h> |
|
25 #include "TXTSTD.H" |
|
26 |
|
27 |
|
28 LOCAL_D RTest test(_L("TFormat Test Code for DEF047316")); |
|
29 |
|
30 LOCAL_C void TestDEF047316L() |
|
31 // Test CParaFormat stack definition leave protection |
|
32 // |
|
33 { |
|
34 |
|
35 |
|
36 test.Start(_L(" @SYMTestCaseID:SYSLIB-ETEXT-LEGACY-t_fmt1-0001 CParaFormat - DEF047316 - stack definition leave protection ")); |
|
37 CParaFormat paraFormat; |
|
38 |
|
39 // Allocate resources for paraFormat |
|
40 TTabStop tabStop; |
|
41 paraFormat.StoreTabL(tabStop); |
|
42 |
|
43 TParaBorder border; |
|
44 paraFormat.SetParaBorderL(CParaFormat::EParaBorderTop,border); |
|
45 |
|
46 paraFormat.iBullet=new(ELeave)TBullet; |
|
47 |
|
48 // Push cleanup method for paraFormat |
|
49 ResetOnCleanupL( ¶Format); |
|
50 |
|
51 // Force cleanup method to be called |
|
52 CleanupStack::PopAndDestroy(); |
|
53 |
|
54 // Note that test end is when paraFormat's destructor is called when |
|
55 // this function terminates. The destructor should not cause any problems |
|
56 // even though we have already called the cleanup method |
|
57 |
|
58 test.End(); |
|
59 } |
|
60 |
|
61 GLDEF_C TInt E32Main() |
|
62 // |
|
63 // Tests TFORMAT. |
|
64 // |
|
65 { |
|
66 CTrapCleanup* cleanup=CTrapCleanup::New(); |
|
67 test.Title(); |
|
68 |
|
69 __UHEAP_MARK; |
|
70 TRAPD(ret,TestDEF047316L()); |
|
71 test(ret==KErrNone); |
|
72 |
|
73 __UHEAP_MARKEND; |
|
74 |
|
75 test.Close(); |
|
76 |
|
77 delete cleanup; |
|
78 |
|
79 return(0); |
|
80 } |