1#ifndef __beos_test_utils_h__
2#define __beos_test_utils_h__
3
4#include <string>
5#include <SupportDefs.h>
6
7#include <cppunit/Portability.h>
8
9// Handy defines :-)
10#define CHK CPPUNIT_ASSERT
11#define RES DecodeResult
12
13// Prints out a description of the given status_t
14// return code to standard out. Helpful for figuring
15// out just what the R5 libraries are returning.
16// Returns the same value passed in, so you can
17// use it inline in tests if necessary.
18extern CPPUNIT_API status_t DecodeResult(status_t result);
19
20// First parameter is equal to the second or third
21template<typename A, typename B, typename C>
22static
23inline
24bool
25Equals(const A &a, const B &b, const C &c)
26{
27	return (a == b || a == c);
28}
29
30// Returns a string version of the given integer
31extern CPPUNIT_API std::string IntToStr(int i);
32
33// Calls system() with the concatenated string of command and parameter.
34extern CPPUNIT_API void ExecCommand(const char *command, const char *parameter);
35
36// Calls system() with the concatenated string of command, parameter1,
37// " " and parameter2.
38extern CPPUNIT_API void ExecCommand(const char *command, const char *parameter1,
39									const char *parameter2);
40
41// Calls system() with the given command (kind of silly, but it's consistent :-)
42extern CPPUNIT_API void ExecCommand(const char *command);
43
44#endif	// __beos_test_utils_h__
45