commonappservices/alarmserver/Test/ASTstAlarmTest.h
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 // Copyright (c) 1997-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __ASTSTALARMTESTSTD_H__
       
    17 #define __ASTSTALARMTESTSTD_H__
       
    18 
       
    19 // System includes
       
    20 #include <e32test.h>
       
    21 
       
    22 // User includes
       
    23 #include <asshdalarm.h>
       
    24 #include <asclisession.h>
       
    25 #include <consolealarmalertservermain.h>
       
    26 
       
    27 // Literal constants
       
    28 _LIT(KAlarmTestCodeTitle, "AlarmServerTestCode");
       
    29 
       
    30 // Constants
       
    31 const TInt KTimeToWait = 1000000;
       
    32 
       
    33 class ASTstAlarmTest
       
    34 	{
       
    35 public:
       
    36 	/**
       
    37 	 *
       
    38 	 */
       
    39 	IMPORT_C ASTstAlarmTest();
       
    40 
       
    41 	/**
       
    42 	 *
       
    43 	 */
       
    44 	IMPORT_C static void Close();
       
    45 
       
    46 	/**
       
    47 	 *
       
    48 	 */
       
    49 	IMPORT_C static ASTstAlarmTest& Self();
       
    50 
       
    51 public:
       
    52 	/**
       
    53 	 *
       
    54 	 */
       
    55 	IMPORT_C void	operator()(TInt aResult, TInt aLineNum, const TText* aFileName);
       
    56 	
       
    57 	/**
       
    58 	 *
       
    59 	 */
       
    60 	IMPORT_C void	operator()(TInt aResult, TInt aLineNum);
       
    61 
       
    62 	/**
       
    63 	 *
       
    64 	 */
       
    65 	IMPORT_C void	operator()(TInt aResult);
       
    66 
       
    67 	/**
       
    68 	 *
       
    69 	 */
       
    70 	IMPORT_C void	Title();
       
    71 
       
    72 	/**
       
    73 	 *
       
    74 	 */
       
    75 	IMPORT_C void	Start(const TDesC& aHeading);
       
    76 
       
    77 	/**
       
    78 	 *
       
    79 	 */
       
    80 	IMPORT_C void	Next(const TDesC& aHeading);
       
    81 
       
    82 	/**
       
    83 	 *
       
    84 	 */
       
    85 	IMPORT_C void	EndL();
       
    86 
       
    87 	/**
       
    88 	 *
       
    89 	 */
       
    90 	IMPORT_C void	UpLevel();
       
    91 
       
    92 public:
       
    93 	/**
       
    94 	 *
       
    95 	 */
       
    96 	IMPORT_C void	TestClearStoreL();
       
    97 
       
    98 	/**
       
    99 	 *
       
   100 	 */
       
   101 	IMPORT_C void	WaitForNotificationBufferToBeEmptied(TRequestStatus& aStatus, TAlarmId& aAlarmId);
       
   102 
       
   103 	/**
       
   104 	 *
       
   105 	 */
       
   106 	IMPORT_C void	WaitForEvent(TInt aEvent, TRequestStatus& aStatus, TAlarmId& aAlarmId);
       
   107 
       
   108 	/**
       
   109 	 *
       
   110 	 */
       
   111 	IMPORT_C void	TestEventBuffer(TInt aExpected, TRequestStatus& aStatus, TAlarmId& aAlarmId);
       
   112 
       
   113 	/**
       
   114 	 *
       
   115 	 */
       
   116 	IMPORT_C TInt	CountOrphanedAlarmsL();
       
   117 
       
   118 	/**
       
   119 	 *
       
   120 	 */
       
   121 	IMPORT_C void	TestStartServers(TAny * instructionSet = NULL);
       
   122 
       
   123 public:
       
   124 
       
   125 	/**
       
   126 	 *
       
   127 	 */
       
   128 	inline RTest& Test() { return iTest; }
       
   129 
       
   130 	/**
       
   131 	 *
       
   132 	 */
       
   133 	inline RASCliSession& Session() { return iAlarmServer; }
       
   134 
       
   135 private:
       
   136 	void resetHomeTimeL();
       
   137 
       
   138 	/**
       
   139 	 *
       
   140 	 */
       
   141 	RTest			iTest;
       
   142 
       
   143 	/**
       
   144 	 *
       
   145 	 */
       
   146 	RASCliSession	iAlarmServer;
       
   147 	TTime			iInitialHomeTime;
       
   148 	};
       
   149 
       
   150 // Defines
       
   151 #define TheAlarmTest ASTstAlarmTest::Self()
       
   152 #define AlarmTest(_OUTCOME) ASTstAlarmTest::Self()(_OUTCOME,__LINE__)
       
   153 
       
   154 #endif