Update contrib.
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 #include "LogCliServShared.h"
20 #include "logservpanic.h"
21 #include "logpackage.h"
22 #include "t_logutil.h"
24 RTest TheTest(_L("t_logservipc"));
26 _LIT(KServerName, "!LogServ");
27 _LIT(KServerProcess, "LogServ");
29 ///////////////////////////////////////////////////////////////////////////////////////
41 TExitCategoryName iCategory;
46 const TInt KAsynchDelay = 500000;
48 const TInt KFunctionNumbers [] = {ELogOperationCancel,
49 ELogOperationGetResult,
50 ELogOperationInitiate,
56 ELogViewOperationInitiate,
57 ELogViewChangeNotificationsRequest,
58 ELogViewChangeNotificationsCancel,
60 ELogViewNotifyLockStatusChange,
61 ELogViewNotifyLockStatusChangeCancel,
63 ELogNotifyExtendedCancel};
65 const TInt KNumFunctions = sizeof(KFunctionNumbers)/sizeof(KFunctionNumbers[0]);
67 //===============================================================================
69 TBool IsFunctionAsynchronous(TInt aFunc)
71 TBool asynch = EFalse;
74 case ELogOperationInitiate:
76 case ELogViewOperationInitiate:
77 case ELogViewChangeNotificationsRequest:
78 case ELogViewNotifyLockStatusChange:
79 case ELogNotifyExtended:
89 class RIpcFuzzTest : public RSessionBase
91 public: // Constructors and destructor
94 * Constructor for performing 1st stage construction
104 * Performs test steps
107 void RunTestL(const TDesC& aTargetSrvName, TInt aFunc,
108 TInt aTestType, TInt aArgCount);
111 TInt Fuzz(TInt aMsg, TInt aArgCount);
112 TInt FuzzL(TInt aMsg, TInt aArgCount);
113 TInt Fuzz8L(TInt aMsg, TInt aArgCount);
116 RIpcFuzzTest::RIpcFuzzTest()
118 // No implementation required
122 RIpcFuzzTest::~RIpcFuzzTest()
127 TInt RIpcFuzzTest::Fuzz(TInt aMsg, TInt aArgCount)
131 for(TInt i = 0; i < aArgCount;i++)
133 args.Set(i,Math::Random());
138 if(IsFunctionAsynchronous(aMsg))
140 ret = Send(aMsg, args);
141 User::After(KAsynchDelay);
145 ret = SendReceive(aMsg, args);
150 TInt RIpcFuzzTest::Fuzz8L(TInt aMsg, TInt aArgCount)
152 HBufC8* buf = HBufC8::NewLC(255);
153 TPtr8 ptr = buf->Des();
154 ptr.Fill(Math::Random(),255);
158 for(TInt i = 0; i < aArgCount;i++)
165 if(IsFunctionAsynchronous(aMsg))
167 ret = Send(aMsg, args);
168 User::After(KAsynchDelay);
172 ret = SendReceive(aMsg, args);
175 CleanupStack::PopAndDestroy(buf);
179 TInt RIpcFuzzTest::FuzzL(TInt aMsg, TInt aArgCount)
181 HBufC* buf = HBufC::NewLC(255);
182 TPtr ptr = buf->Des();
183 ptr.Fill(Math::Random(),255);
187 for(TInt i = 0; i < aArgCount;i++)
194 if(IsFunctionAsynchronous(aMsg))
196 ret = Send(aMsg, args);
197 User::After(KAsynchDelay);
201 ret = SendReceive(aMsg, args);
204 CleanupStack::PopAndDestroy(buf);
208 void RIpcFuzzTest::RunTestL(const TDesC& aTargetSrvName,
209 TInt aFunc, TInt aTestType, TInt aArgCount)
211 TVersion version(0,0,0);
213 TInt err = CreateSession(aTargetSrvName, version);
220 Fuzz(aFunc,aArgCount);
224 Fuzz8L(aFunc,aArgCount);
228 FuzzL(aFunc,aArgCount);
233 TInt FuzzServerL(TAny* aTestInfo)
235 CTrapCleanup* cleanup=CTrapCleanup::New();
236 TInt err=KErrNoMemory;
240 TTestInfo* info = (TTestInfo*)aTestInfo;
243 TRAP(err,fuzzer.RunTestL(KServerName,info->iFunction
244 ,info->iType, info->iArgCount));
254 void TestServerApi(TInt aFunctionNumber,
255 TInt aTestType,TInt aArgCount, TExitDetails& aExitDetails)
259 testInfo.iFunction = aFunctionNumber;
260 testInfo.iType = aTestType;
261 testInfo.iArgCount = aArgCount;
264 _LIT(KThreadName,"FuzzerThread" );
265 TInt err = thread.Create(KThreadName,&FuzzServerL, KDefaultStackSize, NULL,&testInfo);
266 TEST2(err, KErrNone);
268 TRequestStatus threadStat;
269 thread.Logon(threadStat);
271 TBool jit = User::JustInTime();
272 User::SetJustInTime(EFalse);
276 User::WaitForRequest(threadStat);
278 User::SetJustInTime(jit);
280 aExitDetails.iCategory = thread.ExitCategory();
281 aExitDetails.iReason = thread.ExitReason();
282 aExitDetails.iExitType = thread.ExitType();
289 TInt LaunchServer(RProcess& aServer)
292 TheTest.Printf(_L("Launching LogServer...\n"));
294 const TUid KServerUid3 = {0x0101f401d};
295 const TUidType serverUid(KNullUid,KNullUid,KServerUid3);
297 TInt err = aServer.Create(KServerProcess, _L(""),serverUid);
301 aServer.SetPriority(EPriorityForeground);
303 //Start server and wait until it is running
304 TRequestStatus serverStat;
305 aServer.SetJustInTime(false);
308 aServer.Rendezvous(serverStat);
309 User::WaitForRequest(serverStat);
316 void PrintTestMessage(TInt iFunc, TInt iType, TInt iArgCount)
321 TheTest.Printf(_L("\nFuzz Test on function number %d using random Int data. Number of Args = %d"), iFunc, iArgCount);
325 TheTest.Printf(_L("\nFuzz Test on function number %d using random Des8 data. Number of Args = %d"), iFunc, iArgCount);
329 TheTest.Printf(_L("\nFuzz Test on function number %d using random Des data. Number of Args = %d"), iFunc, iArgCount);
340 @SYMTestCaseID SYSLIB-LOGENG-CT-4002
341 @SYMTestCaseDesc Tests LogEng APIs for IPC Robustness
342 @SYMTestPriority High
343 @SYMTestActions The function calls each of the Logeng APIs through a custom session object
344 passing random TInt, Des8 and Des16 data .
345 @SYMTestExpectedResults The server should be robust to all malformed messages and should not
349 LOCAL_C void DoFuzzTestsL ()
351 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-4002 "));
354 LEAVE_IF_ERROR(LaunchServer(server));
356 TExitDetails exitDetails;
358 for(TInt i = 0;i< KNumFunctions;i++)
361 //Carry out each type of test
362 for(TInt testType = 0; testType < 3;testType++)
364 //Carry out each test with number of arguments 1 - 4
365 for(TInt argCount = 1;argCount <= 4;argCount++)
367 PrintTestMessage(KFunctionNumbers[i], testType, argCount);
369 TestServerApi(KFunctionNumbers[i], testType, argCount, exitDetails);
370 //Kill the server process and verify that it was still running
371 //If the server was already dead it would return the reason it exited
372 if(server.ExitType() != EExitPending)
375 TInt exitReason = server.ExitReason();
377 TEST2(exitReason, 0);
378 LEAVE_IF_ERROR(LaunchServer(server));
382 TheTest.Printf(_L("\nFuzz Test Successful\n"));
392 typedef void (*TestFunction)();
394 class RClientMessageTestSession : public RSessionBase
399 TInt TestMakeTransient(TInt aArg0);
400 TInt TestMakeTransient(const TDesC8& aArg0);
402 TInt TestCliServDataParam(TInt aFunc, TDes8& aArg0);
403 TInt TestCliServDataParam(TInt aFunc, TDes8& aArg0, TUint32 aArg1);
404 TInt TestCliServDataParam(TInt aFunc, TDes8& aArg0, TDes8& aArg1, TInt aArg2);
405 TInt TestCliServDataParam(TInt aFunc, TDes& aArg0, TDes8& aArg1, TInt aArg2);
407 TInt TestLogNotify(TInt aArg0);
408 TInt TestLogNotifyCancel();
410 TInt TestLogViewCreate(TInt aArg0, TInt aArg1);
412 TInt TestLogViewIdParam(TInt aFunc, TInt aArg0);
413 TInt TestLogViewIdParam(TInt aFunc, TDes8& aArg1);
415 TInt TestLogViewFetchChanges(TInt aArg0, TInt aArg1, TDes8& aArg2);
416 TInt TestLogViewFetchChanges(TInt aArg0, TInt aArg1, const TDesC8& aArg2);
418 TInt TestLogNotifyExtended(TDes8& aArg0, TDes8& aArg1, TDes8& aArg2,TDes8& aArg3);
419 TInt TestLogNotifyExtended(TDes& aArg0, TDes& aArg1, TDes& aArg2,TDes& aArg3);
420 TInt TestLogNotifyExtended(TDes8& aArg0, TInt aArg1, TInt aArg2,const TDesC8& aArg3);
422 TInt TestFunction45(TAny* aData);
427 static TInt LaunchLogServer()
432 TInt err = process.Create(KServerProcess,_L(""));
436 TRequestStatus serverStat;
438 process.SetJustInTime(EFalse);
440 process.Rendezvous(serverStat);
441 User::WaitForRequest(serverStat);
448 TInt RClientMessageTestSession::Connect()
453 TInt r = CreateSession(KServerName,TVersion(1,0,0));
455 if((r != KErrNotFound)&&(r != KErrServerTerminated))
465 r = LaunchLogServer();
466 if((r != KErrNone)&&(r != KErrAlreadyExists))
473 TInt RClientMessageTestSession::TestMakeTransient(TInt aArg0)
475 return SendReceive(ELogMakeTransient,TIpcArgs(aArg0));
478 TInt RClientMessageTestSession::TestMakeTransient(const TDesC8& aArg0)
480 return SendReceive(ELogMakeTransient,TIpcArgs(&aArg0));
483 TInt RClientMessageTestSession::TestCliServDataParam(TInt aFunc, TDes8& aArg0)
485 return SendReceive(aFunc,TIpcArgs(&aArg0));
488 TInt RClientMessageTestSession::TestCliServDataParam(TInt aFunc, TDes8& aArg0, TUint32 aArg1)
490 return SendReceive(aFunc,TIpcArgs(&aArg0, aArg1));
493 TInt RClientMessageTestSession::TestCliServDataParam(TInt aFunc, TDes8& aArg0, TDes8& aArg1, TInt aArg2)
495 return SendReceive(aFunc,TIpcArgs(&aArg0, &aArg1, aArg2));
498 TInt RClientMessageTestSession::TestLogNotify(TInt aArg0)
500 return Send(ELogNotify,TIpcArgs(aArg0));
503 TInt RClientMessageTestSession::TestLogNotifyCancel()
505 return Send(ELogNotifyCancel);
508 TInt RClientMessageTestSession::TestLogViewCreate(TInt aArg0, TInt aArg1)
510 return SendReceive(ELogViewCreate,TIpcArgs(aArg0,aArg1));
514 TInt RClientMessageTestSession::TestLogViewIdParam(TInt aFunc, TInt aArg0)
516 return SendReceive(aFunc,TIpcArgs(aArg0));
519 TInt RClientMessageTestSession::TestLogViewIdParam(TInt aFunc, TDes8& aArg0)
521 return SendReceive(aFunc,TIpcArgs(&aArg0));
524 TInt RClientMessageTestSession::TestLogViewFetchChanges(TInt aArg0, TInt aArg1, TDes8& aArg2)
526 return SendReceive(ELogViewFetchChanges,TIpcArgs(aArg0,aArg1, &aArg2));
529 TInt RClientMessageTestSession::TestLogViewFetchChanges(TInt aArg0, TInt aArg1, const TDesC8& aArg2)
531 return SendReceive(ELogViewFetchChanges,TIpcArgs(aArg0,aArg1, &aArg2));
534 TInt RClientMessageTestSession::TestLogNotifyExtended(TDes8& aArg0,
535 TDes8& aArg1, TDes8& aArg2,TDes8& aArg3)
537 return Send(ELogNotifyExtended,TIpcArgs(&aArg0,&aArg1,&aArg2,&aArg3));
540 TInt RClientMessageTestSession::TestLogNotifyExtended(TDes& aArg0,
541 TDes& aArg1, TDes& aArg2,TDes& aArg3)
543 return Send(ELogNotifyExtended,TIpcArgs(&aArg0,&aArg1,&aArg2,&aArg3));
546 TInt RClientMessageTestSession::TestLogNotifyExtended(TDes8& aArg0,
547 TInt aArg1, TInt aArg2,const TDesC8& aArg3)
549 return Send(ELogNotifyExtended,TIpcArgs(&aArg0,&aArg1,&aArg2,&aArg3));
552 TInt RClientMessageTestSession::TestFunction45(TAny* aData)
554 return SendReceive(45,TIpcArgs(aData));
558 TInt TestFunctionLauncherL(TAny* aTestFunction)
560 CTrapCleanup* cleanup=CTrapCleanup::New();
564 TestFunction function = (TestFunction)aTestFunction;
576 TExitDetails LaunchTestThreadL(const TDesC& aThreadName, TestFunction aFunction)
579 TInt err = thread.Create(aThreadName, &TestFunctionLauncherL, KDefaultStackSize, NULL, (TAny*)aFunction);
580 TEST2(err, KErrNone);
582 TRequestStatus threadStat;
583 thread.Logon(threadStat);
585 TBool jit = User::JustInTime();
586 User::SetJustInTime(EFalse);
589 User::WaitForRequest(threadStat);
591 User::SetJustInTime(jit);
593 TExitDetails exitDetails;
594 exitDetails.iCategory = thread.ExitCategory();
595 exitDetails.iReason = thread.ExitReason();
596 exitDetails.iExitType = thread.ExitType();
602 @SYMTestCaseID SYSLIB-LOGENG-CT-4003
603 @SYMTestCaseDesc Tests Message schema validation for the ELogMakeTransient message.
604 @SYMTestPriority High
605 @SYMTestActions Sends messages to the test server to test the validation of messages
606 against the message schema.
607 @SYMTestExpectedResults The server should validate the message and handle bad messages appropriately
610 void TestMakeTransientL()
613 RClientMessageTestSession session;
615 TInt err = session.Connect();
616 TEST2(err, KErrNone);
618 CleanupClosePushL(session);
620 err = session.TestMakeTransient(0);
621 TEST2(err, KErrNone);
623 //anything different from 0 should be considered as ETrue
624 err = session.TestMakeTransient(1);
625 TEST2(err, KErrNone);
627 err = session.TestMakeTransient(-5);
628 TEST2(err, KErrNone);
630 err = session.TestMakeTransient(3);
631 TEST2(err, KErrNone);
633 err = session.TestMakeTransient( _L8("Des8"));
634 TEST2(err, KErrNone);
636 CleanupStack::PopAndDestroy(&session);
640 @SYMTestCaseID SYSLIB-LOGENG-CT-4004
641 @SYMTestCaseDesc Tests Message schema validation for the messages accepting
642 TLogClientServerData parameters.
643 @SYMTestPriority High
644 @SYMTestActions Sends messages to the test server to test the validation of messages
645 against the message schema. The messages contain either valid or invalid
647 @SYMTestExpectedResults The server should validate the message and handle bad messages appropriately
650 void TestCliServDataParamL()
653 RClientMessageTestSession session;
655 TInt err = session.Connect();
656 TEST2(err, KErrNone);
658 CleanupClosePushL(session);
660 TLogClientServerData data;
661 TPckg<TLogClientServerData> pData(data);
663 TBuf8<sizeof(TLogClientServerData)> buf;
665 buf.SetLength(sizeof(TLogClientServerData));
669 data.iOperationType = ELogOperationEventAdd;
670 data.iOperationId = 1;
671 err = session.TestCliServDataParam(ELogOperationInitiate,pData);
672 TEST2(err, KErrBadDescriptor);
674 data.iOperationType = ELogOperationViewWindowFetch;
675 data.iOperationId = 5;
676 err = session.TestCliServDataParam(ELogOperationInitiate,pData);
677 TEST2(err, KErrArgument);
679 data.iOperationType = ELogOperationEventAdd;
680 data.iOperationId = 0x8FFFFFFF;
681 err = session.TestCliServDataParam(ELogOperationInitiate,pData);
682 TEST2(err, KErrBadDescriptor);
684 data.iOperationType = ELogOperationEventAdd;
685 data.iOperationId = 0x8FFFFFFF;
686 err = session.TestCliServDataParam(ELogOperationInitiate,buf);
687 TEST2(err, KErrArgument);
689 data.iOperationType = ELogOperationEventAdd;
690 data.iOperationId = 1;
691 err = session.TestCliServDataParam(ELogOperationCancel,pData);
692 TEST2(err, KErrCancel);
694 data.iOperationType = ELogOperationEventAdd;
695 data.iOperationId = 1;
696 err = session.TestCliServDataParam(ELogOperationCancel,buf);
697 TEST2(err, KErrArgument);
699 CLogPackage* package = CLogPackage::NewL();
700 TPtr8 ptr(package->Ptr());
702 data.iOperationType = ELogOperationEventAdd;
703 data.iOperationId = 1;
704 err = session.TestCliServDataParam(ELogOperationGetResult,buf, ptr, 0);
705 TEST2(err, KErrArgument);
707 data.iOperationType = ELogOperationEventAdd;
708 data.iOperationId = 1;
709 err = session.TestCliServDataParam(ELogOperationGetResult,pData, ptr, -1 );
710 TEST2(err, KErrNone);
715 data.iOperationType = ELogOperationEventAdd;
716 data.iOperationId = 1;
717 err = session.TestCliServDataParam(ELogOperationGetResult,buf, smallBuf, 0);
718 TEST2(err, KErrArgument);
720 CleanupStack::PopAndDestroy(&session);
724 @SYMTestCaseID SYSLIB-LOGENG-LEGACY-T_LOGSERVIPC-0001
725 @SYMTestCaseDesc Tests Message schema validation for the messages accepting
726 TLogClientServerData parameters.
727 @SYMTestPriority High
728 @SYMTestActions Sends messages to the test server to test the validation of messages
729 against the message schema. The messages contain either valid or invalid
731 @SYMTestExpectedResults The server should validate the message and handle bad messages appropriately
734 void TestCliServDataParam2L()
736 RClientMessageTestSession session;
738 TInt err = session.Connect();
739 TEST2(err, KErrNone);
741 CleanupClosePushL(session);
743 TBuf8<sizeof(TLogClientServerData) - 1> buf;
747 //This should panic with Logserv 63
748 err = session.TestCliServDataParam(ELogOperationInitiate,buf);
749 TEST2(err, KErrNone);
751 CleanupStack::PopAndDestroy(&session);
755 @SYMTestCaseID SYSLIB-LOGENG-LEGACY-T_LOGSERVIPC-0002
756 @SYMTestCaseDesc Tests Message schema validation for the messages accepting
757 TLogClientServerData parameters.
758 @SYMTestPriority High
759 @SYMTestActions Sends messages to the test server to test the validation of messages
760 against the message schema. The messages contain either valid or invalid
762 @SYMTestExpectedResults The server should validate the message and handle bad messages appropriately
765 void TestCliServDataParam3L()
767 RClientMessageTestSession session;
769 TInt err = session.Connect();
770 TEST2(err, KErrNone);
772 CleanupClosePushL(session);
774 TBuf8<sizeof(TLogClientServerData) + 1> buf;
778 err = session.TestCliServDataParam(ELogOperationInitiate,buf);
779 TEST2(err, KErrArgument);
781 CleanupStack::PopAndDestroy(&session);
786 @SYMTestCaseID SYSLIB-LOGENG-CT-4005
787 @SYMTestCaseDesc Tests Message schema validation for the ELogNotify message.
788 @SYMTestPriority High
789 @SYMTestActions Sends messages to the test server to test the validation of messages
790 against the message schema. The messages contain either valid or invalid
792 @SYMTestExpectedResults The server should validate the message and handle bad messages appropriately
795 void TestLogNotifyL()
798 RClientMessageTestSession session;
800 TInt err = session.Connect();
801 TEST2(err, KErrNone);
803 CleanupClosePushL(session);
805 err = session.TestLogNotify(0);
806 TEST2(err, KErrNone);
808 //Cancel the pending notification
809 err = session.TestLogNotifyCancel();
810 TEST2(err, KErrNone);
812 err = session.TestLogNotify(1000000);
813 TEST2(err, KErrNone);
815 //Cancel the pending notification
816 err = session.TestLogNotifyCancel();
817 TEST2(err, KErrNone);
819 err = session.TestLogNotify(-1);
820 TEST2(err, KErrNone);
822 CleanupStack::PopAndDestroy(&session);
826 @SYMTestCaseID SYSLIB-LOGENG-CT-4006
827 @SYMTestCaseDesc Tests Message schema validation for the ELogViewCreate message.
828 @SYMTestPriority High
829 @SYMTestActions Sends messages to the test server to test the validation of messages
830 against the message schema. The messages contain either valid or invalid
832 @SYMTestExpectedResults The server should validate the message and handle bad messages appropriately
835 void TestLogViewCreateL()
838 RClientMessageTestSession session;
840 TInt err = session.Connect();
841 TEST2(err, KErrNone);
843 CleanupClosePushL(session);
845 err = session.TestLogViewCreate(0,ELogViewTypeEvent);
846 TEST2(err, KErrNone);
848 err = session.TestLogViewCreate(100000,ELogViewTypeDuplicate);
849 TEST2(err, KErrNone);
851 err = session.TestLogViewCreate(0,ELogViewTypeDuplicate + 1);
852 TEST2(err, KErrArgument);
854 err = session.TestLogViewCreate(-1,ELogViewTypeRecent);
855 TEST2(err, KErrNone);
857 err = session.TestLogViewCreate(20,-1);
858 TEST2(err, KErrArgument);
860 CleanupStack::PopAndDestroy(&session);
865 @SYMTestCaseID SYSLIB-LOGENG-CT-4012
866 @SYMTestCaseDesc Tests Message schema validation for the ELogNotifyExtended message.
867 @SYMTestPriority High
868 @SYMTestActions Sends a message to the test server to test the validation of messages
869 against the message schema. The message contains an invalid descriptor.
870 @SYMTestExpectedResults The server should panic the client with KErrBadDescriptor
873 void TestLogNotifyExtended2L()
876 RClientMessageTestSession session;
878 TInt err = session.Connect();
879 TEST2(err, KErrNone);
881 CleanupClosePushL(session);
884 TPckgBuf<TInt> int0(0);
886 err = session.TestLogNotifyExtended(int0, 0, -1, KDes8);
887 TEST2(err, KErrNone);
889 CleanupStack::PopAndDestroy(&session);
893 @SYMTestCaseID SYSLIB-LOGENG-CT-4013
894 @SYMTestCaseDesc Tests Message schema validation for an invalid message
895 @SYMTestPriority High
896 @SYMTestActions Sends a message to the test server with a message number not
897 defined in the schema.
898 @SYMTestExpectedResults The server should return KErrInvalidFunction
901 void InvalidMessageTestL()
904 RClientMessageTestSession session;
906 TInt err = session.Connect();
907 TEST2(err, KErrNone);
909 CleanupClosePushL(session);
911 //This should cause the server to panic the client
912 err = session.TestFunction45(0);
914 CleanupStack::PopAndDestroy(&session);
919 static void DoAPITestsL()
922 TExitDetails exitDetails;
924 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-4004 "));
925 exitDetails = LaunchTestThreadL(_L("TestCliServDataParamL"), &TestCliServDataParamL);
926 TEST2(exitDetails.iExitType, EExitKill);
928 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-LEGACY-T_LOGSERVIPC-0001 "));
929 exitDetails = LaunchTestThreadL(_L("TestCliServDataParam2L"), &TestCliServDataParam2L);
930 TEST2(exitDetails.iExitType, EExitPanic);
931 TEST2(exitDetails.iReason, ELogBadDescriptor);
933 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-LEGACY-T_LOGSERVIPC-0002 "));
934 exitDetails = LaunchTestThreadL(_L("TestCliServDataParam3L"), &TestCliServDataParam3L);
935 TEST2(exitDetails.iExitType, EExitPanic);
936 TEST2(exitDetails.iReason, ELogBadDescriptor);
938 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-4005 "));
939 exitDetails = LaunchTestThreadL(_L("TestLogNotifyL"), &TestLogNotifyL);
940 TEST2(exitDetails.iExitType, EExitKill);
942 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-4006 "));
943 exitDetails = LaunchTestThreadL(_L("TestLogViewCreateL"), &TestLogViewCreateL);
944 TEST2(exitDetails.iExitType, EExitKill);
946 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-4012 "));
947 exitDetails = LaunchTestThreadL(_L("TestLogNotifyExtended2L"), &TestLogNotifyExtended2L);
948 TEST2(exitDetails.iExitType, EExitKill);
950 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-4013 "));
951 exitDetails = LaunchTestThreadL(_L("InvalidMessageTestL"), &InvalidMessageTestL);
952 TEST2(exitDetails.iExitType, EExitPanic);
953 TEST2(exitDetails.iReason, ELogIllegalFunction);
955 //test for debug-only API
957 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-4003 "));
958 exitDetails = LaunchTestThreadL(_L("TestMakeTransientL"), &TestMakeTransientL);
959 TEST2(exitDetails.iExitType, EExitKill);
966 GLDEF_C TInt E32Main ()
969 TheTest.Printf (_L ("\n"));
971 TheTest.Start (_L("IPC Fuzz Tests"));
973 CTrapCleanup* cleanup=CTrapCleanup::New();
974 TEST(cleanup != NULL);
976 TInt err=KErrNoMemory;
980 // Construct and install the active scheduler
981 CActiveScheduler* scheduler = new CActiveScheduler;
982 TEST(scheduler != NULL);
983 CActiveScheduler::Install (scheduler);
985 KillProcess(KServerProcess);
986 User::After(1000000);
988 TRAP (err, DoFuzzTestsL ());
989 TEST2(err, KErrNone);
991 TheTest.Next(_L("LogServ API Robustness Tests"));
992 TRAP (err, DoAPITestsL ());
993 TEST2(err, KErrNone);