1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmplugins/lib3gpunittest/src/tsu_3gplibrary.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,399 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include "tsu_3gplibrary.h"
1.20 +#include "tsu3gplibraryapi.h"
1.21 +#include "tsu3gplibraryapinegative.h"
1.22 +#include "tsu_3gplibrary_composer_api.h"
1.23 +#include "tsu_3gplibrary_parse_compose.h"
1.24 +#include "tsu_3gplibrary_parse_and_check.h"
1.25 +
1.26 +_LIT(KServerName, "tsu_3gplibrary");
1.27 +
1.28 +C3GPLibraryServer* C3GPLibraryServer::NewL()
1.29 + {
1.30 + C3GPLibraryServer* server = new (ELeave) C3GPLibraryServer();
1.31 + CleanupStack::PushL(server);
1.32 + server-> ConstructL(KServerName);
1.33 + CleanupStack::Pop(server);
1.34 + return server;
1.35 + }
1.36 +
1.37 +LOCAL_C void MainL()
1.38 + {
1.39 + // Leave the hooks in for platform security
1.40 +#if (defined __DATA_CAGING__)
1.41 + RProcess().DataCaging(RProcess::EDataCagingOn);
1.42 + RProcess().SecureApi(RProcess::ESecureApiOn);
1.43 +#endif
1.44 + CActiveScheduler* sched = NULL;
1.45 + sched = new(ELeave)CActiveScheduler;
1.46 + CActiveScheduler::Install(sched);
1.47 + C3GPLibraryServer* server = NULL;
1.48 + // Create the C3GPLibraryServer derived server
1.49 + TRAPD(err,server = C3GPLibraryServer::NewL());
1.50 + if(!err)
1.51 + {
1.52 + RProcess::Rendezvous(KErrNone);
1.53 + sched->Start();
1.54 + }
1.55 + delete server;
1.56 + delete sched;
1.57 + }
1.58 +
1.59 +GLDEF_C TInt E32Main()
1.60 +/**
1.61 + * @return - Standard Epoc error code on exit
1.62 + */
1.63 + {
1.64 + CTrapCleanup* cleanup = CTrapCleanup::New();
1.65 + if(cleanup == NULL)
1.66 + {
1.67 + return KErrNoMemory;
1.68 + }
1.69 + TRAP_IGNORE(MainL());
1.70 + delete cleanup;
1.71 + return KErrNone;
1.72 + }
1.73 +
1.74 +CTestStep* C3GPLibraryServer::CreateTestStep(const TDesC& aStepName)
1.75 +/**
1.76 + * @return - A CTestStep derived instance
1.77 + * Implementation of CTestServer pure virtual
1.78 + */
1.79 + {
1.80 + CTestStep* testStep = NULL;
1.81 +
1.82 + // C++ wrapper parser API tests
1.83 + if(aStepName == KTestCase_0001)
1.84 + {
1.85 + testStep = new C3GPLibParser_0001();
1.86 + }
1.87 + else if(aStepName == KTestCase_0002)
1.88 + {
1.89 + testStep = new C3GPLibParser_0002();
1.90 + }
1.91 + else if(aStepName == KTestCase_0003)
1.92 + {
1.93 + testStep = new C3GPLibParser_0003();
1.94 + }
1.95 + else if(aStepName == KTestCase_0004)
1.96 + {
1.97 + testStep = new C3GPLibParser_0004();
1.98 + }
1.99 + else if(aStepName == KTestCase_0005)
1.100 + {
1.101 + testStep = new C3GPLibParser_0005();
1.102 + }
1.103 + else if(aStepName == KTestCase_0006)
1.104 + {
1.105 + testStep = new C3GPLibParser_0006();
1.106 + }
1.107 + else if(aStepName == KTestCase_0007)
1.108 + {
1.109 + testStep = new C3GPLibParser_0007();
1.110 + }
1.111 + else if(aStepName == KTestCase_0008)
1.112 + {
1.113 + testStep = new C3GPLibParser_0008();
1.114 + }
1.115 + else if(aStepName == KTestCase_0011)
1.116 + {
1.117 + testStep = new C3GPLibParser_0011();
1.118 + }
1.119 + else if(aStepName == KTestCase_0014)
1.120 + {
1.121 + testStep = new C3GPLibParser_0014();
1.122 + }
1.123 + else if(aStepName == KTestCase_0015)
1.124 + {
1.125 + testStep = new C3GPLibParser_0015();
1.126 + }
1.127 + else if(aStepName == KTestCase_0016)
1.128 + {
1.129 + testStep = new C3GPLibParser_0016();
1.130 + }
1.131 + else if(aStepName == KTestCase_0017)
1.132 + {
1.133 + testStep = new C3GPLibParser_0017();
1.134 + }
1.135 + else if(aStepName == KTestCase_0021)
1.136 + {
1.137 + testStep = new C3GPLibParser_0021();
1.138 + }
1.139 + else if(aStepName == KTestCase_0023)
1.140 + {
1.141 + testStep = new C3GPLibParser_0023();
1.142 + }
1.143 + else if(aStepName == KTestCase_0027)
1.144 + {
1.145 + testStep = new C3GPLibParser_0027();
1.146 + }
1.147 + else if(aStepName == KTestCase_0031)
1.148 + {
1.149 + testStep = new C3GPLibParser_0031();
1.150 + }
1.151 + else if(aStepName == KTestCase_0032)
1.152 + {
1.153 + testStep = new C3GPLibParser_0032();
1.154 + }
1.155 + else if(aStepName == KTestCase_0033)
1.156 + {
1.157 + testStep = new C3GPLibParser_0033();
1.158 + }
1.159 + else if(aStepName == KTestCase_0034)
1.160 + {
1.161 + testStep = new C3GPLibParser_0034();
1.162 + }
1.163 + else if(aStepName == KTestCase_0035)
1.164 + {
1.165 + testStep = new C3GPLibParser_0035();
1.166 + }
1.167 + else if(aStepName == KTestCase_0036)
1.168 + {
1.169 + testStep = new C3GPLibParser_0036();
1.170 + }
1.171 + else if(aStepName == KTestCase_0037)
1.172 + {
1.173 + testStep = new C3GPLibParser_0037();
1.174 + }
1.175 + else if(aStepName == KTestCase_0038)
1.176 + {
1.177 + testStep = new C3GPLibParser_0038();
1.178 + }
1.179 + else if(aStepName == KTestCase_0039)
1.180 + {
1.181 + testStep = new C3GPLibParser_0039();
1.182 + }
1.183 + else if(aStepName == KTestCase_0041)
1.184 + {
1.185 + testStep = new C3GPLibParser_0041();
1.186 + }
1.187 + else if(aStepName == KTestCase_0043)
1.188 + {
1.189 + testStep = new C3GPLibParser_0043();
1.190 + }
1.191 + else if(aStepName == KTestCase_0045)
1.192 + {
1.193 + testStep = new C3GPLibParser_0045();
1.194 + }
1.195 + else if(aStepName == KTestCase_0047)
1.196 + {
1.197 + testStep = new C3GPLibParser_0047();
1.198 + }
1.199 + else if(aStepName == KTestCase_0101)
1.200 + {
1.201 + testStep = new C3GPLibParser_0101();
1.202 + }
1.203 + else if(aStepName == KTestCase_0102)
1.204 + {
1.205 + testStep = new C3GPLibParser_0102();
1.206 + }
1.207 + else if(aStepName == KTestCase_0104)
1.208 + {
1.209 + testStep = new C3GPLibParser_0104();
1.210 + }
1.211 + else if(aStepName == KTestCase_0106)
1.212 + {
1.213 + testStep = new C3GPLibParser_0106();
1.214 + }
1.215 + else if(aStepName == KTestCase_0107)
1.216 + {
1.217 + testStep = new C3GPLibParser_0107();
1.218 + }
1.219 + else if(aStepName == KTestCase_0108)
1.220 + {
1.221 + testStep = new C3GPLibParser_0108();
1.222 + }
1.223 + else if(aStepName == KTestCase_0109)
1.224 + {
1.225 + testStep = new C3GPLibParser_0109();
1.226 + }
1.227 + else if(aStepName == KTestCase_0110)
1.228 + {
1.229 + testStep = new C3GPLibParser_0110();
1.230 + }
1.231 + else if(aStepName == KTestCase_0111)
1.232 + {
1.233 + testStep = new C3GPLibParser_0111();
1.234 + }
1.235 + else if(aStepName == KTestCase_0119)
1.236 + {
1.237 + testStep = new C3GPLibParser_0119();
1.238 + }
1.239 + else if(aStepName == KTestCase_0120)
1.240 + {
1.241 + testStep = new C3GPLibParser_0120();
1.242 + }
1.243 + else if(aStepName == KTestCase_0126)
1.244 + {
1.245 + testStep = new C3GPLibParser_0126();
1.246 + }
1.247 + else if(aStepName == KTestCase_0127)
1.248 + {
1.249 + testStep = new C3GPLibParser_0127();
1.250 + }
1.251 + else if(aStepName == KTestCase_0130)
1.252 + {
1.253 + testStep = new C3GPLibParser_0130();
1.254 + }
1.255 + else if(aStepName == KTestCase_0131)
1.256 + {
1.257 + testStep = new C3GPLibParser_0131();
1.258 + }
1.259 + else if(aStepName == KTestCase_0135)
1.260 + {
1.261 + testStep = new C3GPLibParser_0135();
1.262 + }
1.263 + else if(aStepName == KTestCase_0136)
1.264 + {
1.265 + testStep = new C3GPLibParser_0136();
1.266 + }
1.267 + else if(aStepName == KTestCase_0137)
1.268 + {
1.269 + testStep = new C3GPLibParser_0137();
1.270 + }
1.271 + else if(aStepName == KTestCase_0138)
1.272 + {
1.273 + testStep = new C3GPLibParser_0138();
1.274 + }
1.275 + else if(aStepName == KTestCase_0139)
1.276 + {
1.277 + testStep = new C3GPLibParser_0139();
1.278 + }
1.279 + else if (aStepName == K3GPSingleDataSourceTest)
1.280 + {
1.281 + testStep = new C3GPSingleDataSourceTest();
1.282 + }
1.283 + else if (aStepName == KTestUserDataAtomRetrieval)
1.284 + {
1.285 + testStep = new C3GPUserDataAtomRetrieval();
1.286 + }
1.287 +
1.288 + // Composer: API Tests
1.289 + else if (aStepName == K3GPComposeFilename)
1.290 + {
1.291 + testStep = new C3GPLibComposeFilename();
1.292 + }
1.293 + else if(aStepName == K3GPComposeWithoutOpen)
1.294 + {
1.295 + testStep = new C3GPLibComposeWithoutOpen();
1.296 + }
1.297 + else if(aStepName == K3GPComposeFileWithFileFormatCheck)
1.298 + {
1.299 + testStep = new C3GPLibComposeFileWithFileFormatCheck();
1.300 + }
1.301 + else if (aStepName == K3GPComposeFrameDependency)
1.302 + {
1.303 + testStep = new C3GPLibComposeFrameDependency();
1.304 + }
1.305 + else if (aStepName == K3GPComposeVideoProperties)
1.306 + {
1.307 + testStep = new C3GPLibComposeVideoProperties();
1.308 + }
1.309 + else if (aStepName == K3GPComposeWithSpecificBufferSize)
1.310 + {
1.311 + testStep = new C3GPLibComposeWithSpecificBufferSize();
1.312 + }
1.313 + else if (aStepName == K3GPComposeUserData)
1.314 + {
1.315 + testStep = new C3GPLibComposeUserData();
1.316 + }
1.317 + else if (aStepName == K3GPComposeWithFlag)
1.318 + {
1.319 + testStep = new C3GPLibComposeWithFlag();
1.320 + }
1.321 + else if (aStepName == K3GPComposeAudioProperties)
1.322 + {
1.323 + testStep = new C3GPLibComposeAudioProperties();
1.324 + }
1.325 + else if (aStepName == K3GPComposeWithNoAudioVideo)
1.326 + {
1.327 + testStep = new C3GPLibComposeWithNoAudioVideo();
1.328 + }
1.329 + else if (aStepName == K3GPComposeWithNoAudioVideo)
1.330 + {
1.331 + testStep = new C3GPLibComposeWithNoAudioVideo();
1.332 + }
1.333 + else if (aStepName == K3GPComposeOpenAgain)
1.334 + {
1.335 + testStep = new C3GPLibComposeOpenAgain();
1.336 + }
1.337 + else if (aStepName == K3GPComposeAudioFrames)
1.338 + {
1.339 + testStep = new C3GPLibComposeAudioFrames();
1.340 + }
1.341 + else if (aStepName == K3GPComposeVideoFrame)
1.342 + {
1.343 + testStep = new C3GPLibComposeVideoFrame();
1.344 + }
1.345 + else if (aStepName == K3GPComposeOpenReadOnlyFile)
1.346 + {
1.347 + testStep = new C3GPLibComposeOpenReadOnlyFile();
1.348 + }
1.349 + else if (aStepName == K3GPComposeOpenedFile)
1.350 + {
1.351 + testStep = new C3GPLibComposeOpenedFile();
1.352 + }
1.353 + else if (aStepName == K3GPComposeMultiComposeOnSameFile)
1.354 + {
1.355 + testStep = new C3GPLibComposeMultiComposeOnSameFile();
1.356 + }
1.357 + else if (aStepName == K3GPComposeMultiComposers)
1.358 + {
1.359 + testStep = new C3GPLibComposeMultiComposers();
1.360 + }
1.361 + else if (aStepName == K3GPComposeCloseComposerWithoutComplete)
1.362 + {
1.363 + testStep = new C3GPLibComposeCloseComposerWithoutComplete();
1.364 + }
1.365 + else if (aStepName == K3GPComposePanic)
1.366 + {
1.367 + testStep = new C3GPLibComposePanic();
1.368 + }
1.369 + else if (aStepName == K3GPComposeLargeFile)
1.370 + {
1.371 + testStep = new C3GPLibComposeLargeFile();
1.372 + }
1.373 + else if (aStepName == K3GPComposeLargeFileUserData)
1.374 + {
1.375 + testStep = new C3GPLibComposeLargeFileUserData();
1.376 + }
1.377 + else if (aStepName == K3GPComposeLargeFile32bitAPI)
1.378 + {
1.379 + testStep = new C3GPLibComposeLargeFile32bitAPI();
1.380 + }
1.381 + else if (aStepName == K3GPComposeLargeFileDiskFull)
1.382 + {
1.383 + testStep = new C3GPLibComposeLargeFileDiskFull();
1.384 + }
1.385 + // Composer: file format test
1.386 + else if (aStepName == K3GPParseComposeFile)
1.387 + {
1.388 + testStep = new C3GPLibParseComposeFile();
1.389 + }
1.390 + // AVC profile test
1.391 + else if (aStepName == K3GPComposeFileWithAvcProfileCheck)
1.392 + {
1.393 + testStep = new C3GPLibComposeFileWithAvcProfileCheck();
1.394 + }
1.395 + // Main & High profile parse
1.396 + else if (aStepName == K3GPLibParseAndCheckTypes)
1.397 + {
1.398 + testStep = new C3GPLibParseAndCheckTypes();
1.399 + }
1.400 +
1.401 + return testStep;
1.402 + }