#ifndef PHSTBIPC_TESTCOMMON_H    /* Multi-include protection.   <FILENAME>_H */
#define PHSTBIPC_TESTCOMMON_H


/*****************************************************************************/
/* Copyright (c) 2009 NXP B.V.  All rights are reserved.                     */
/*                                                                           */
/* Redistribution and use in source and binary forms, with or without        */
/* modification, are permitted provided that the following conditions        */
/* are met:                                                                  */
/*                                                                           */
/* Redistributions of source code must retain the above copyright            */
/* notice, this list of conditions and the following disclaimer.             */
/*                                                                           */
/* Redistributions in binary form must reproduce the above copyright         */
/* notice, this list of conditions and the following disclaimer in the       */
/* documentation and/or other materials provided with the distribution.      */
/*                                                                           */
/* Neither the name of NXP nor the names of its                              */
/* contributors may be used to endorse or promote products derived from      */
/* this software without specific prior written permission.                  */
/*                                                                           */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS       */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT         */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR     */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT      */
/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,     */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT          */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,     */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY     */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT       */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE         */
/* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH          */
/* DAMAGE.                                                                   */
/*                                                                           */
/*****************************************************************************/
/**
    @file   phStbIpc_TestCommon.h
    @brief  Test setup definitions for phStbIpc Client and Server test.

@b  Component:  phStbIpc

*//*

Rev Date       Author      Comments
--------------------------------------------------------------------------------
  1 20061004   batelaan    Initial
  2 20061010   batelaan    Add CHECK macro.
  3 20070102   batelaan    Port to work in kernel mode, too.
                           Change default server address for the real audio mips.
  4 20070209   batelaan    Add CHECKSTATEMENT macro.
  5 20080326   batelaan    Use more client/server flexible addressing.
  6 20080408   batelaan    Use phStbIpc_Services.h
  7 20090121   batelaan    Update license header
--------------------------------------------------------------------------------
    For consistency and standardisation retain the Section Separators.
*/


/*******************
* INCLUDE FILES    *
********************/

#include <tmNxTypes.h>
#include <tmNxCompId.h>
#include "phStbIpc_Services.h"

#ifdef __cplusplus
extern "C"
{
#endif

/**************************************************************************
* EXPORTED MACROS                          PH_STBIPC_<_WORD>+             *
***************************************************************************/

#define PH_STBIPC_TEST_HANDSHAKE "handshake"
#define PH_STBIPC_TEST_SERVER_ADDRESS PH_STBIPC_UNITTEST_SERVER_ADDRESS

#ifdef __KERNEL__
  #define PRINT printk
#else
  #define PRINT printf
#endif

#define CHECK(expr, expected) {                 \
        tmErrorCode_t _err; \
        PRINT("\n  %s\n", #expr); \
        _err = (expr); \
        if (_err != (expected)) { \
            PRINT("ERROR (0x%x - expected 0x%x): %s\n", _err, (unsigned int)(expected), #expr); \
            goto DEPARTURES; \
        } \
    }

#define CHECKSTATEMENT(stmt, check) {                 \
        PRINT("\n  %s\n", #stmt); \
        stmt; \
        if (!(check)) { \
            PRINT("ERROR check fails: %s\n", #check); \
            goto DEPARTURES; \
        } \
    }

/*********************************************************************
* EXPORTED TYPEDEFS                      [p]phStbIpc_<Word>+_t       *
**********************************************************************/

/**************************************************************************
* EXPORTED DATA                     g[k|p|kp|pk|kpk]phStbIpc_<Word>+      *
***************************************************************************/

/****************************************************************************
* EXPORTED FUNCTION PROTOTYPES                    phStbIpc[_<Word>+]        *
*****************************************************************************/


/******************************************************************************/
#ifdef __cplusplus
}
#endif

#endif /* PHSTBIPC_TESTCOMMON_H      Do not add any thing below this line */
