|
1 /* |
|
2 * Copyright (c) 2002 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: MPXMessage testing implementation (mpxmessage.h & mpxplaybackmessage.h) |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <s32mem.h> |
|
20 |
|
21 #include <mpxmessagegeneraldefs.h> |
|
22 #include <mpxplaybackmessagedefs.h> |
|
23 |
|
24 #include "commontestclass.h" |
|
25 |
|
26 // Begin TMPXMessage testing implementation (mpxmessage.h & mpxplaybackmessage.h) |
|
27 // ----------------------------------------------------------------------------- |
|
28 // CCommonTestClass::TMPXMessage3L() |
|
29 // Returns: Symbian OS errors. |
|
30 // ----------------------------------------------------------------------------- |
|
31 TInt CCommonTestClass::TMPXMessage3L() |
|
32 { |
|
33 FTRACE(FPrint(_L("CCommonTestClass::TMPXMessage3L testing TMPXMessage::TMPXMessage(...) begin"))); |
|
34 iLog->Log(_L("CCommonTestClass::TMPXMessage3L testing TMPXMessage::TMPXMessage(...) begin")); |
|
35 TInt err = KErrNone; |
|
36 |
|
37 TMPXPlaybackMessage message; |
|
38 |
|
39 message = TMPXPlaybackMessage(static_cast<TMPXPlaybackMessage::TEvent>(KMPXMessageContentIdGeneral), |
|
40 EMPXMessageGeneralId, |
|
41 KMPXMessagePbMediaChanged); |
|
42 |
|
43 |
|
44 FTRACE(FPrint(_L("CCommonTestClass::TMPXMessage3L testing TMPXMessage::TMPXMessage(...) end err=%d"), err)); |
|
45 iLog->Log(_L("CCommonTestClass::TMPXMessage3L testing TMPXMessage::TMPXMessage(...) end err=%d"), err); |
|
46 return err; |
|
47 } |
|
48 |
|
49 |
|
50 // ----------------------------------------------------------------------------- |
|
51 // CCommonTestClass::TMPXMessage1L() |
|
52 // Returns: Symbian OS errors. |
|
53 // ----------------------------------------------------------------------------- |
|
54 TInt CCommonTestClass::TMPXMessage1L() |
|
55 { |
|
56 FTRACE(FPrint(_L("CCommonTestClass::TMPXMessage1L testing TMPXMessage::TMPXMessage(..) begin"))); |
|
57 iLog->Log(_L("CCommonTestClass::TMPXMessage1L testing TMPXMessage::TMPXMessage() begin")); |
|
58 TInt err = KErrNone; |
|
59 |
|
60 TMPXMessage message; |
|
61 |
|
62 message = TMPXPlaybackMessage(static_cast<TMPXPlaybackMessage::TEvent>(KMPXMessageContentIdGeneral), |
|
63 EMPXMessageGeneralId, |
|
64 KMPXMessagePbMediaChanged); |
|
65 |
|
66 TMPXMessage msg = TMPXMessage(message); |
|
67 |
|
68 TMPXPlaybackMessage message2; |
|
69 message = TMPXPlaybackMessage(message2); |
|
70 |
|
71 FTRACE(FPrint(_L("CCommonTestClass::TMPXMessage1L testing TMPXMessage::TMPXMessage(..) end err=%d"), err)); |
|
72 iLog->Log(_L("CCommonTestClass::TMPXMessage1L testing TMPXMessage::TMPXMessage() end err=%d"), err); |
|
73 return err; |
|
74 } |
|
75 |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CCommonTestClass::TMPXMessageL() |
|
79 // Returns: Symbian OS errors. |
|
80 // ----------------------------------------------------------------------------- |
|
81 TInt CCommonTestClass::TMPXMessageL() |
|
82 { |
|
83 FTRACE(FPrint(_L("CCommonTestClass::TMPXMessageL testing TMPXMessage::TMPXMessage() begin"))); |
|
84 iLog->Log(_L("CCommonTestClass::TMPXMessageL testing TMPXMessage::TMPXMessage() begin")); |
|
85 TInt err = KErrNone; |
|
86 |
|
87 TMPXMessage message; |
|
88 |
|
89 message = TMPXMessage(); |
|
90 |
|
91 FTRACE(FPrint(_L("CCommonTestClass::TMPXMessageL testing TMPXMessage::TMPXMessage() end err=%d"), err)); |
|
92 iLog->Log(_L("CCommonTestClass::TMPXMessageL testing TMPXMessage::TMPXMessage() end err=%d"), err); |
|
93 return err; |
|
94 } |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // CCommonTestClass::EqualTMPXMessage() |
|
98 // Returns: Symbian OS errors. |
|
99 // ----------------------------------------------------------------------------- |
|
100 TInt CCommonTestClass::EqualTMPXMessage() |
|
101 { |
|
102 FTRACE(FPrint(_L("CCommonTestClass::EqualTMPXMessage testing TMPXMessage::operator=(..) begin"))); |
|
103 iLog->Log(_L("CCommonTestClass::EqualTMPXMessage testing TMPXMessage::operator=() begin")); |
|
104 TInt err = KErrNone; |
|
105 |
|
106 TMPXMessage message; |
|
107 |
|
108 message = TMPXPlaybackMessage(static_cast<TMPXPlaybackMessage::TEvent>(KMPXMessageContentIdGeneral), |
|
109 EMPXMessageGeneralId, |
|
110 KMPXMessagePbMediaChanged); |
|
111 |
|
112 TMPXMessage msg = TMPXMessage(message); |
|
113 msg = message; |
|
114 message = msg; |
|
115 |
|
116 FTRACE(FPrint(_L("CCommonTestClass::EqualTMPXMessage testing TMPXMessage::operator=(..) end err=%d"), err)); |
|
117 iLog->Log(_L("CCommonTestClass::EqualTMPXMessage testing TMPXMessage::operator=() end err=%d"), err); |
|
118 return err; |
|
119 } |
|
120 |
|
121 |
|
122 // ----------------------------------------------------------------------------- |
|
123 // CCommonTestClass::EqualTMPXMessage() |
|
124 // Returns: Symbian OS errors. |
|
125 // ----------------------------------------------------------------------------- |
|
126 TInt CCommonTestClass::Event() |
|
127 { |
|
128 FTRACE(FPrint(_L("CCommonTestClass::Event testing TMPXMessage::Event begin"))); |
|
129 iLog->Log(_L("CCommonTestClass::Event testing TMPXMessage::Event begin")); |
|
130 TInt err = KErrNone; |
|
131 |
|
132 TMPXMessage message = TMPXMessage(static_cast<TMPXPlaybackMessage::TEvent>(KMPXMessageContentIdGeneral), |
|
133 EMPXMessageGeneralId, |
|
134 KMPXMessagePbMediaChanged); |
|
135 |
|
136 TInt event = message.Event(); |
|
137 |
|
138 FTRACE(FPrint(_L("CCommonTestClass::Event testing TMPXMessage::Event end err=%d"), err)); |
|
139 iLog->Log(_L("CCommonTestClass::Event testing TMPXMessage::Event end err=%d"), err); |
|
140 return err; |
|
141 } |
|
142 |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // CCommonTestClass::Type() |
|
146 // Returns: Symbian OS errors. |
|
147 // ----------------------------------------------------------------------------- |
|
148 TInt CCommonTestClass::Type() |
|
149 { |
|
150 FTRACE(FPrint(_L("CCommonTestClass::Type testing TMPXMessage::Type begin"))); |
|
151 iLog->Log(_L("CCommonTestClass::Type testing TMPXMessage::Type begin")); |
|
152 TInt err = KErrNone; |
|
153 |
|
154 TMPXMessage message = TMPXMessage(static_cast<TMPXPlaybackMessage::TEvent>(KMPXMessageContentIdGeneral), |
|
155 EMPXMessageGeneralId, |
|
156 KMPXMessagePbMediaChanged); |
|
157 |
|
158 TInt type = message.Type(); |
|
159 |
|
160 FTRACE(FPrint(_L("CCommonTestClass::Type testing TMPXMessage::Type end err=%d"), err)); |
|
161 iLog->Log(_L("CCommonTestClass::Type testing TMPXMessage::Type end err=%d"), err); |
|
162 return err; |
|
163 } |
|
164 |
|
165 |
|
166 // ----------------------------------------------------------------------------- |
|
167 // CCommonTestClass::EqualTMPXMessage() |
|
168 // Returns: Symbian OS errors. |
|
169 // ----------------------------------------------------------------------------- |
|
170 TInt CCommonTestClass::Data() |
|
171 { |
|
172 FTRACE(FPrint(_L("CCommonTestClass::Data testing TMPXMessage::Data begin"))); |
|
173 iLog->Log(_L("CCommonTestClass::Data testing TMPXMessage::Data begin")); |
|
174 TInt err = KErrNone; |
|
175 |
|
176 TMPXMessage message = TMPXMessage(static_cast<TMPXPlaybackMessage::TEvent>(KMPXMessageContentIdGeneral), |
|
177 EMPXMessageGeneralId, |
|
178 KMPXMessagePbMediaChanged); |
|
179 |
|
180 TInt data = message.Data(); |
|
181 |
|
182 FTRACE(FPrint(_L("CCommonTestClass::Data testing TMPXMessage::Data end err=%d"), err)); |
|
183 iLog->Log(_L("CCommonTestClass::Data testing TMPXMessage::Data end err=%d"), err); |
|
184 return err; |
|
185 } |