os/persistentdata/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest1step.cpp
Update contrib.
1 // Copyright (c) 2005-2009 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.
14 // Example CTestStep derived implementation
19 @file UloggerServerTest1Step.cpp
22 #include "uloggerservertest1step.h"
23 #include "te_uloggerservertestsuitedefs.h"
24 #include "uloggerserver.h"
26 using namespace Ulogger;
29 CUloggerServerTest1Step::~CUloggerServerTest1Step()
36 CUloggerServerTest1Step::CUloggerServerTest1Step()
41 // **MUST** call SetTestStepName in the constructor as the controlling
42 // framework uses the test step name immediately following construction to set
43 // up the step's unique logging ID.
44 SetTestStepName(KUloggerServerTest1Step);
47 TVerdict CUloggerServerTest1Step::doTestStepPreambleL()
49 * @return - TVerdict code
50 * Override of base class virtual
53 iScheduler = new (ELeave) CActiveScheduler();
54 CActiveScheduler::Install(iScheduler);
56 SetTestStepResult(EPass);
57 return TestStepResult();
61 TVerdict CUloggerServerTest1Step::doTestStepL()
64 if (TestStepResult()==EPass)
66 iErrors += Test1L();//CULoggerServer::NewLC
67 iErrors += Test2L();//CULoggerServer::IncrementSessions
68 iErrors += Test3L();//CULoggerServer::Stop
69 iErrors += Test4L();//CULoggerServer::GetPrimaryFilters
70 iErrors += Test5L();//CULoggerServer::GetSecondaryFilters
71 iErrors += Test6L();//CULoggerServer::RemoveFilterfromConfig
72 iErrors += Test7L();//CULoggerServer::EnablePrimaryFilter
73 iErrors += Test8L();//CULoggerServer::SetSecondaryFilter
74 iErrors += Test9L();//CULoggerServer::Start
75 iErrors += Test12L();//CULoggerServer::SetActiveOutputMedia
76 iErrors += Test13L();//CULoggerServer::SetOutputPluginSettings
77 iErrors += Test14L();//CULoggerServer::GetActiveOutput
78 iErrors += Test15L();//CULoggerServer::GetInstalledPlugins
80 iErrors += Test16L();//CULoggerServer::GetOutputPluginSettingsL
81 iErrors += Test18L();//CULoggerServer::SetBufferSizeL
82 iErrors += Test19L();//CULoggerServer::SetDataNotificationSizeL
83 iErrors += Test20L();//CULoggerServer::GetBufferSize
84 iErrors += Test21L();// CULoggerServer::GetDataNotificationSize
85 iErrors += Test22L();//CULoggerServer::SetGlobalSecondaryFilters
86 iErrors += Test23L();//CULoggerServer::ReadBufferL
87 iErrors += Test25L();//CULoggerServer::SetBufferMode
88 iErrors += Test26L();//CULoggerServer::UnconfigureCurrentChannel
89 iErrors += Test27L();//CULoggerServer::DoPostProcessing
90 iErrors += Test28L();//CULoggerServer::RemoveOutputPluginSettingsL
91 iErrors += Test29L();//CULoggerServer::GetInstalledControlPlugins
92 iErrors += Test30L();//CULoggerServer::SetActiveControlMedia
93 iErrors += Test31L();//CULoggerServer::ProcessCommandL
97 res.AppendFormat(_L("%d errors"), iErrors);
98 INFO_PRINTF1(_L("****Results****"));
101 SetTestStepResult(EPass);
103 SetTestStepResult(EFail);
105 return TestStepResult();
110 TVerdict CUloggerServerTest1Step::doTestStepPostambleL()
112 * @return - TVerdict code
113 * Override of base class virtual
118 return TestStepResult();
121 TInt CUloggerServerTest1Step::Test1L()
122 {//CULoggerServer::NewLC
124 INFO_PRINTF1(_L("Testing - CULoggerServer::NewLC method"));
125 CULoggerServer *server = NULL;
126 server = CULoggerServer::NewLC(EPriorityBackground);
129 INFO_PRINTF1(_L("error"));
133 CleanupStack::PopAndDestroy();
137 TInt CUloggerServerTest1Step::Test2L()
138 {//CULoggerServer::IncrementSessions
140 INFO_PRINTF1(_L("Testing - CULoggerServer::IncrementSessions method"));
141 CULoggerServer *server = NULL;
142 server = CULoggerServer::NewLC(EPriorityBackground);
145 INFO_PRINTF1(_L("error"));
150 server->IncrementSessions();
151 //note it's not possible to test method DecrementSessions without
152 //previous connection as server always stop CActiveScheduler when last session will dissconnect.
153 //look for CULoggerServer::DecrementSessions() method
154 CleanupStack::PopAndDestroy();
159 TInt CUloggerServerTest1Step::Test3L()
160 {//CULoggerServer::Stop
162 INFO_PRINTF1(_L("Testing - CULoggerServer::Stop method"));
163 CULoggerServer *server = NULL;
164 server = CULoggerServer::NewLC(EPriorityBackground);
167 INFO_PRINTF1(_L("error"));
172 TInt e = server->Stop();
174 buf.AppendFormat(_L("Code returned from method - %d"), e);
176 CleanupStack::PopAndDestroy();
181 TInt CUloggerServerTest1Step::Test4L()
182 {//CULoggerServer::GetPrimaryFilters
184 INFO_PRINTF1(_L("Testing - CULoggerServer::GetPrimaryFilters method"));
185 CULoggerServer *server = NULL;
186 server = CULoggerServer::NewLC(EPriorityBackground);
189 INFO_PRINTF1(_L("error"));
194 RArray<TUint32> array;
195 TInt e = server->GetActiveFilters(array,EPrimaryFilter);
196 if(e!=KErrNone) errors++;
198 buf.AppendFormat(_L("Code returned from method - %d"), e);
201 buf.AppendFormat(_L("Num. of filters - %d"), array.Count());
203 CleanupStack::PopAndDestroy(); //server
209 TInt CUloggerServerTest1Step::Test5L()
210 {//CULoggerServer::GetSecondaryFilters
212 INFO_PRINTF1(_L("Testing - CULoggerServer::GetSecondaryFilters method"));
213 CULoggerServer *server = NULL;
214 server = CULoggerServer::NewLC(EPriorityBackground);
217 INFO_PRINTF1(_L("error"));
222 RArray<TUint32> array;
223 TInt e = server->GetActiveFilters(array,ESecondaryFilter);
224 if(e!=KErrNone) errors++;
226 buf.AppendFormat(_L("Code returned from method - %d"), e);
229 buf.AppendFormat(_L("Num. of filters - %d"), array.Count());
231 CleanupStack::PopAndDestroy(); //server
237 TInt CUloggerServerTest1Step::Test6L()
238 {//CULoggerServer::RemoveFilterfromConfig
240 INFO_PRINTF1(_L("Testing - CULoggerServer::RemoveFilterfromConfig method"));
241 CULoggerServer *server = NULL;
242 server = CULoggerServer::NewLC(EPriorityBackground);
245 INFO_PRINTF1(_L("error"));
249 { RArray<TUint32> filters;
250 //CleanupClosePushL(filters);
251 for(TInt i=20;i<40;i++)
255 // filters->AppendL(i);
256 TInt e = server->RemoveActiveFilter(filters,EPrimaryFilter);
259 buf.AppendFormat(_L("Code returned from method - %d"), e);
262 //CleanupStack::PopAndDestroy(); //filters
263 CleanupStack::PopAndDestroy(); //server
269 TInt CUloggerServerTest1Step::Test6AL()
270 {//CULoggerServer::RemoveFilterfromConfig
272 INFO_PRINTF1(_L("Testing - CULoggerServer::RemoveFilterfromConfig method"));
273 CULoggerServer *server = NULL;
274 server = CULoggerServer::NewLC(EPriorityBackground);
277 INFO_PRINTF1(_L("error"));
282 RArray<TUint32> filters;
283 CleanupClosePushL(filters);
284 for(TUint32 i=321;i<400;i++)
286 TInt e = server->RemoveActiveFilter(filters,ESecondaryFilter);;
289 buf.AppendFormat(_L("Code returned from method - %d"), e);
292 CleanupStack::PopAndDestroy(&filters); //server
293 CleanupStack::PopAndDestroy(); //server
298 TInt CUloggerServerTest1Step::Test7L()
299 {//CULoggerServer::EnablePrimaryFilter
301 INFO_PRINTF1(_L("Testing - CULoggerServer::SetPrimaryFilter method"));
302 CULoggerServer *server = NULL;
303 server=CULoggerServer::NewLC(EPriorityBackground);
306 INFO_PRINTF1(_L("error"));
311 RArray<TUint32> aCategory;
314 aCategory.Append(14);
315 aCategory.Append(194);
318 e = server->SetActiveFilterL(aCategory,EPrimaryFilter);
320 buf.AppendFormat(_L("Code returned from method - %d"), e);
322 CleanupStack::PopAndDestroy(); //server
328 TInt CUloggerServerTest1Step::Test8L()
329 {//CULoggerServer::SetSecondaryFilter
331 INFO_PRINTF1(_L("Testing - CULoggerServer::SetSecondaryFilter method"));
332 CULoggerServer *server = NULL;
333 server=CULoggerServer::NewLC(EPriorityBackground);
336 INFO_PRINTF1(_L("error"));
341 RArray<TUint32> array;
343 TInt e = server->SetActiveFilterL(array,ESecondaryFilter);
345 buf.AppendFormat(_L("Code returned from method - %d"), e);
347 CleanupStack::PopAndDestroy(); //server
353 TInt CUloggerServerTest1Step::Test9L()
354 {//CULoggerServer::Start
356 CULoggerServer *server = NULL;
357 server = CULoggerServer::NewLC(EPriorityBackground);
360 INFO_PRINTF1(_L("error"));
366 * here we are going to test sequence off methods
369 INFO_PRINTF1(_L("Testing - CULoggerServer::Start method"));
370 TInt e = server->Start();
371 buf.AppendFormat(_L("Code returned from method - %d"), e);
373 INFO_PRINTF1(_L("Testing - CULoggerServer::SetGlobalSecondaryFilters method"));
374 e = server->SetSecondaryFiltering(_L8("current"));
376 buf.AppendFormat(_L("Code returned from method - %d"), e);
378 INFO_PRINTF1(_L("Testing - CULoggerServer::Stop method"));
381 buf.AppendFormat(_L("Code returned from method - %d"), e);
383 CleanupStack::PopAndDestroy(); //server
390 TInt CUloggerServerTest1Step::Test12L()
391 {//CULoggerServer::SetActiveOutputPlugin
393 INFO_PRINTF1(_L("Testing - CULoggerServer::SetActiveOutputPlugin method"));
394 CULoggerServer *server = NULL;
395 server = CULoggerServer::NewLC(EPriorityBackground);
398 INFO_PRINTF1(_L("error"));
403 TInt e = server->SetActiveOutputPlugin(_L8("media1"));
405 buf.AppendFormat(_L("Code returned from method - %d"), e);
407 CleanupStack::PopAndDestroy(); //server
412 TInt CUloggerServerTest1Step::Test13L()
413 {//CULoggerServer::SetOutputPluginSettings
415 INFO_PRINTF1(_L("Testing - CULoggerServer::SetOutputPluginSettings method"));
416 CULoggerServer *server = NULL;
417 server = CULoggerServer::NewLC(EPriorityBackground);
420 INFO_PRINTF1(_L("error"));
425 RArray<TPtrC8> value;
426 value.AppendL(_L8("output_path"));
427 value.AppendL(_L8("c:\\logs\\ulogger.log"));
428 TInt e = server->SetPluginSettings(_L8("media1"),value);// _L8("output_path"), _L8("c:\\logs\\ulogger.log"));
430 buf.AppendFormat(_L("Code returned from method - %d"), e);
432 CleanupStack::PopAndDestroy(); //server
437 TInt CUloggerServerTest1Step::Test14L()
438 {//CULoggerServer::GetActiveOutput
440 INFO_PRINTF1(_L("Testing - CULoggerServer::GetActiveOutputPlugin method"));
441 CULoggerServer *server = NULL;
442 server = CULoggerServer::NewLC(EPriorityBackground);
445 INFO_PRINTF1(_L("error"));
450 RArray<TPtrC8> listBuffer;
451 TInt e = server->GetActiveOutputPlugin(listBuffer);
453 buf.AppendFormat(_L("Code returned from method - %d"), e);
456 if(listBuffer.Count()>0)
458 INFO_PRINTF1(_L("values:"));
459 buf.Copy(listBuffer[0]);
463 CleanupStack::PopAndDestroy(); //server
468 TInt CUloggerServerTest1Step::Test15L()
469 {//CULoggerServer::GetInstalledPlugins
471 INFO_PRINTF1(_L("Testing - CULoggerServer::GetInstalledOutputPlugins method"));
472 CULoggerServer *server = NULL;
473 server = CULoggerServer::NewLC(EPriorityBackground);
476 INFO_PRINTF1(_L("error"));
481 RArray<TPtrC8> listBuffer;
482 TInt e = server->GetInstalledOutputPlugins(listBuffer);
484 buf.AppendFormat(_L("Code returned from method - %d"), e);
487 INFO_PRINTF1(_L("values:"));
488 for(TInt i=0; i<listBuffer.Count(); ++i)
490 buf.Copy(listBuffer[i]);
493 iMediaCount = listBuffer.Count()/2;
495 CleanupStack::PopAndDestroy(); //server
499 TInt CUloggerServerTest1Step::Test16L()
500 {//CULoggerServer::GetOutputPluginSettingsL
502 INFO_PRINTF1(_L("Testing - CULoggerServer::GetOutputPluginSettingsL method"));
503 CULoggerServer *server = NULL;
504 server = CULoggerServer::NewLC(EPriorityBackground);
507 INFO_PRINTF1(_L("error"));
512 for(TInt k=0; k<iMediaCount; k++)
515 mediaBuf.AppendFormat(_L8("media%d"),k+1);
516 RArray<TPtrC8> mediaList;
517 TInt e = server->GetOptionsSettingsL(mediaBuf, mediaList);
519 buf.AppendFormat(_L("Code returned from method - %d"), e);
522 INFO_PRINTF1(_L("values:"));
523 for(TInt i=0; i<mediaList.Count(); ++i)
525 buf.Copy(mediaList[i]);
531 CleanupStack::PopAndDestroy(); //server
538 TInt CUloggerServerTest1Step::Test18L()
539 {//CULoggerServer::SetBufferSizeL
541 INFO_PRINTF1(_L("Testing - CULoggerServer::SetBufferSizeL method"));
542 CULoggerServer *server = NULL;
543 server = CULoggerServer::NewLC(EPriorityBackground);
546 INFO_PRINTF1(_L("error"));
552 INFO_PRINTF1(_L("testing value: -1"));
553 e = server->SetBufferSizeL(-1);
555 buf.AppendFormat(_L("Code returned from method - %d"), e);
559 INFO_PRINTF1(_L("testing value: 0"));
560 e = server->SetBufferSizeL(0);
561 buf.AppendFormat(_L("Code returned from method - %d"), e);
565 INFO_PRINTF1(_L("testing value: 100"));
566 e = server->SetBufferSizeL(100);
567 buf.AppendFormat(_L("Code returned from method - %d"), e);
571 INFO_PRINTF1(_L("testing value: 65535"));
572 e = server->SetBufferSizeL(65535);
573 buf.AppendFormat(_L("Code returned from method - %d"), e);
577 INFO_PRINTF1(_L("testing value: 65536"));
578 e = server->SetBufferSizeL(65536);
579 buf.AppendFormat(_L("Code returned from method - %d"), e);
583 INFO_PRINTF1(_L("testing value: 165537"));
584 e = server->SetBufferSizeL(165537);
585 buf.AppendFormat(_L("Code returned from method - %d"), e);
588 CleanupStack::PopAndDestroy(); //server
594 TInt CUloggerServerTest1Step::Test19L()
595 {//CULoggerServer::SetDataNotificationSizeL
597 INFO_PRINTF1(_L("Testing - CULoggerServer::SetDataNotificationSizeL method"));
598 CULoggerServer *server = NULL;
599 server = CULoggerServer::NewLC(EPriorityBackground);
602 INFO_PRINTF1(_L("error"));
608 INFO_PRINTF1(_L("testing value: -1"));
609 e = server->SetDataNotificationSizeL(-1);
611 buf.AppendFormat(_L("Code returned from method - %d"), e);
615 INFO_PRINTF1(_L("testing value: 0"));
616 e = server->SetDataNotificationSizeL(0);
617 buf.AppendFormat(_L("Code returned from method - %d"), e);
621 INFO_PRINTF1(_L("testing value: 100"));
622 e = server->SetDataNotificationSizeL(100);
623 buf.AppendFormat(_L("Code returned from method - %d"), e);
627 INFO_PRINTF1(_L("testing value: 65535"));
628 e = server->SetDataNotificationSizeL(65535);
629 buf.AppendFormat(_L("Code returned from method - %d"), e);
633 INFO_PRINTF1(_L("testing value: 65536"));
634 e = server->SetDataNotificationSizeL(65536);
635 buf.AppendFormat(_L("Code returned from method - %d"), e);
639 INFO_PRINTF1(_L("testing value: 85536"));
640 e = server->SetDataNotificationSizeL(85536);
641 buf.AppendFormat(_L("Code returned from method - %d"), e);
645 INFO_PRINTF1(_L("testing value: 165538"));
646 e = server->SetDataNotificationSizeL(165538);
647 buf.AppendFormat(_L("Code returned from method - %d"), e);
650 CleanupStack::PopAndDestroy(); //server
656 TInt CUloggerServerTest1Step::Test20L()
657 {//CULoggerServer::GetBufferSize
659 INFO_PRINTF1(_L("Testing - CULoggerServer::GetBufferSize method"));
660 CULoggerServer *server = NULL;
661 server = CULoggerServer::NewLC(EPriorityBackground);
664 INFO_PRINTF1(_L("error"));
670 INFO_PRINTF1(_L("testing value: -1"));
671 server->GetBufandDataNotifyValuesL(KBuffer,e);
673 buf.AppendFormat(_L("Value - %d"), e);
676 CleanupStack::PopAndDestroy(); //server
682 TInt CUloggerServerTest1Step::Test21L()
683 {// CULoggerServer::GetDataNotificationSize
685 INFO_PRINTF1(_L("Testing - CULoggerServer::GetDataNotificationSize method"));
686 CULoggerServer *server = NULL;
687 server = CULoggerServer::NewLC(EPriorityBackground);
690 INFO_PRINTF1(_L("error"));
696 INFO_PRINTF1(_L("testing value: -1"));
697 server->GetBufandDataNotifyValuesL(KDataNotification,e);
699 buf.AppendFormat(_L("Value - %d"), e);
702 CleanupStack::PopAndDestroy(); //server
707 TInt CUloggerServerTest1Step::Test22L()
708 {//CULoggerServer::SetGlobalSecondaryFilters
710 INFO_PRINTF1(_L("Testing - CULoggerServer::SetSecondaryFiltering method"));
711 CULoggerServer *server = NULL;
712 server = CULoggerServer::NewLC(EPriorityBackground);
715 INFO_PRINTF1(_L("error"));
720 _LIT8(KEnable,"enable");
721 _LIT8(KDisable,"disable");
727 e = server->SetSecondaryFiltering(KEnable);
728 buf.AppendFormat(_L("Code returned from method - %d"), e);
735 e = server->SetSecondaryFiltering(KDisable);
736 buf.AppendFormat(_L("Code returned from method - %d"), e);
739 CleanupStack::PopAndDestroy(); //server
744 TInt CUloggerServerTest1Step::Test23L()
745 {//CULoggerServer::ReadBufferL
747 INFO_PRINTF1(_L("Testing - CULoggerServer::ReadBufferL method"));
748 CULoggerServer *server = NULL;
749 server = CULoggerServer::NewLC(EPriorityBackground);
752 INFO_PRINTF1(_L("error"));
758 TRAPD(err, server->ReadBufferL());
759 buf.AppendFormat(_L("Results of calling method - %d"), err);
762 CleanupStack::PopAndDestroy(); //server
767 TInt CUloggerServerTest1Step::Test24L()
768 {//CULoggerServer::DataNotification
770 INFO_PRINTF1(_L("Testing - CULoggerServer::DataNotification method"));
771 CULoggerServer *server = NULL;
772 server = CULoggerServer::NewLC(EPriorityBackground);
775 INFO_PRINTF1(_L("error"));
780 server->DataNotification();
781 INFO_PRINTF1(_L("OK"));
782 CleanupStack::PopAndDestroy(); //server
788 TInt CUloggerServerTest1Step::Test25L()
789 {//CULoggerServer::SetBufferMode
791 INFO_PRINTF1(_L("Testing - CULoggerServer::SetGlobalSecondaryFilters method"));
792 CULoggerServer *server = NULL;
793 server = CULoggerServer::NewLC(EPriorityBackground);
796 INFO_PRINTF1(_L("error"));
801 _LIT8(KCircular,"circular");
802 _LIT8(KStraight,"straight");
808 e = server->SetBufferMode(KCircular);
809 buf.AppendFormat(_L("Code returned from method - %d"), e);
816 e = server->SetBufferMode(KStraight);
817 buf.AppendFormat(_L("Code returned from method - %d"), e);
820 CleanupStack::PopAndDestroy(); //server
825 TInt CUloggerServerTest1Step::Test26L() //CULoggerServer::UnconfigureCurrentChannel
828 INFO_PRINTF1(_L("Testing - CULoggerServer::UnconfigureCurrentChannel method"));
829 /* //removed - method isn't used anywhere
830 CULoggerServer *server = NULL;
831 server = CULoggerServer::NewLC(EPriorityBackground);
834 INFO_PRINTF1(_L("error"));
839 server->UnconfigureCurrentChannel();
840 CleanupStack::PopAndDestroy(); //server
847 TInt CUloggerServerTest1Step::Test27L()//CULoggerServer::DoPostProcessing
850 INFO_PRINTF1(_L("Testing - CULoggerServer::DoPostProcessing method"));
851 CULoggerServer *server = NULL;
852 server = CULoggerServer::NewLC(EPriorityBackground);
855 INFO_PRINTF1(_L("error"));
860 INFO_PRINTF1(_L("DoPostProcessing(EUnknown)"));
861 server->DoPostProcessing(EUnknown);
862 INFO_PRINTF1(_L("DoPostProcessing(ERestart)"));
863 server->DoPostProcessing(ERestart);
864 INFO_PRINTF1(_L("DoPostProcessing(EStop)"));
865 server->DoPostProcessing(EStop);
867 CleanupStack::PopAndDestroy(); //server
873 TInt CUloggerServerTest1Step::Test28L()//CULoggerServer::RemoveOutputPluginSettingsL
876 INFO_PRINTF1(_L("Testing - CULoggerServer::RemoveOutputPluginSettingsL method"));
877 CULoggerServer *server = NULL;
878 server = CULoggerServer::NewLC(EPriorityBackground);
881 INFO_PRINTF1(_L("error"));
886 TInt errCode = KErrNone;
888 set.AppendL(_L8("testKey"));
889 set.AppendL(_L8("testVal"));
890 errCode = server->SetPluginSettings(_L8("uloggerserialplugin"), set);
892 if(errCode != KErrNone)
894 INFO_PRINTF1(_L("error"));
895 CleanupStack::PopAndDestroy(); //server
899 INFO_PRINTF1(_L("RemoveOutputPluginSettingsL - uloggerserialplugin)"));
900 errCode = server->RemovePluginSettingsL(_L8("uloggerserialplugin"));
901 if(errCode != KErrNone)
903 INFO_PRINTF1(_L("error"));
904 CleanupStack::PopAndDestroy(); //server
908 INFO_PRINTF1(_L("RemoveOutputPluginSettingsL - dummyname)"));
909 server->RemovePluginSettingsL(_L8("dummyname"));
911 CleanupStack::PopAndDestroy(); //server
917 TInt CUloggerServerTest1Step::Test29L()//CULoggerServer::GetInstalledInputPluginsL
920 INFO_PRINTF1(_L("Testing - CULoggerServer::GetInstalledInputPluginsL method"));
921 CULoggerServer *server = NULL;
922 server = CULoggerServer::NewLC(EPriorityBackground);
925 INFO_PRINTF1(_L("error"));
931 server->GetInstalledInputPluginsL(list);
933 CleanupStack::PopAndDestroy(); //server
939 TInt CUloggerServerTest1Step::Test30L()//CULoggerServer::SetActiveInputPlugin + DeActivateInputPlugin
942 INFO_PRINTF1(_L("Testing - CULoggerServer::SetActiveInputPlugin + DeActivateInputPlugin methods"));
943 CULoggerServer *server = NULL;
944 server = CULoggerServer::NewLC(EPriorityBackground);
946 _LIT8(KUsbPlugin,"uloggerusbplugin");
947 server->DeActivateInputPlugin(KUsbPlugin);
948 TInt errCode = server->SetActiveInputPlugin(KUsbPlugin);
949 if(errCode != KErrNone && errCode != KErrNotFound)
951 INFO_PRINTF1(_L("error"));
954 errCode = server->SetActiveInputPlugin(KUsbPlugin);
956 errCode = server->DeActivateInputPlugin(KUsbPlugin);
958 b.AppendFormat(_L("err1 %d"), errCode);
960 if(errCode != KErrNone && errCode != KErrNotFound)
962 INFO_PRINTF1(_L("error"));
965 errCode = server->DeActivateInputPlugin(KUsbPlugin);
967 b.AppendFormat(_L("err2 %d"), errCode);
969 if(errCode != KErrNone && errCode != KErrNotFound && errCode != KErrAlreadyExists)
971 INFO_PRINTF1(_L("error"));
976 CleanupStack::PopAndDestroy(); //server
977 User::After(1*1000*1000);
982 TInt CUloggerServerTest1Step::Test31L()//CULoggerServer::ProcessCommandL ver1
985 INFO_PRINTF1(_L("Testing - CULoggerServer::ProcessCommandL method"));
986 CULoggerServer *server = NULL;
987 server = CULoggerServer::NewLC(EPriorityBackground);
989 RArray<TPtrC8> arguments;
990 //test all commands with empty array of arguments
991 for(TInt i=0; i<=EVersion; i++)
994 buf.AppendFormat(_L("command number: %d"), i);
996 ControlData *cd = server->ProcessCommandL((TCommand)i, arguments);
1006 CleanupStack::PopAndDestroy(); //server