mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testmpxmessagequeue.cpp
changeset 0 a2952bb97e68
child 1 7f2202662322
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     1 /*
       
     2 * Copyright (c) 2002 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 "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: MPXMessageQueue testing implementation (mpxmessagequeue.h)
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <s32mem.h>
       
    20 
       
    21 #include "commontestclass.h"
       
    22 
       
    23 // Begin CMPXMessageQueue testing implementation (mpxmessagequeue.h)=======================================
       
    24 // -----------------------------------------------------------------------------
       
    25 // CCommonTestClass::CreateCMPXMessageQueueL()
       
    26 // Returns: Symbian OS errors.
       
    27 // -----------------------------------------------------------------------------
       
    28 TInt CCommonTestClass::CreateCMPXMessageQueueL()
       
    29     {
       
    30 	FTRACE(FPrint(_L("CCommonTestClass::CreateCMPXMessageQueueL testing CMPXMessageQueue::NewL begin")));
       
    31     iLog->Log(_L("CCommonTestClass::CreateCMPXMessageQueueL testing CMPXMessageQueue::NewL begin"));
       
    32     TInt err = KErrNone;
       
    33     if ( iMessageQueue != NULL)
       
    34         {
       
    35         delete iMessageQueue;
       
    36         }
       
    37     iMessageQueue = NULL;
       
    38     iMessageQueue = CMPXMessageQueue::NewL();
       
    39     if ( iMessageQueue == NULL)
       
    40         {
       
    41         err = KErrNotFound;
       
    42         }
       
    43 	FTRACE(FPrint(_L("CCommonTestClass::CreateCMPXMessageQueueL testing CMPXMessageQueue::NewL end err=%d"), err));
       
    44     iLog->Log(_L("CCommonTestClass::CreateCMPXMessageQueueL testing CMPXMessageQueue::NewL end err=%d"), err);
       
    45 	return err;
       
    46     }
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 // CCommonTestClass::DeleteCMPXMessageQueue()
       
    50 // Returns: Symbian OS errors.
       
    51 // -----------------------------------------------------------------------------
       
    52 TInt CCommonTestClass::DeleteCMPXMessageQueue()
       
    53     {
       
    54 	FTRACE(FPrint(_L("CCommonTestClass::DeleteCMPXMessageQueue testing CMPXMessageQueue::~ begin")));
       
    55     iLog->Log(_L("CCommonTestClass::DeleteCMPXMessageQueue testing CMPXMessageQueue::~ begin"));
       
    56     TInt err = KErrNone;
       
    57     delete iMessageQueue;
       
    58     iMessageQueue = NULL;
       
    59 	FTRACE(FPrint(_L("CCommonTestClass::DeleteCMPXMessageQueue testing CMPXMessageQueue::~ end err=%d"), err));
       
    60     iLog->Log(_L("CCommonTestClass::DeleteCMPXMessageQueue testing CMPXMessageQueue::~ end err=%d"), err);
       
    61 	return err;
       
    62     }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CCommonTestClass::ResetCMPXMessageQueue()
       
    66 // Returns: Symbian OS errors.
       
    67 // -----------------------------------------------------------------------------
       
    68 TInt CCommonTestClass::ResetCMPXMessageQueue()
       
    69     {
       
    70 	FTRACE(FPrint(_L("CCommonTestClass::ResetCMPXMessageQueue testing CMPXMessageQueue::Reset~ begin")));
       
    71     iLog->Log(_L("CCommonTestClass::ResetCMPXMessageQueue testing CMPXMessageQueue::Reset begin"));
       
    72     TInt err = KErrNone;
       
    73     iMessageQueue->Reset();
       
    74 	FTRACE(FPrint(_L("CCommonTestClass::ResetCMPXMessageQueue testing CMPXMessageQueue::Reset end err=%d"), err));
       
    75     iLog->Log(_L("CCommonTestClass::ResetCMPXMessageQueue testing CMPXMessageQueue::Reset end err=%d"), err);
       
    76 	return err;
       
    77     }
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CCommonTestClass::SendNextCMPXMessageQueue()
       
    81 // Returns: Symbian OS errors.
       
    82 // -----------------------------------------------------------------------------
       
    83 TInt CCommonTestClass::SendNextCMPXMessageQueue()
       
    84     {
       
    85 	FTRACE(FPrint(_L("CCommonTestClass::SendNextCMPXMessageQueue testing CMPXMessageQueue::SendNext begin")));
       
    86     iLog->Log(_L("CCommonTestClass::SendNextCMPXMessageQueue testing CMPXMessageQueue::SendNext begin"));
       
    87     TInt err = KErrNone;
       
    88     RMessage2 message;
       
    89     iMessageQueue->SendNext(message);    
       
    90 	FTRACE(FPrint(_L("CCommonTestClass::SendNextCMPXMessageQueue testing CMPXMessageQueue::SendNext end err=%d"), err));
       
    91     iLog->Log(_L("CCommonTestClass::SendNextCMPXMessageQueue testing CMPXMessageQueue::SendNext end err=%d"), err);
       
    92 	return err;
       
    93     }
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CCommonTestClass::AddCMPXMessageQueue()
       
    97 // Returns: Symbian OS errors.
       
    98 // -----------------------------------------------------------------------------
       
    99 TInt CCommonTestClass::AddCMPXMessageQueue()
       
   100     {
       
   101 	FTRACE(FPrint(_L("CCommonTestClass::AddCMPXMessageQueue testing CMPXMessageQueue::Add begin")));
       
   102     iLog->Log(_L("CCommonTestClass::AddCMPXMessageQueue testing CMPXMessageQueue::Add begin"));
       
   103     TInt err = KErrNone;
       
   104     CMPXMessage *message;
       
   105     TRAP(err , message = CMPXMessage::NewL());
       
   106     iMessageQueue->Add(message, err);
       
   107     delete message;
       
   108 	FTRACE(FPrint(_L("CCommonTestClass::AddCMPXMessageQueue testing CMPXMessageQueue::Add end err=%d"), err));
       
   109     iLog->Log(_L("CCommonTestClass::AddCMPXMessageQueue testing CMPXMessageQueue::Add end err=%d"), err);
       
   110 	return err;
       
   111     }
       
   112 
       
   113 
       
   114 // end of CMPXMessageQueue (mpxmessagequeue.h) =============================================
       
   115 
       
   116