2002-07-18 05:03:19 +04:00
|
|
|
#ifndef __beos_test_utils_h__
|
|
|
|
#define __beos_test_utils_h__
|
2002-07-11 07:28:37 +04:00
|
|
|
|
2002-07-18 05:03:19 +04:00
|
|
|
#include <string>
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
2004-02-19 00:38:04 +03:00
|
|
|
#include <cppunit/Portability.h>
|
|
|
|
|
2002-07-18 05:03:19 +04:00
|
|
|
// Handy defines :-)
|
2002-07-11 07:28:37 +04:00
|
|
|
#define CHK CPPUNIT_ASSERT
|
|
|
|
#define RES DecodeResult
|
|
|
|
|
2002-07-18 05:03:19 +04:00
|
|
|
// Prints out a description of the given status_t
|
|
|
|
// return code to standard out. Helpful for figuring
|
|
|
|
// out just what the R5 libraries are returning.
|
|
|
|
// Returns the same value passed in, so you can
|
|
|
|
// use it inline in tests if necessary.
|
2004-02-19 00:38:04 +03:00
|
|
|
extern CPPUNIT_API status_t DecodeResult(status_t result);
|
2002-07-18 05:03:19 +04:00
|
|
|
|
2002-07-24 13:30:20 +04:00
|
|
|
// First parameter is equal to the second or third
|
|
|
|
template<typename A, typename B, typename C>
|
|
|
|
static
|
|
|
|
inline
|
|
|
|
bool
|
|
|
|
Equals(const A &a, const B &b, const C &c)
|
|
|
|
{
|
|
|
|
return (a == b || a == c);
|
|
|
|
}
|
|
|
|
|
2002-07-19 10:45:28 +04:00
|
|
|
// Returns a string version of the given integer
|
2004-02-19 00:38:04 +03:00
|
|
|
extern CPPUNIT_API string IntToStr(int i);
|
2002-07-19 10:45:28 +04:00
|
|
|
|
2002-07-18 05:03:19 +04:00
|
|
|
// Calls system() with the concatenated string of command and parameter.
|
2004-02-19 00:38:04 +03:00
|
|
|
extern CPPUNIT_API void ExecCommand(const char *command, const char *parameter);
|
2002-07-18 05:03:19 +04:00
|
|
|
|
|
|
|
// Calls system() with the concatenated string of command, parameter1,
|
|
|
|
// " " and parameter2.
|
2004-02-19 00:38:04 +03:00
|
|
|
extern CPPUNIT_API void ExecCommand(const char *command, const char *parameter1,
|
|
|
|
const char *parameter2);
|
2002-07-18 05:03:19 +04:00
|
|
|
|
|
|
|
// Calls system() with the given command (kind of silly, but it's consistent :-)
|
2004-02-19 00:38:04 +03:00
|
|
|
extern CPPUNIT_API void ExecCommand(const char *command);
|
2002-07-18 05:03:19 +04:00
|
|
|
|
|
|
|
#endif // __beos_test_utils_h__
|