os/mm/mmplugins/lib3gpunittest/src/tsu_3gplibrary.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#include "tsu_3gplibrary.h"
sl@0
    17
#include "tsu3gplibraryapi.h"
sl@0
    18
#include "tsu3gplibraryapinegative.h"
sl@0
    19
#include "tsu_3gplibrary_composer_api.h"
sl@0
    20
#include "tsu_3gplibrary_parse_compose.h"
sl@0
    21
#include "tsu_3gplibrary_parse_and_check.h"
sl@0
    22
sl@0
    23
_LIT(KServerName, "tsu_3gplibrary");
sl@0
    24
sl@0
    25
C3GPLibraryServer* C3GPLibraryServer::NewL()
sl@0
    26
	{
sl@0
    27
	C3GPLibraryServer* server = new (ELeave) C3GPLibraryServer();
sl@0
    28
	CleanupStack::PushL(server);	
sl@0
    29
	server-> ConstructL(KServerName);
sl@0
    30
	CleanupStack::Pop(server);
sl@0
    31
	return server;
sl@0
    32
	}
sl@0
    33
sl@0
    34
LOCAL_C void MainL()
sl@0
    35
	{
sl@0
    36
	// Leave the hooks in for platform security
sl@0
    37
#if (defined __DATA_CAGING__)
sl@0
    38
	RProcess().DataCaging(RProcess::EDataCagingOn);
sl@0
    39
	RProcess().SecureApi(RProcess::ESecureApiOn);
sl@0
    40
#endif
sl@0
    41
	CActiveScheduler* sched = NULL;
sl@0
    42
	sched = new(ELeave)CActiveScheduler;
sl@0
    43
	CActiveScheduler::Install(sched);
sl@0
    44
	C3GPLibraryServer* server = NULL;
sl@0
    45
	// Create the C3GPLibraryServer derived server
sl@0
    46
	TRAPD(err,server = C3GPLibraryServer::NewL());
sl@0
    47
	if(!err)
sl@0
    48
		{
sl@0
    49
		RProcess::Rendezvous(KErrNone);
sl@0
    50
		sched->Start();
sl@0
    51
		}
sl@0
    52
	delete server;
sl@0
    53
	delete sched;
sl@0
    54
	}
sl@0
    55
	
sl@0
    56
GLDEF_C TInt E32Main()
sl@0
    57
/**
sl@0
    58
 * @return - Standard Epoc error code on exit
sl@0
    59
 */
sl@0
    60
	{
sl@0
    61
	CTrapCleanup* cleanup = CTrapCleanup::New();
sl@0
    62
	if(cleanup == NULL)
sl@0
    63
		{
sl@0
    64
		return KErrNoMemory;
sl@0
    65
		}
sl@0
    66
	TRAP_IGNORE(MainL());
sl@0
    67
	delete cleanup;
sl@0
    68
	return KErrNone;
sl@0
    69
    }
sl@0
    70
   
sl@0
    71
CTestStep* C3GPLibraryServer::CreateTestStep(const TDesC& aStepName)
sl@0
    72
/**
sl@0
    73
 * @return - A CTestStep derived instance
sl@0
    74
 * Implementation of CTestServer pure virtual
sl@0
    75
 */
sl@0
    76
	{
sl@0
    77
	CTestStep* testStep = NULL;
sl@0
    78
sl@0
    79
	// C++ wrapper parser API tests
sl@0
    80
	if(aStepName == KTestCase_0001)
sl@0
    81
		{
sl@0
    82
		testStep = new C3GPLibParser_0001();
sl@0
    83
		}
sl@0
    84
	else if(aStepName == KTestCase_0002)
sl@0
    85
		{
sl@0
    86
		testStep = new C3GPLibParser_0002();
sl@0
    87
		}
sl@0
    88
	else if(aStepName == KTestCase_0003)
sl@0
    89
		{
sl@0
    90
		testStep = new C3GPLibParser_0003();
sl@0
    91
		}
sl@0
    92
	else if(aStepName == KTestCase_0004)
sl@0
    93
		{
sl@0
    94
		testStep = new C3GPLibParser_0004();
sl@0
    95
		}
sl@0
    96
	else if(aStepName == KTestCase_0005)
sl@0
    97
		{
sl@0
    98
		testStep = new C3GPLibParser_0005();
sl@0
    99
		}
sl@0
   100
	else if(aStepName == KTestCase_0006)
sl@0
   101
		{
sl@0
   102
		testStep = new C3GPLibParser_0006();
sl@0
   103
		}
sl@0
   104
	else if(aStepName == KTestCase_0007)
sl@0
   105
		{
sl@0
   106
		testStep = new C3GPLibParser_0007();
sl@0
   107
		}
sl@0
   108
	else if(aStepName == KTestCase_0008)
sl@0
   109
		{
sl@0
   110
		testStep = new C3GPLibParser_0008();
sl@0
   111
		}
sl@0
   112
	else if(aStepName == KTestCase_0011)
sl@0
   113
		{
sl@0
   114
		testStep = new C3GPLibParser_0011();
sl@0
   115
		}
sl@0
   116
	else if(aStepName == KTestCase_0014)
sl@0
   117
		{
sl@0
   118
		testStep = new C3GPLibParser_0014();
sl@0
   119
		}
sl@0
   120
	else if(aStepName == KTestCase_0015)
sl@0
   121
		{
sl@0
   122
		testStep = new C3GPLibParser_0015();
sl@0
   123
		}
sl@0
   124
	else if(aStepName == KTestCase_0016)
sl@0
   125
		{
sl@0
   126
		testStep = new C3GPLibParser_0016();
sl@0
   127
		}
sl@0
   128
	else if(aStepName == KTestCase_0017)
sl@0
   129
		{
sl@0
   130
		testStep = new C3GPLibParser_0017();
sl@0
   131
		}
sl@0
   132
	else if(aStepName == KTestCase_0021)
sl@0
   133
		{
sl@0
   134
		testStep = new C3GPLibParser_0021();
sl@0
   135
		}
sl@0
   136
	else if(aStepName == KTestCase_0023)
sl@0
   137
		{
sl@0
   138
		testStep = new C3GPLibParser_0023();
sl@0
   139
		}
sl@0
   140
	else if(aStepName == KTestCase_0027)
sl@0
   141
		{
sl@0
   142
		testStep = new C3GPLibParser_0027();
sl@0
   143
		}
sl@0
   144
	else if(aStepName == KTestCase_0031)
sl@0
   145
		{
sl@0
   146
		testStep = new C3GPLibParser_0031();
sl@0
   147
		}
sl@0
   148
	else if(aStepName == KTestCase_0032)
sl@0
   149
		{
sl@0
   150
		testStep = new C3GPLibParser_0032();
sl@0
   151
		}
sl@0
   152
	else if(aStepName == KTestCase_0033)
sl@0
   153
		{
sl@0
   154
		testStep = new C3GPLibParser_0033();
sl@0
   155
		}
sl@0
   156
	else if(aStepName == KTestCase_0034)
sl@0
   157
		{
sl@0
   158
		testStep = new C3GPLibParser_0034();
sl@0
   159
		}
sl@0
   160
	else if(aStepName == KTestCase_0035)
sl@0
   161
		{
sl@0
   162
		testStep = new C3GPLibParser_0035();
sl@0
   163
		}
sl@0
   164
	else if(aStepName == KTestCase_0036)
sl@0
   165
		{
sl@0
   166
		testStep = new C3GPLibParser_0036();
sl@0
   167
		}
sl@0
   168
	else if(aStepName == KTestCase_0037)
sl@0
   169
		{
sl@0
   170
		testStep = new C3GPLibParser_0037();
sl@0
   171
		}
sl@0
   172
	else if(aStepName == KTestCase_0038)
sl@0
   173
		{
sl@0
   174
		testStep = new C3GPLibParser_0038();
sl@0
   175
		}
sl@0
   176
	else if(aStepName == KTestCase_0039)
sl@0
   177
		{
sl@0
   178
		testStep = new C3GPLibParser_0039();
sl@0
   179
		}
sl@0
   180
	else if(aStepName == KTestCase_0041)
sl@0
   181
		{
sl@0
   182
		testStep = new C3GPLibParser_0041();
sl@0
   183
		}
sl@0
   184
	else if(aStepName == KTestCase_0043)
sl@0
   185
		{
sl@0
   186
		testStep = new C3GPLibParser_0043();
sl@0
   187
		}
sl@0
   188
	else if(aStepName == KTestCase_0045)
sl@0
   189
		{
sl@0
   190
		testStep = new C3GPLibParser_0045();
sl@0
   191
		}
sl@0
   192
	else if(aStepName == KTestCase_0047)
sl@0
   193
		{
sl@0
   194
		testStep = new C3GPLibParser_0047();
sl@0
   195
		}
sl@0
   196
	else if(aStepName == KTestCase_0101)
sl@0
   197
		{
sl@0
   198
		testStep = new C3GPLibParser_0101();
sl@0
   199
		}
sl@0
   200
	else if(aStepName == KTestCase_0102)
sl@0
   201
		{
sl@0
   202
		testStep = new C3GPLibParser_0102();
sl@0
   203
		}
sl@0
   204
	else if(aStepName == KTestCase_0104)
sl@0
   205
		{
sl@0
   206
		testStep = new C3GPLibParser_0104();
sl@0
   207
		}
sl@0
   208
	else if(aStepName == KTestCase_0106)
sl@0
   209
		{
sl@0
   210
		testStep = new C3GPLibParser_0106();
sl@0
   211
		}
sl@0
   212
	else if(aStepName == KTestCase_0107)
sl@0
   213
		{
sl@0
   214
		testStep = new C3GPLibParser_0107();
sl@0
   215
		}
sl@0
   216
	else if(aStepName == KTestCase_0108)
sl@0
   217
		{
sl@0
   218
		testStep = new C3GPLibParser_0108();
sl@0
   219
		}
sl@0
   220
	else if(aStepName == KTestCase_0109)
sl@0
   221
		{
sl@0
   222
		testStep = new C3GPLibParser_0109();
sl@0
   223
		}
sl@0
   224
	else if(aStepName == KTestCase_0110)
sl@0
   225
		{
sl@0
   226
		testStep = new C3GPLibParser_0110();
sl@0
   227
		}
sl@0
   228
	else if(aStepName == KTestCase_0111)
sl@0
   229
		{
sl@0
   230
		testStep = new C3GPLibParser_0111();
sl@0
   231
		}
sl@0
   232
	else if(aStepName == KTestCase_0119)
sl@0
   233
		{
sl@0
   234
		testStep = new C3GPLibParser_0119();
sl@0
   235
		}
sl@0
   236
	else if(aStepName == KTestCase_0120)
sl@0
   237
		{
sl@0
   238
		testStep = new C3GPLibParser_0120();
sl@0
   239
		}
sl@0
   240
	else if(aStepName == KTestCase_0126)
sl@0
   241
		{
sl@0
   242
		testStep = new C3GPLibParser_0126();
sl@0
   243
		}
sl@0
   244
	else if(aStepName == KTestCase_0127)
sl@0
   245
		{
sl@0
   246
		testStep = new C3GPLibParser_0127();
sl@0
   247
		}
sl@0
   248
	else if(aStepName == KTestCase_0130)
sl@0
   249
		{
sl@0
   250
		testStep = new C3GPLibParser_0130();
sl@0
   251
		}
sl@0
   252
	else if(aStepName == KTestCase_0131)
sl@0
   253
		{
sl@0
   254
		testStep = new C3GPLibParser_0131();
sl@0
   255
		}
sl@0
   256
	else if(aStepName == KTestCase_0135)
sl@0
   257
		{
sl@0
   258
		testStep = new C3GPLibParser_0135();
sl@0
   259
		}
sl@0
   260
	else if(aStepName == KTestCase_0136)
sl@0
   261
		{
sl@0
   262
		testStep = new C3GPLibParser_0136();
sl@0
   263
		}
sl@0
   264
	else if(aStepName == KTestCase_0137)
sl@0
   265
		{
sl@0
   266
		testStep = new C3GPLibParser_0137();
sl@0
   267
		}
sl@0
   268
	else if(aStepName == KTestCase_0138)
sl@0
   269
		{
sl@0
   270
		testStep = new C3GPLibParser_0138();
sl@0
   271
		}
sl@0
   272
	else if(aStepName == KTestCase_0139)
sl@0
   273
		{
sl@0
   274
		testStep = new C3GPLibParser_0139();
sl@0
   275
		}
sl@0
   276
	else if (aStepName == K3GPSingleDataSourceTest)
sl@0
   277
		{		
sl@0
   278
		testStep = new C3GPSingleDataSourceTest();
sl@0
   279
		}
sl@0
   280
	else if (aStepName == KTestUserDataAtomRetrieval)	
sl@0
   281
		{		
sl@0
   282
		testStep = new C3GPUserDataAtomRetrieval();
sl@0
   283
		}
sl@0
   284
sl@0
   285
	// Composer: API Tests
sl@0
   286
	else if (aStepName == K3GPComposeFilename)
sl@0
   287
		{
sl@0
   288
		testStep = new C3GPLibComposeFilename();
sl@0
   289
		}
sl@0
   290
	else if(aStepName == K3GPComposeWithoutOpen)
sl@0
   291
		{
sl@0
   292
		testStep = new C3GPLibComposeWithoutOpen();
sl@0
   293
		}	
sl@0
   294
	else if(aStepName == K3GPComposeFileWithFileFormatCheck)
sl@0
   295
		{
sl@0
   296
		testStep = new C3GPLibComposeFileWithFileFormatCheck();
sl@0
   297
		}
sl@0
   298
	else if (aStepName == K3GPComposeFrameDependency)
sl@0
   299
		{
sl@0
   300
		testStep = new C3GPLibComposeFrameDependency();
sl@0
   301
		}
sl@0
   302
	else if (aStepName == K3GPComposeVideoProperties)
sl@0
   303
		{
sl@0
   304
		testStep = new C3GPLibComposeVideoProperties();
sl@0
   305
		}
sl@0
   306
	else if (aStepName == K3GPComposeWithSpecificBufferSize)
sl@0
   307
		{
sl@0
   308
		testStep = new C3GPLibComposeWithSpecificBufferSize();
sl@0
   309
		}
sl@0
   310
	else if (aStepName == K3GPComposeUserData)
sl@0
   311
		{
sl@0
   312
		testStep = new C3GPLibComposeUserData();
sl@0
   313
		}
sl@0
   314
	else if (aStepName == K3GPComposeWithFlag)
sl@0
   315
		{
sl@0
   316
		testStep = new C3GPLibComposeWithFlag();
sl@0
   317
		}
sl@0
   318
	else if (aStepName == K3GPComposeAudioProperties)
sl@0
   319
		{
sl@0
   320
		testStep = new C3GPLibComposeAudioProperties();
sl@0
   321
		}
sl@0
   322
	else if (aStepName == K3GPComposeWithNoAudioVideo)
sl@0
   323
		{
sl@0
   324
		testStep = new C3GPLibComposeWithNoAudioVideo();
sl@0
   325
		}
sl@0
   326
	else if (aStepName == K3GPComposeWithNoAudioVideo)
sl@0
   327
		{
sl@0
   328
		testStep = new C3GPLibComposeWithNoAudioVideo();
sl@0
   329
		}
sl@0
   330
	else if (aStepName == K3GPComposeOpenAgain)
sl@0
   331
		{
sl@0
   332
		testStep = new C3GPLibComposeOpenAgain();
sl@0
   333
		}
sl@0
   334
	else if (aStepName == K3GPComposeAudioFrames)
sl@0
   335
		{
sl@0
   336
		testStep = new C3GPLibComposeAudioFrames();
sl@0
   337
		}
sl@0
   338
	else if (aStepName == K3GPComposeVideoFrame)
sl@0
   339
		{
sl@0
   340
		testStep = new C3GPLibComposeVideoFrame();
sl@0
   341
		}
sl@0
   342
	else if (aStepName == K3GPComposeOpenReadOnlyFile)
sl@0
   343
		{
sl@0
   344
		testStep = new C3GPLibComposeOpenReadOnlyFile();
sl@0
   345
		}
sl@0
   346
	else if (aStepName == K3GPComposeOpenedFile)
sl@0
   347
		{
sl@0
   348
		testStep = new C3GPLibComposeOpenedFile();
sl@0
   349
		}
sl@0
   350
	else if (aStepName == K3GPComposeMultiComposeOnSameFile)
sl@0
   351
		{
sl@0
   352
		testStep = new C3GPLibComposeMultiComposeOnSameFile();
sl@0
   353
		}
sl@0
   354
	else if (aStepName == K3GPComposeMultiComposers)
sl@0
   355
		{
sl@0
   356
		testStep = new C3GPLibComposeMultiComposers();
sl@0
   357
		}
sl@0
   358
	else if (aStepName == K3GPComposeCloseComposerWithoutComplete)
sl@0
   359
		{
sl@0
   360
		testStep = new C3GPLibComposeCloseComposerWithoutComplete();
sl@0
   361
		}
sl@0
   362
	else if (aStepName == K3GPComposePanic)
sl@0
   363
		{
sl@0
   364
		testStep = new C3GPLibComposePanic();
sl@0
   365
		}		
sl@0
   366
	else if (aStepName == K3GPComposeLargeFile)
sl@0
   367
		{
sl@0
   368
		testStep = new C3GPLibComposeLargeFile();
sl@0
   369
		}
sl@0
   370
	else if (aStepName == K3GPComposeLargeFileUserData)
sl@0
   371
		{
sl@0
   372
		testStep = new C3GPLibComposeLargeFileUserData();
sl@0
   373
		}
sl@0
   374
	else if (aStepName == K3GPComposeLargeFile32bitAPI)
sl@0
   375
		{
sl@0
   376
		testStep = new C3GPLibComposeLargeFile32bitAPI();
sl@0
   377
		}
sl@0
   378
	else if (aStepName == K3GPComposeLargeFileDiskFull)
sl@0
   379
		{
sl@0
   380
		testStep = new C3GPLibComposeLargeFileDiskFull();
sl@0
   381
		}
sl@0
   382
	// Composer: file format test
sl@0
   383
	else if (aStepName == K3GPParseComposeFile)
sl@0
   384
		{
sl@0
   385
		testStep = new C3GPLibParseComposeFile();
sl@0
   386
		}
sl@0
   387
	// AVC profile test
sl@0
   388
	else if (aStepName == K3GPComposeFileWithAvcProfileCheck)
sl@0
   389
	    {
sl@0
   390
	    testStep = new C3GPLibComposeFileWithAvcProfileCheck();
sl@0
   391
	    }
sl@0
   392
	// Main & High profile parse
sl@0
   393
	else if (aStepName == K3GPLibParseAndCheckTypes)
sl@0
   394
	    {
sl@0
   395
	    testStep = new C3GPLibParseAndCheckTypes();
sl@0
   396
	    }
sl@0
   397
sl@0
   398
	return testStep;
sl@0
   399
	}