imgtools/imgcheck/imagechekunittest/testcode/cmdlinehandletest.cpp
changeset 0 044383f39525
child 590 360bd6b35136
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 /*
       
     2 * Copyright (c) 2008-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 the License "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 * CMDLINEHANDLERTEST.CPP
       
    16 * Unittest cases for command line handler file.
       
    17 * Note : Tested by passing different images.
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 /**
       
    23  @file
       
    24  @internalComponent
       
    25  @released
       
    26 */
       
    27 #include <cppunit/config/SourcePrefix.h>
       
    28 #include "cmdlinehandlertest.h"
       
    29 
       
    30 CPPUNIT_TEST_SUITE_REGISTRATION( CTestCmdHandler );
       
    31 
       
    32 #include "depchecker.h"
       
    33 #include "exceptionreporter.h"
       
    34 
       
    35 
       
    36 /**
       
    37 Test the cmdhandler output without providing any arguments.
       
    38 Note: Refer the code coverage output for percentage of check.
       
    39 
       
    40 @internalComponent
       
    41 @released
       
    42 */
       
    43 void CTestCmdHandler::TestWithEmptyArugument()
       
    44 {
       
    45 	int status = 0;
       
    46 	CmdLineHandler* cmdInput;
       
    47 	try
       
    48 	{
       
    49 		char* argvect[] = { "test"};
       
    50 		cmdInput = new CmdLineHandler();
       
    51 		ReturnType val = cmdInput->ProcessCommandLine(0,argvect);
       
    52 		if(val == EQuit)
       
    53 		{
       
    54 			status = 1;
       
    55 		}
       
    56 	}
       
    57     catch(ExceptionReporter& aExceptionReport)
       
    58 	{
       
    59 		status = 0;
       
    60     }
       
    61 	delete cmdInput;
       
    62 	CPPUNIT_ASSERT(status != 0);
       
    63 }
       
    64 
       
    65 
       
    66 /**
       
    67 Test the cmdhandler output by providing wrong option.
       
    68 Note: Refer the code coverage output for percentage of check.
       
    69       Pass the unknown option. '-l'
       
    70 
       
    71 @internalComponent
       
    72 @released
       
    73 */
       
    74 void CTestCmdHandler::TestWithWrongArugument()
       
    75 {
       
    76 	int status = 0;
       
    77 	CmdLineHandler* cmdInput;
       
    78 	try
       
    79 	{
       
    80 		char* argvect[] = { "imgchecker","-s=" };
       
    81 		cmdInput = new CmdLineHandler();
       
    82 		ReturnType val = cmdInput->ProcessCommandLine(2,argvect);
       
    83 		if(val == ESuccess)
       
    84 		{
       
    85 			status = 0;
       
    86 		}
       
    87 	}
       
    88     catch(ExceptionReporter& aExceptionReport)
       
    89 	{
       
    90 		aExceptionReport.Report();
       
    91 		status = 1;
       
    92     }
       
    93 	delete cmdInput;
       
    94 	CPPUNIT_ASSERT(status != 0);
       
    95 }
       
    96 
       
    97 
       
    98 /**
       
    99 Test the cmdhandler output by providing invalid image.
       
   100 Note: Refer the code coverage output for percentage of check.
       
   101       Pass the invalid image. 'invalid.img'
       
   102 
       
   103 @internalComponent
       
   104 @released
       
   105 */
       
   106 void CTestCmdHandler::TestWithInvalidImg()
       
   107 {
       
   108 	int status = 0;
       
   109 	CmdLineHandler* cmdInput;
       
   110 	try
       
   111 	{
       
   112 		char* argvect[] = { "imgchecker","S:/GT0415/cppunit/imgcheck_unittest/imgs/invalid.img" };
       
   113 		cmdInput = new CmdLineHandler();
       
   114 		ReturnType val = cmdInput->ProcessCommandLine(2,argvect);
       
   115 		int x = 0;
       
   116 		if(val == ESuccess)
       
   117 		{
       
   118 			status = 1;
       
   119 		}
       
   120 	}
       
   121     catch(ExceptionReporter& aExceptionReport)
       
   122 	{
       
   123 		aExceptionReport.Report();
       
   124 		status = 0;
       
   125     }
       
   126 	delete cmdInput;
       
   127 	CPPUNIT_ASSERT(status != 0);
       
   128 }
       
   129 
       
   130 
       
   131 /**
       
   132 Test the cmdhandler output for getting the report flag.
       
   133 Note: Refer the code coverage output for percentage of check.
       
   134       Pass the valid images.
       
   135 
       
   136 @internalComponent
       
   137 @released
       
   138 */
       
   139 void CTestCmdHandler::TestWithGetReportFlag()
       
   140 {
       
   141 	int status = 0;
       
   142 	CmdLineHandler* cmdInput;
       
   143 	try
       
   144 	{
       
   145 		char* argvect[] = { "imgchecker","-a", "-q", "-x", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rom.img" };
       
   146 		cmdInput = new CmdLineHandler();
       
   147 		ReturnType val = cmdInput->ProcessCommandLine(5,argvect);
       
   148 		unsigned int flag = cmdInput->ReportFlag();             
       
   149 		if((flag & QuietMode) && (flag & KXmlReport) && (flag & KAll))
       
   150 		{
       
   151 			status = 1;
       
   152 		}
       
   153 	}
       
   154     catch(ExceptionReporter& aExceptionReport)
       
   155 	{
       
   156 		aExceptionReport.Report();
       
   157 		status = 0;
       
   158     }
       
   159 	delete cmdInput;
       
   160 	CPPUNIT_ASSERT(status != 0);
       
   161 }
       
   162 
       
   163 
       
   164 /**
       
   165 Test the cmdhandler output for getting the xml report name.
       
   166 Note: Refer the code coverage output for percentage of check.
       
   167       Pass the valid images.
       
   168 
       
   169 @internalComponent
       
   170 @released
       
   171 */
       
   172 void CTestCmdHandler::TestWithGetXmlReportName()
       
   173 {
       
   174 	int status = 0;
       
   175 	CmdLineHandler* cmdInput;
       
   176 	try
       
   177 	{
       
   178 		char* argvect[] = { "imgchecker","--all", "-o=test.xml", "--xml","--dep","--vid", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rom.img" };
       
   179 		cmdInput = new CmdLineHandler();
       
   180 		ReturnType val = cmdInput->ProcessCommandLine(7,argvect);
       
   181 		String xmlName = cmdInput->XmlReportName();  
       
   182 		if(xmlName == String("test.xml"))
       
   183 		{
       
   184 			status = 1;
       
   185 		}
       
   186 	}
       
   187     catch(ExceptionReporter& aExceptionReport)
       
   188 	{
       
   189 		aExceptionReport.Report();
       
   190 		status = 0;
       
   191     }
       
   192 	delete cmdInput;
       
   193 	CPPUNIT_ASSERT(status != 0);
       
   194 }
       
   195 
       
   196 
       
   197 /**
       
   198 Test the cmdhandler output by providing valid image without any options.
       
   199 Note: Refer the code coverage output for percentage of check.
       
   200       Pass the valid image. 'rom.img'
       
   201 
       
   202 @internalComponent
       
   203 @released
       
   204 */
       
   205 void CTestCmdHandler::TestWithValidImg()
       
   206 {
       
   207 	int status = 0;
       
   208 	CmdLineHandler* cmdInput;
       
   209 	try
       
   210 	{
       
   211 		char* argvect[] = { "imgchecker","S:/GT0415/cppunit/imgcheck_unittest/imgs/rom.img" };
       
   212 		cmdInput = new CmdLineHandler();
       
   213 		ReturnType val = cmdInput->ProcessCommandLine(2,argvect);
       
   214 		if(val == ESuccess)
       
   215 		{
       
   216 			status = 1;
       
   217 		}
       
   218 	}
       
   219     catch(ExceptionReporter& aExceptionReport)
       
   220 	{
       
   221 		aExceptionReport.Report();
       
   222 		status = 0;
       
   223     }
       
   224 	delete cmdInput;
       
   225 	CPPUNIT_ASSERT(status != 0);
       
   226 }
       
   227 
       
   228 
       
   229 /**
       
   230 Test the cmdhandler output by providing invalid option.
       
   231 Note: Refer the code coverage output for percentage of check.
       
   232       Pass the invalid image. 'invalid.img'
       
   233 
       
   234 @internalComponent
       
   235 @released
       
   236 */
       
   237 void CTestCmdHandler::TestWithInvalidOption()
       
   238 {
       
   239 	int status = 0;
       
   240 	CmdLineHandler* cmdInput;
       
   241 	try
       
   242 	{
       
   243 		char* argvect[] = { "imgchecker","---q","S:/GT0415/cppunit/imgcheck_unittest/imgs/rom.img" };
       
   244 		cmdInput = new CmdLineHandler();
       
   245 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   246 		if(val == ESuccess)
       
   247 		{
       
   248 			status = 1;
       
   249 		}
       
   250 	}
       
   251     catch(ExceptionReporter& aExceptionReport)
       
   252 	{
       
   253 		aExceptionReport.Report();
       
   254 		status = 0;
       
   255     }
       
   256 	delete cmdInput;
       
   257 }
       
   258 
       
   259 
       
   260 /**
       
   261 Test the cmdhandler output by help option.
       
   262 Note: Refer the code coverage output for percentage of check.
       
   263       Pass the valid image. 'rom.img'
       
   264 
       
   265 @internalComponent
       
   266 @released
       
   267 */
       
   268 void CTestCmdHandler::TestWithHelpOption()
       
   269 {
       
   270 	int status = 0;
       
   271 	CmdLineHandler* cmdInput;
       
   272 	try
       
   273 	{
       
   274 		char* argvect[] = { "imgchecker","-H" };	
       
   275 		cmdInput = new CmdLineHandler();
       
   276 		ReturnType val = cmdInput->ProcessCommandLine(2,argvect);
       
   277 		if(val == EQuit)
       
   278 		{
       
   279 			status = 1;
       
   280 		}
       
   281 	}
       
   282     catch(ExceptionReporter& aExceptionReport)
       
   283 	{
       
   284 		aExceptionReport.Report();
       
   285 		status = 0;
       
   286     }
       
   287 	delete cmdInput;
       
   288 	CPPUNIT_ASSERT(status != 0);
       
   289 }
       
   290 
       
   291 /**
       
   292 Test the cmdhandler output by passing vidlist long and suppress short options.
       
   293 Note: Refer the code coverage output for percentage of check.
       
   294       Pass the valid image. 'rom.img'
       
   295 
       
   296 @internalComponent
       
   297 @released
       
   298 */
       
   299 void CTestCmdHandler::TestWithVidlist_supressOption()
       
   300 {
       
   301 	int status = 0;
       
   302 	CmdLineHandler* cmdInput;
       
   303 	try
       
   304 	{
       
   305 		char* argvect[] = { "imgchecker","-x","--vidlist=0x70000001","-s=sid,dep","--vid","S:/GT0415/cppunit/imgcheck_unittest/imgs/rom.img" };
       
   306 		cmdInput = new CmdLineHandler();
       
   307 		ReturnType val = cmdInput->ProcessCommandLine(6,argvect);
       
   308 		if(val == ESuccess)
       
   309 		{
       
   310 			status = 1;
       
   311 		}
       
   312 	}
       
   313     catch(ExceptionReporter& aExceptionReport)
       
   314 	{
       
   315 		aExceptionReport.Report();
       
   316 		status = 0;
       
   317     }
       
   318 	delete cmdInput;
       
   319 	CPPUNIT_ASSERT(status != 0);
       
   320 }
       
   321 
       
   322 /**
       
   323 Test the cmdhandler output by passing vidlist short and suppress long option.
       
   324 Note: Refer the code coverage output for percentage of check.
       
   325       Pass the valid image. 'rom.img'
       
   326 
       
   327 @internalComponent
       
   328 @released
       
   329 */
       
   330 void CTestCmdHandler::TestWithVidlist_supressOption1()
       
   331 {
       
   332 	int status = 0;
       
   333 	CmdLineHandler* cmdInput;
       
   334 	try
       
   335 	{
       
   336 		char* argvect[] = { "imgchecker","--sid", "-x","--vidlist=1879048193","--SUPPRESS=dep","--all", "--vid","--output=tst","S:/GT0415/cppunit/imgcheck_unittest/imgs/rom.img" };
       
   337 		cmdInput = new CmdLineHandler();
       
   338 		ReturnType val = cmdInput->ProcessCommandLine(9,argvect);
       
   339 		if(val == ESuccess)
       
   340 		{
       
   341 			status = 1;
       
   342 		}
       
   343 	}
       
   344     catch(ExceptionReporter& aExceptionReport)
       
   345 	{
       
   346 		aExceptionReport.Report();
       
   347 		status = 0;
       
   348     }
       
   349 	delete cmdInput;
       
   350 	CPPUNIT_ASSERT(status != 0);
       
   351 }
       
   352 
       
   353 /**
       
   354 Test the cmdhandler output by passing all option.
       
   355 Note: Refer the code coverage output for percentage of check.
       
   356       Pass the valid image. 'rom.img'
       
   357 
       
   358 @internalComponent
       
   359 @released
       
   360 */
       
   361 void CTestCmdHandler::TestWithAllOption()
       
   362 {
       
   363 	int status = 0;
       
   364 	CmdLineHandler* cmdInput;
       
   365 	try
       
   366 	{
       
   367 		char* argvect[] = { "imgchecker","-x","--vidlist=0x70000001,0","--vid","--sid","--dep","--all","-o=c:\tst","S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img","S:/GT0415/cppunit/imgcheck_unittest/imgs/rom.img" };
       
   368 		cmdInput = new CmdLineHandler();
       
   369 		ReturnType val = cmdInput->ProcessCommandLine(10,argvect);
       
   370 	}
       
   371     catch(ExceptionReporter& aExceptionReport)
       
   372 	{
       
   373 		aExceptionReport.Report();
       
   374 		status = 0;
       
   375     }
       
   376 	delete cmdInput;
       
   377 }
       
   378 
       
   379 /**
       
   380 Test the cmdhandler output by provinding options but no input image.
       
   381 Note: Refer the code coverage output for percentage of check.		
       
   382 
       
   383 @internalComponent
       
   384 @released
       
   385 */
       
   386 void CTestCmdHandler::TestForValidateArgumentNoImage()
       
   387 {
       
   388 	int status = 0;
       
   389 	CmdLineHandler* cmdInput;
       
   390 	try
       
   391 	{
       
   392 		char* argvect[] = { "imgchecker", "-a", "--vidlist=0s20000001" };
       
   393 		cmdInput = new CmdLineHandler();
       
   394 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   395 		if(val == ESuccess)
       
   396 		{
       
   397 			status = 1;
       
   398 		}
       
   399 	}
       
   400     catch(ExceptionReporter& aExceptionReport)
       
   401 	{
       
   402 		aExceptionReport.Report();
       
   403 		status = 0;
       
   404     }
       
   405 	delete cmdInput;
       
   406 }
       
   407 
       
   408 /**
       
   409 Test the cmdhandler by provinding quiet option when not generating the XML file.
       
   410 Note: Refer the code coverage output for percentage of check.
       
   411 
       
   412 @internalComponent
       
   413 @released
       
   414 */
       
   415 void CTestCmdHandler::TestForValidateArgument()
       
   416 {
       
   417 	int status = 0;
       
   418 	CmdLineHandler* cmdInput;
       
   419 	try
       
   420 	{
       
   421 		char* argvect[] = { "imgchecker", "-q", "-a", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   422 		cmdInput = new CmdLineHandler();
       
   423 		ReturnType val = cmdInput->ProcessCommandLine(4,argvect);
       
   424 		if(val == EXIT_FAILURE)
       
   425 		{
       
   426 			status = 1;
       
   427 		}
       
   428 	}
       
   429     catch(ExceptionReporter& aExceptionReport)
       
   430 	{
       
   431 		aExceptionReport.Report();
       
   432 		status = 0;
       
   433     }
       
   434 	delete cmdInput;
       
   435 }
       
   436 
       
   437 /**
       
   438 Test the cmdhandler by provinding XML file name when not generating the XML report.
       
   439 Note: Refer the code coverage output for percentage of check.
       
   440 
       
   441 @internalComponent
       
   442 @released
       
   443 */
       
   444 void CTestCmdHandler::TestForValidateArgumentwithoutXMLoutput()
       
   445 {
       
   446 	int status = 0;
       
   447 	CmdLineHandler* cmdInput;
       
   448 	try
       
   449 	{
       
   450 		char* argvect[] = { "imgchecker", "-a", "-o=c:/report1", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   451 		cmdInput = new CmdLineHandler();
       
   452 		ReturnType val = cmdInput->ProcessCommandLine(4,argvect);
       
   453 		if(val == EXIT_FAILURE)
       
   454 		{
       
   455 			status = 1;
       
   456 		}
       
   457 	}
       
   458     catch(ExceptionReporter& aExceptionReport)
       
   459 	{
       
   460 		aExceptionReport.Report();
       
   461 		status = 0;
       
   462     }
       
   463 	delete cmdInput;
       
   464 }
       
   465 
       
   466 /**
       
   467 Test the cmdhandler by provinding VID value but VID validation is suppressed.
       
   468 Note: Refer the code coverage output for percentage of check.
       
   469 
       
   470 @internalComponent
       
   471 @released
       
   472 */
       
   473 void CTestCmdHandler::TestForValidateArgumentwithVIDVALandVIDsuppressed()
       
   474 {
       
   475 	int status = 0;
       
   476 	CmdLineHandler* cmdInput;
       
   477 	try
       
   478 	{
       
   479 		char* argvect[] = { "imgchecker", "-s=vid", "--vidlist=0x70000001", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   480 		cmdInput = new CmdLineHandler();
       
   481 		ReturnType val = cmdInput->ProcessCommandLine(4,argvect);
       
   482 		if(val == EXIT_FAILURE)
       
   483 		{
       
   484 			status = 1;
       
   485 		}
       
   486 	}
       
   487     catch(ExceptionReporter& aExceptionReport)
       
   488 	{
       
   489 		aExceptionReport.Report();
       
   490 		status = 0;
       
   491     }
       
   492 	delete cmdInput;
       
   493 }
       
   494 
       
   495 /**
       
   496 Test the cmdhandler output(xml) by provinding any image.
       
   497 Note: Refer the code coverage output for percentage of check.
       
   498 		Pass the valid image.(rofs.img).
       
   499 
       
   500 @internalComponent
       
   501 @released
       
   502 */
       
   503 void CTestCmdHandler::TestForValidateArgumentwithAllsuppressed()
       
   504 {
       
   505 	int status = 0;
       
   506 	CmdLineHandler* cmdInput;
       
   507 	try
       
   508 	{
       
   509 		char* argvect[] = { "imgchecker", "-s=dep,sid,vid", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   510 		cmdInput = new CmdLineHandler();
       
   511 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   512 		if(val == EXIT_FAILURE)
       
   513 		{
       
   514 			status = 1;
       
   515 		}
       
   516 	}
       
   517     catch(ExceptionReporter& aExceptionReport)
       
   518 	{
       
   519 		aExceptionReport.Report();
       
   520 		status = 0;
       
   521     }
       
   522 	delete cmdInput;
       
   523 }
       
   524 
       
   525 /**
       
   526 Test the cmdhandler output(xml) by provinding any image.
       
   527 Note: Refer the code coverage output for percentage of check.
       
   528 		Pass the valid image.(rofs.img).
       
   529 
       
   530 @internalComponent
       
   531 @released
       
   532 */
       
   533 void CTestCmdHandler::TestForValidateArgumentwithValueExpected()
       
   534 {
       
   535 	int status = 0;
       
   536 	CmdLineHandler* cmdInput;
       
   537 	try
       
   538 	{
       
   539 		char* argvect[] = { "imgchecker", "-s", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   540 		cmdInput = new CmdLineHandler();
       
   541 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   542 		if(val == EXIT_FAILURE)
       
   543 		{
       
   544 			status = 1;
       
   545 		}
       
   546 	}
       
   547     catch(ExceptionReporter& aExceptionReport)
       
   548 	{
       
   549 		aExceptionReport.Report();
       
   550 		status = 0;
       
   551     }
       
   552 	delete cmdInput;
       
   553 }
       
   554 
       
   555 /**
       
   556 Test the cmdhandler output(xml) by provinding any image.
       
   557 Note: Refer the code coverage output for percentage of check.
       
   558 		Pass the valid image.(rofs.img).
       
   559 
       
   560 @internalComponent
       
   561 @released
       
   562 */
       
   563 void CTestCmdHandler::TestForValidateArgumentwithValueUnExpected()
       
   564 {
       
   565 	int status = 0;
       
   566 	CmdLineHandler* cmdInput;
       
   567 	try
       
   568 	{
       
   569 		char* argvect[] = { "imgchecker", "-x=xyz", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   570 		cmdInput = new CmdLineHandler();
       
   571 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   572 		if(val == EXIT_FAILURE)
       
   573 		{
       
   574 			status = 1;
       
   575 		}
       
   576 	}
       
   577     catch(ExceptionReporter& aExceptionReport)
       
   578 	{
       
   579 		aExceptionReport.Report();
       
   580 		status = 0;
       
   581     }
       
   582 	delete cmdInput;
       
   583 }
       
   584 
       
   585 /**
       
   586 Test the cmdhandler output(xml) by provinding any image.
       
   587 Note: Refer the code coverage output for percentage of check.
       
   588 		Pass the valid image.(rofs.img).
       
   589 
       
   590 @internalComponent
       
   591 @released
       
   592 */
       
   593 void CTestCmdHandler::TestForValidateArgumentwithValueExpectedareMore()
       
   594 {
       
   595 	int status = 0;
       
   596 	CmdLineHandler* cmdInput;
       
   597 	try
       
   598 	{
       
   599 		char* argvect[] = { "imgchecker", "-o=test,test1", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   600 		cmdInput = new CmdLineHandler();
       
   601 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   602 		if(val == EXIT_FAILURE)
       
   603 		{
       
   604 			status = 1;
       
   605 		}
       
   606 	}
       
   607     catch(ExceptionReporter& aExceptionReport)
       
   608 	{
       
   609 		aExceptionReport.Report();
       
   610 		status = 0;
       
   611     }
       
   612 	delete cmdInput;
       
   613 }
       
   614 
       
   615 /**
       
   616 Test the cmdhandler output(xml) by provinding any image.
       
   617 Note: Refer the code coverage output for percentage of check.
       
   618 		Pass the valid image.(rofs.img).
       
   619 
       
   620 @internalComponent
       
   621 @released
       
   622 */
       
   623 void CTestCmdHandler::TestForwithoutInput()
       
   624 {
       
   625 	int status = 0;
       
   626 	CmdLineHandler* cmdInput;
       
   627 	try
       
   628 	{
       
   629 		char* argvect[] = { "imgchecker" };
       
   630 		cmdInput = new CmdLineHandler();
       
   631 		ReturnType val = cmdInput->ProcessCommandLine(1,argvect);
       
   632 		if(val == EXIT_FAILURE)
       
   633 		{
       
   634 			status = 1;
       
   635 		}
       
   636 	}
       
   637     catch(ExceptionReporter& aExceptionReport)
       
   638 	{
       
   639 		aExceptionReport.Report();
       
   640 		status = 0;
       
   641     }
       
   642 	delete cmdInput;
       
   643 }
       
   644 
       
   645 /**
       
   646 Test the cmdhandler output(xml) by provinding any image.
       
   647 Note: Refer the code coverage output for percentage of check.
       
   648 		Pass the valid image.(rofs.img).
       
   649 
       
   650 @internalComponent
       
   651 @released
       
   652 */
       
   653 void CTestCmdHandler::TestVerbose()
       
   654 {
       
   655 	int status = 0;
       
   656 	CmdLineHandler* cmdInput;
       
   657 	try
       
   658 	{
       
   659 		char* argvect[] = { "imgchecker", "--verbose", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   660 		cmdInput = new CmdLineHandler();
       
   661 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   662 		if(val == EXIT_FAILURE)
       
   663 		{
       
   664 			status = 1;
       
   665 		}
       
   666 	}
       
   667     catch(ExceptionReporter& aExceptionReport)
       
   668 	{
       
   669 		aExceptionReport.Report();
       
   670 		status = 0;
       
   671     }
       
   672 	delete cmdInput;
       
   673 }
       
   674 
       
   675 /**
       
   676 Test the cmdhandler output(xml) by provinding any image.
       
   677 Note: Refer the code coverage output for percentage of check.
       
   678 		Pass the valid image.(rofs.img).
       
   679 
       
   680 @internalComponent
       
   681 @released
       
   682 */
       
   683 void CTestCmdHandler::TestSIDALLOption()
       
   684 {
       
   685 	int status = 0;
       
   686 	CmdLineHandler* cmdInput;
       
   687 	try
       
   688 	{
       
   689 		char* argvect[] = { "imgchecker", "--sidall", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   690 		cmdInput = new CmdLineHandler();
       
   691 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   692 		if(val == EXIT_FAILURE)
       
   693 		{
       
   694 			status = 1;
       
   695 		}
       
   696 	}
       
   697     catch(ExceptionReporter& aExceptionReport)
       
   698 	{
       
   699 		aExceptionReport.Report();
       
   700 		status = 0;
       
   701     }
       
   702 	delete cmdInput;
       
   703 }
       
   704 
       
   705 /**
       
   706 Test the cmdhandler output(xml) by provinding any image.
       
   707 Note: Refer the code coverage output for percentage of check.
       
   708 		Pass the valid image.(rofs.img).
       
   709 
       
   710 @internalComponent
       
   711 @released
       
   712 */
       
   713 void CTestCmdHandler::TestSIDALLandSuppressSIDOption()
       
   714 {
       
   715 	int status = 0;
       
   716 	CmdLineHandler* cmdInput;
       
   717 	try
       
   718 	{
       
   719 		char* argvect[] = { "imgchecker", "--sidall", "-s=sid", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   720 		cmdInput = new CmdLineHandler();
       
   721 		ReturnType val = cmdInput->ProcessCommandLine(4,argvect);
       
   722 		if(val == EXIT_FAILURE)
       
   723 		{
       
   724 			status = 1;
       
   725 		}
       
   726 	}
       
   727     catch(ExceptionReporter& aExceptionReport)
       
   728 	{
       
   729 		aExceptionReport.Report();
       
   730 		status = 0;
       
   731     }
       
   732 	delete cmdInput;
       
   733 }
       
   734 
       
   735 /**
       
   736 Test the cmdhandler output(xml) by provinding any image.
       
   737 Note: Refer the code coverage output for percentage of check.
       
   738 		Pass the valid image.(rofs.img).
       
   739 
       
   740 @internalComponent
       
   741 @released
       
   742 */
       
   743 void CTestCmdHandler::TestUnknownOption()
       
   744 {
       
   745 	int status = 0;
       
   746 	CmdLineHandler* cmdInput;
       
   747 	try
       
   748 	{
       
   749 		char* argvect[] = { "imgchecker", "-j", "-b", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   750 		cmdInput = new CmdLineHandler();
       
   751 		ReturnType val = cmdInput->ProcessCommandLine(4,argvect);
       
   752 		if(val == EXIT_FAILURE)
       
   753 		{
       
   754 			status = 1;
       
   755 		}
       
   756 	}
       
   757     catch(ExceptionReporter& aExceptionReport)
       
   758 	{
       
   759 		aExceptionReport.Report();
       
   760 		status = 0;
       
   761     }
       
   762 	delete cmdInput;
       
   763 }
       
   764 
       
   765 /**
       
   766 Test the cmdhandler output(xml) by provinding any image.
       
   767 Note: Refer the code coverage output for percentage of check.
       
   768 		Pass the valid image.(rofs.img).
       
   769 
       
   770 @internalComponent
       
   771 @released
       
   772 */
       
   773 void CTestCmdHandler::TestInvalidVidListOption()
       
   774 {
       
   775 	int status = 0;
       
   776 	CmdLineHandler* cmdInput;
       
   777 	try
       
   778 	{
       
   779 		char* argvect[] = { "imgchecker", "--vidlist=7000abcd", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   780 		cmdInput = new CmdLineHandler();
       
   781 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   782 		if(val == EXIT_FAILURE)
       
   783 		{
       
   784 			status = 1;
       
   785 		}
       
   786 	}
       
   787     catch(ExceptionReporter& aExceptionReport)
       
   788 	{
       
   789 		aExceptionReport.Report();
       
   790 		status = 0;
       
   791     }
       
   792 	delete cmdInput;
       
   793 }
       
   794 
       
   795 /**
       
   796 Test the cmdhandler output(xml) by provinding any image for invalid supression value.
       
   797 Note: Refer the code coverage output for percentage of check.
       
   798 		Pass the valid image.(rofs.img).
       
   799 
       
   800 @internalComponent
       
   801 @released
       
   802 */
       
   803 void CTestCmdHandler::TestInvalidSupressOption()
       
   804 {
       
   805 	int status = 0;
       
   806 	CmdLineHandler* cmdInput;
       
   807 	try
       
   808 	{
       
   809 		char* argvect[] = { "imgchecker", "--vid", "-s=abcd", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   810 		cmdInput = new CmdLineHandler();
       
   811 		ReturnType val = cmdInput->ProcessCommandLine(4,argvect);
       
   812 		if(val == EXIT_FAILURE)
       
   813 		{
       
   814 			status = 1;
       
   815 		}
       
   816 	}
       
   817     catch(ExceptionReporter& aExceptionReport)
       
   818 	{
       
   819 		aExceptionReport.Report();
       
   820 		status = 0;
       
   821     }
       
   822 	delete cmdInput;
       
   823 }
       
   824 
       
   825 /**
       
   826 Test the cmdhandler output(xml) by provinding enable option without any image.
       
   827 Note: Refer the code coverage output for percentage of check.
       
   828 		Pass the valid image.(rofs.img).
       
   829 
       
   830 @internalComponent
       
   831 @released
       
   832 */
       
   833 void CTestCmdHandler::TestEnableOption()
       
   834 {
       
   835 	int status = 0;
       
   836 	CmdLineHandler* cmdInput;
       
   837 	try
       
   838 	{
       
   839 		char* argvect[] = { "imgchecker", "--vid" };
       
   840 		cmdInput = new CmdLineHandler();
       
   841 		ReturnType val = cmdInput->ProcessCommandLine(2,argvect);
       
   842 		if(val == EXIT_FAILURE)
       
   843 		{
       
   844 			status = 1;
       
   845 		}
       
   846 	}
       
   847     catch(ExceptionReporter& aExceptionReport)
       
   848 	{
       
   849 		aExceptionReport.Report();
       
   850 		status = 0;
       
   851     }
       
   852 	delete cmdInput;
       
   853 }
       
   854 
       
   855 /**
       
   856 Test the cmdhandler output(xml) by provinding vidlist with zero and any image.
       
   857 Note: Refer the code coverage output for percentage of check.
       
   858 		Pass the valid image.(rofs.img).
       
   859 
       
   860 @internalComponent
       
   861 @released
       
   862 */
       
   863 void CTestCmdHandler::TestVidListOptionwithZeroValue()
       
   864 {
       
   865 	int status = 0;
       
   866 	CmdLineHandler* cmdInput;
       
   867 	try
       
   868 	{
       
   869 		char* argvect[] = { "imgchecker", "--vidlist=0x0", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   870 		cmdInput = new CmdLineHandler();
       
   871 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   872 		if(val == EXIT_FAILURE)
       
   873 		{
       
   874 			status = 1;
       
   875 		}
       
   876 	}
       
   877     catch(ExceptionReporter& aExceptionReport)
       
   878 	{
       
   879 		aExceptionReport.Report();
       
   880 		status = 0;
       
   881     }
       
   882 	delete cmdInput;
       
   883 }
       
   884 
       
   885 /**
       
   886 Test the cmdhandler output(xml) by provinding vidlist with invalid value and any image.
       
   887 Note: Refer the code coverage output for percentage of check.
       
   888 		Pass the valid image.(rofs.img).
       
   889 
       
   890 @internalComponent
       
   891 @released
       
   892 */
       
   893 void CTestCmdHandler::TestVidListOptionwithinvalidValue()
       
   894 {
       
   895 	int status = 0;
       
   896 	CmdLineHandler* cmdInput;
       
   897 	try
       
   898 	{
       
   899 		char* argvect[] = { "imgchecker", "--vidlist=0xfffffffff", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   900 		cmdInput = new CmdLineHandler();
       
   901 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   902 		if(val == EXIT_FAILURE)
       
   903 		{
       
   904 			status = 1;
       
   905 		}
       
   906 	}
       
   907     catch(ExceptionReporter& aExceptionReport)
       
   908 	{
       
   909 		aExceptionReport.Report();
       
   910 		status = 0;
       
   911     }
       
   912 	delete cmdInput;
       
   913 }
       
   914 
       
   915 /**
       
   916 Test the cmdhandler output(xml) by provinding vidlist with invalid value and any image.
       
   917 Note: Refer the code coverage output for percentage of check.
       
   918 		Pass the valid image.(rofs.img).
       
   919 
       
   920 @internalComponent
       
   921 @released
       
   922 */
       
   923 void CTestCmdHandler::TestVidListOptionwithinvalidValue1()
       
   924 {
       
   925 	int status = 0;
       
   926 	CmdLineHandler* cmdInput;
       
   927 	try
       
   928 	{
       
   929 		char* argvect[] = { "imgchecker", "--vidlist=0x00ag,4294967299", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   930 		cmdInput = new CmdLineHandler();
       
   931 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   932 		if(val == EXIT_FAILURE)
       
   933 		{
       
   934 			status = 1;
       
   935 		}
       
   936 	}
       
   937     catch(ExceptionReporter& aExceptionReport)
       
   938 	{
       
   939 		aExceptionReport.Report();
       
   940 		status = 0;
       
   941     }
       
   942 	delete cmdInput;
       
   943 }
       
   944 
       
   945 /**
       
   946 Test the cmdhandler output(xml) by provinding dbg with invalid value and any image.
       
   947 Note: Refer the code coverage output for percentage of check.
       
   948 
       
   949 @internalComponent
       
   950 @released
       
   951 */
       
   952 void CTestCmdHandler::TestDbgOptionwithinvalidValue()
       
   953 {
       
   954 	int status = 0;
       
   955 	CmdLineHandler* cmdInput;
       
   956 	try
       
   957 	{
       
   958 		char* argvect[] = { "imgchecker", "--dbg=xyz", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   959 		cmdInput = new CmdLineHandler();
       
   960 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   961 		if(val == EXIT_FAILURE)
       
   962 		{
       
   963 			status = 1;
       
   964 		}
       
   965 	}
       
   966     catch(ExceptionReporter& aExceptionReport)
       
   967 	{
       
   968 		aExceptionReport.Report();
       
   969 		status = 0;
       
   970     }
       
   971 	delete cmdInput;
       
   972 }
       
   973 
       
   974 /**
       
   975 Test the cmdhandler output(xml) by provinding dbg with = but no value.
       
   976 Note: Refer the code coverage output for percentage of check.
       
   977 
       
   978 @internalComponent
       
   979 @released
       
   980 */
       
   981 void CTestCmdHandler::TestDbgOptionwithoutValue()
       
   982 {
       
   983 	int status = 0;
       
   984 	CmdLineHandler* cmdInput;
       
   985 	try
       
   986 	{
       
   987 		char* argvect[] = { "imgchecker", "--dbg=", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
   988 		cmdInput = new CmdLineHandler();
       
   989 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
   990 		if(val == EXIT_FAILURE)
       
   991 		{
       
   992 			status = 1;
       
   993 		}
       
   994 	}
       
   995     catch(ExceptionReporter& aExceptionReport)
       
   996 	{
       
   997 		aExceptionReport.Report();
       
   998 		status = 0;
       
   999     }
       
  1000 	delete cmdInput;
       
  1001 }
       
  1002 
       
  1003 /**
       
  1004 Test the cmdhandler output(xml) by provinding e32input with = 
       
  1005 Note: Refer the code coverage output for percentage of check.
       
  1006 
       
  1007 @internalComponent
       
  1008 @released
       
  1009 */
       
  1010 void CTestCmdHandler::Teste32inputOptionwithValue()
       
  1011 {
       
  1012 	int status = 0;
       
  1013 	CmdLineHandler* cmdInput;
       
  1014 	try
       
  1015 	{
       
  1016 		char* argvect[] = { "imgchecker", "--e32input=", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
  1017 		cmdInput = new CmdLineHandler();
       
  1018 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
  1019 		if(val == EXIT_FAILURE)
       
  1020 		{
       
  1021 			status = 1;
       
  1022 		}
       
  1023 	}
       
  1024     catch(ExceptionReporter& aExceptionReport)
       
  1025 	{
       
  1026 		aExceptionReport.Report();
       
  1027 		status = 0;
       
  1028     }
       
  1029 	delete cmdInput;
       
  1030 }
       
  1031 
       
  1032 /**
       
  1033 Test the cmdhandler output(xml) by provinding e32input a image but not a E32 input.
       
  1034 Note: Refer the code coverage output for percentage of check.
       
  1035 
       
  1036 @internalComponent
       
  1037 @released
       
  1038 */
       
  1039 void CTestCmdHandler::Teste32inputOptionwithimg()
       
  1040 {
       
  1041 	int status = 0;
       
  1042 	CmdLineHandler* cmdInput;
       
  1043 	try
       
  1044 	{
       
  1045 		char* argvect[] = { "imgchecker", "--e32input", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img" };
       
  1046 		cmdInput = new CmdLineHandler();
       
  1047 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
  1048 		if(val == EXIT_FAILURE)
       
  1049 		{
       
  1050 			status = 1;
       
  1051 		}
       
  1052 	}
       
  1053     catch(ExceptionReporter& aExceptionReport)
       
  1054 	{
       
  1055 		aExceptionReport.Report();
       
  1056 		status = 0;
       
  1057     }
       
  1058 	delete cmdInput;
       
  1059 }
       
  1060 
       
  1061 /**
       
  1062 Test the cmdhandler output(xml) by provinding valid images along with e32input option
       
  1063 Note: Refer the code coverage output for percentage of check.
       
  1064 
       
  1065 @internalComponent
       
  1066 @released
       
  1067 */
       
  1068 void CTestCmdHandler::Teste32inputOptionwithimg1()
       
  1069 {
       
  1070 	int status = 0;
       
  1071 	CmdLineHandler* cmdInput;
       
  1072 	try
       
  1073 	{
       
  1074 		char* argvect[] = { "imgchecker", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rom.img", "--e32input" };
       
  1075 		cmdInput = new CmdLineHandler();
       
  1076 		ReturnType val = cmdInput->ProcessCommandLine(4,argvect);
       
  1077 		if(val == EXIT_FAILURE)
       
  1078 		{
       
  1079 			status = 1;
       
  1080 		}
       
  1081 	}
       
  1082     catch(ExceptionReporter& aExceptionReport)
       
  1083 	{
       
  1084 		aExceptionReport.Report();
       
  1085 		status = 0;
       
  1086     }
       
  1087 	delete cmdInput;
       
  1088 }
       
  1089 
       
  1090 /**
       
  1091 Test the cmdhandler output(xml) by provinding invalid e32input option.
       
  1092 Note: Refer the code coverage output for percentage of check.
       
  1093 
       
  1094 @internalComponent
       
  1095 @released
       
  1096 */
       
  1097 void CTestCmdHandler::Teste32inputOptionwithinvalidoption()
       
  1098 {
       
  1099 	int status = 0;
       
  1100 	CmdLineHandler* cmdInput;
       
  1101 	try
       
  1102 	{
       
  1103 		char* argvect[] = { "imgchecker", "S:/GT0415/cppunit/imgcheck_unittest/imgs/rofs1.img", "--e3input" };
       
  1104 		cmdInput = new CmdLineHandler();
       
  1105 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
  1106 		if(val == EXIT_FAILURE)
       
  1107 		{
       
  1108 			status = 1;
       
  1109 		}
       
  1110 	}
       
  1111     catch(ExceptionReporter& aExceptionReport)
       
  1112 	{
       
  1113 		aExceptionReport.Report();
       
  1114 		status = 0;
       
  1115     }
       
  1116 	delete cmdInput;
       
  1117 }
       
  1118 
       
  1119 /**
       
  1120 Test the cmdhandler output(xml) by provinding invalid e32input option.
       
  1121 Note: Refer the code coverage output for percentage of check.
       
  1122 
       
  1123 @internalComponent
       
  1124 @released
       
  1125 */
       
  1126 void CTestCmdHandler::Teste32inputOptionwithinvalidoption1()
       
  1127 {
       
  1128 	int status = 0;
       
  1129 	CmdLineHandler* cmdInput;
       
  1130 	try
       
  1131 	{
       
  1132 		char* argvect[] = { "imgchecker", "S:/epoc32/release/armv5/udeb", "--e2input" };
       
  1133 		cmdInput = new CmdLineHandler();
       
  1134 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
  1135 		if(val == EXIT_FAILURE)
       
  1136 		{
       
  1137 			status = 1;
       
  1138 		}
       
  1139 	}
       
  1140     catch(ExceptionReporter& aExceptionReport)
       
  1141 	{
       
  1142 		aExceptionReport.Report();
       
  1143 		status = 0;
       
  1144     }
       
  1145 	delete cmdInput;
       
  1146 }
       
  1147 
       
  1148 /**
       
  1149 Test the cmdhandler output(xml) by provinding = to -n otpions.
       
  1150 Note: Refer the code coverage output for percentage of check.
       
  1151 
       
  1152 @internalComponent
       
  1153 @released
       
  1154 */
       
  1155 void CTestCmdHandler::TestnocheckOptionwithinvalidoption()
       
  1156 {
       
  1157 	int status = 0;
       
  1158 	CmdLineHandler* cmdInput;
       
  1159 	try
       
  1160 	{
       
  1161 		char* argvect[] = { "imgchecker", "S:/epoc32/release/armv5/udeb", "-n=" };
       
  1162 		cmdInput = new CmdLineHandler();
       
  1163 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
  1164 		if(val == EXIT_FAILURE)
       
  1165 		{
       
  1166 			status = 1;
       
  1167 		}
       
  1168 	}
       
  1169     catch(ExceptionReporter& aExceptionReport)
       
  1170 	{
       
  1171 		aExceptionReport.Report();
       
  1172 		status = 0;
       
  1173     }
       
  1174 	delete cmdInput;
       
  1175 }
       
  1176 
       
  1177 /**
       
  1178 Test the cmdhandler output(xml) by provinding = to --nocheck option.
       
  1179 Note: Refer the code coverage output for percentage of check.
       
  1180 
       
  1181 @internalComponent
       
  1182 @released
       
  1183 */
       
  1184 void CTestCmdHandler::TestnocheckOptionwithinvalidoption1()
       
  1185 {
       
  1186 	int status = 0;
       
  1187 	CmdLineHandler* cmdInput;
       
  1188 	try
       
  1189 	{
       
  1190 		char* argvect[] = { "imgchecker", "S:/epoc32/release/armv5/udeb", "--nocheck=" };
       
  1191 		cmdInput = new CmdLineHandler();
       
  1192 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
  1193 		if(val == EXIT_FAILURE)
       
  1194 		{
       
  1195 			status = 1;
       
  1196 		}
       
  1197 	}
       
  1198     catch(ExceptionReporter& aExceptionReport)
       
  1199 	{
       
  1200 		aExceptionReport.Report();
       
  1201 		status = 0;
       
  1202     }
       
  1203 	delete cmdInput;
       
  1204 }
       
  1205 
       
  1206 /**
       
  1207 Test the cmdhandler output(xml) by provinding nocheck option with single '-'
       
  1208 Note: Refer the code coverage output for percentage of check.
       
  1209 
       
  1210 @internalComponent
       
  1211 @released
       
  1212 */
       
  1213 void CTestCmdHandler::TestnocheckOptionwithinvalidoption2()
       
  1214 {
       
  1215 	int status = 0;
       
  1216 	CmdLineHandler* cmdInput;
       
  1217 	try
       
  1218 	{
       
  1219 		char* argvect[] = { "imgchecker", "S:/epoc32/release/armv5/udeb", "-nocheck" };
       
  1220 		cmdInput = new CmdLineHandler();
       
  1221 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
  1222 		if(val == EXIT_FAILURE)
       
  1223 		{
       
  1224 			status = 1;
       
  1225 		}
       
  1226 	}
       
  1227     catch(ExceptionReporter& aExceptionReport)
       
  1228 	{
       
  1229 		aExceptionReport.Report();
       
  1230 		status = 0;
       
  1231     }
       
  1232 	delete cmdInput;
       
  1233 }
       
  1234 
       
  1235 /**
       
  1236 Test the cmdhandler output(xml) by provinding '--' to nocehck otpion
       
  1237 Note: Refer the code coverage output for percentage of check.
       
  1238 
       
  1239 @internalComponent
       
  1240 @released
       
  1241 */
       
  1242 void CTestCmdHandler::TestnocheckOptionwithinvalidoption3()
       
  1243 {
       
  1244 	int status = 0;
       
  1245 	CmdLineHandler* cmdInput;
       
  1246 	try
       
  1247 	{
       
  1248 		char* argvect[] = { "imgchecker", "S:/epoc32/release/armv5/udeb", "--n" };
       
  1249 		cmdInput = new CmdLineHandler();
       
  1250 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
  1251 		if(val == EXIT_FAILURE)
       
  1252 		{
       
  1253 			status = 1;
       
  1254 		}
       
  1255 	}
       
  1256     catch(ExceptionReporter& aExceptionReport)
       
  1257 	{
       
  1258 		aExceptionReport.Report();
       
  1259 		status = 0;
       
  1260     }
       
  1261 	delete cmdInput;
       
  1262 }
       
  1263 
       
  1264 /**
       
  1265 Test the cmdhandler output(xml) by provinding valid E32input but not enabling any validations.
       
  1266 Note: Refer the code coverage output for percentage of check.
       
  1267 		Pass the valid image.(rofs.img).
       
  1268 
       
  1269 @internalComponent
       
  1270 @released
       
  1271 */
       
  1272 void CTestCmdHandler::TestnocheckOptionwithNoChecksEnabled()
       
  1273 {
       
  1274 	int status = 0;
       
  1275 	CmdLineHandler* cmdInput;
       
  1276 	try
       
  1277 	{
       
  1278 		char* argvect[] = { "imgchecker", "--e32input", "S:/epoc32/release/armv5/udeb"};
       
  1279 		cmdInput = new CmdLineHandler();
       
  1280 		ReturnType val = cmdInput->ProcessCommandLine(3,argvect);
       
  1281 		if(val == EXIT_FAILURE)
       
  1282 		{
       
  1283 			status = 1;
       
  1284 		}
       
  1285 	}
       
  1286     catch(ExceptionReporter& aExceptionReport)
       
  1287 	{
       
  1288 		aExceptionReport.Report();
       
  1289 		status = 0;
       
  1290     }
       
  1291 	delete cmdInput;
       
  1292 }
       
  1293 
       
  1294 /**
       
  1295 Test the cmdhandler output(xml) by provinding valid E32input and ALL option but not enabling any validations
       
  1296 Note: Refer the code coverage output for percentage of check.
       
  1297 
       
  1298 @internalComponent
       
  1299 @released
       
  1300 */
       
  1301 void CTestCmdHandler::TestnocheckOptionwithNoChecksEnabled1()
       
  1302 {
       
  1303 	int status = 0;
       
  1304 	CmdLineHandler* cmdInput;
       
  1305 	try
       
  1306 	{
       
  1307 		char* argvect[] = { "imgchecker", "--e32input", "S:/epoc32/release/armv5/udeb", "--all"};
       
  1308 		cmdInput = new CmdLineHandler();
       
  1309 		ReturnType val = cmdInput->ProcessCommandLine(4,argvect);
       
  1310 		if(val == EXIT_FAILURE)
       
  1311 		{
       
  1312 			status = 1;
       
  1313 		}
       
  1314 	}
       
  1315     catch(ExceptionReporter& aExceptionReport)
       
  1316 	{
       
  1317 		aExceptionReport.Report();
       
  1318 		status = 0;
       
  1319     }
       
  1320 	delete cmdInput;
       
  1321 }
       
  1322 
       
  1323 /**
       
  1324 Test the cmdhandler output(xml) by provinding E32input but no directory nor a E32 file.
       
  1325 Note: Refer the code coverage output for percentage of check.
       
  1326 
       
  1327 @internalComponent
       
  1328 @released
       
  1329 */
       
  1330 void CTestCmdHandler::TesttocheckOptionwithNoImgandE32input()
       
  1331 {
       
  1332 	int status = 0;
       
  1333 	CmdLineHandler* cmdInput;
       
  1334 	try
       
  1335 	{
       
  1336 		char* argvect[] = { "imgchecker", "--e32input"};
       
  1337 		cmdInput = new CmdLineHandler();
       
  1338 		ReturnType val = cmdInput->ProcessCommandLine(2,argvect);
       
  1339 		if(val == EXIT_FAILURE)
       
  1340 		{
       
  1341 			status = 1;
       
  1342 		}
       
  1343 	}
       
  1344     catch(ExceptionReporter& aExceptionReport)
       
  1345 	{
       
  1346 		aExceptionReport.Report();
       
  1347 		status = 0;
       
  1348     }
       
  1349 	delete cmdInput;
       
  1350 }
       
  1351 
       
  1352 /**
       
  1353 Test the cmdhandler output(xml) by provinding invalid option.
       
  1354 Note: Refer the code coverage output for percentage of check.
       
  1355 
       
  1356 @internalComponent
       
  1357 @released
       
  1358 */
       
  1359 void CTestCmdHandler::TesttocheckOptionPrefix()
       
  1360 {
       
  1361 	int status = 0;
       
  1362 	CmdLineHandler* cmdInput;
       
  1363 	try
       
  1364 	{
       
  1365 		char* argvect[] = { "imgchecker", "--"};
       
  1366 		cmdInput = new CmdLineHandler();
       
  1367 		ReturnType val = cmdInput->ProcessCommandLine(2,argvect);
       
  1368 		if(val == EXIT_FAILURE)
       
  1369 		{
       
  1370 			status = 1;
       
  1371 		}
       
  1372 	}
       
  1373     catch(ExceptionReporter& aExceptionReport)
       
  1374 	{
       
  1375 		aExceptionReport.Report();
       
  1376 		status = 0;
       
  1377     }
       
  1378 	delete cmdInput;
       
  1379 }
       
  1380 
       
  1381 
       
  1382 /**
       
  1383 Test the cmdhandler output(xml) by provinding invalid option and no image.
       
  1384 Note: Refer the code coverage output for percentage of check.
       
  1385 
       
  1386 @internalComponent
       
  1387 @released
       
  1388 */
       
  1389 void CTestCmdHandler::TesttocheckInvalidOption()
       
  1390 {
       
  1391 	int status = 0;
       
  1392 	CmdLineHandler* cmdInput;
       
  1393 	try
       
  1394 	{
       
  1395 		char* argvect[] = { "imgchecker", "--sidalll"};
       
  1396 		cmdInput = new CmdLineHandler();
       
  1397 		ReturnType val = cmdInput->ProcessCommandLine(2,argvect);
       
  1398 		if(val == EXIT_FAILURE)
       
  1399 		{
       
  1400 			status = 1;
       
  1401 		}
       
  1402 	}
       
  1403     catch(ExceptionReporter& aExceptionReport)
       
  1404 	{
       
  1405 		aExceptionReport.Report();
       
  1406 		status = 0;
       
  1407     }
       
  1408 	delete cmdInput;
       
  1409 }
       
  1410 
       
  1411 
       
  1412 /**
       
  1413 Test the cmdhandler output(xml) by provinding invalid option and no image.
       
  1414 Note: Refer the code coverage output for percentage of check.
       
  1415 
       
  1416 @internalComponent
       
  1417 @released
       
  1418 */
       
  1419 void CTestCmdHandler::TesttocheckInvalidOption1()
       
  1420 {
       
  1421 	int status = 0;
       
  1422 	CmdLineHandler* cmdInput;
       
  1423 	try
       
  1424 	{
       
  1425 		char* argvect[] = { "imgchecker", "--depp"};
       
  1426 		cmdInput = new CmdLineHandler();
       
  1427 		ReturnType val = cmdInput->ProcessCommandLine(2,argvect);
       
  1428 		if(val == EXIT_FAILURE)
       
  1429 		{
       
  1430 			status = 1;
       
  1431 		}
       
  1432 	}
       
  1433     catch(ExceptionReporter& aExceptionReport)
       
  1434 	{
       
  1435 		aExceptionReport.Report();
       
  1436 		status = 0;
       
  1437     }
       
  1438 	delete cmdInput;
       
  1439 }
       
  1440 
       
  1441 
       
  1442 /**
       
  1443 Test the cmdhandler output(xml) by provinding invalid option and no image.
       
  1444 Note: Refer the code coverage output for percentage of check.
       
  1445 
       
  1446 @internalComponent
       
  1447 @released
       
  1448 */
       
  1449 void CTestCmdHandler::TesttocheckInvalidOption2()
       
  1450 {
       
  1451 	int status = 0;
       
  1452 	CmdLineHandler* cmdInput;
       
  1453 	try
       
  1454 	{
       
  1455 		char* argvect[] = { "imgchecker", "--e32inputt"};
       
  1456 		cmdInput = new CmdLineHandler();
       
  1457 		ReturnType val = cmdInput->ProcessCommandLine(2,argvect);
       
  1458 		if(val == EXIT_FAILURE)
       
  1459 		{
       
  1460 			status = 1;
       
  1461 		}
       
  1462 	}
       
  1463     catch(ExceptionReporter& aExceptionReport)
       
  1464 	{
       
  1465 		aExceptionReport.Report();
       
  1466 		status = 0;
       
  1467     }
       
  1468 	delete cmdInput;
       
  1469 }