vfs: check userland buffers before reading them.
[haiku.git] / headers / tools / cppunit / TestUtils.h
blobb905d095044d397d40fcc463b0a9f82635c20508
1 #ifndef __beos_test_utils_h__
2 #define __beos_test_utils_h__
4 #include <string>
5 #include <SupportDefs.h>
7 #include <cppunit/Portability.h>
9 // Handy defines :-)
10 #define CHK CPPUNIT_ASSERT
11 #define RES DecodeResult
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.
18 extern CPPUNIT_API status_t DecodeResult(status_t result);
20 // First parameter is equal to the second or third
21 template<typename A, typename B, typename C>
22 static
23 inline
24 bool
25 Equals(const A &a, const B &b, const C &c)
27 return (a == b || a == c);
30 // Returns a string version of the given integer
31 extern CPPUNIT_API std::string IntToStr(int i);
33 // Calls system() with the concatenated string of command and parameter.
34 extern CPPUNIT_API void ExecCommand(const char *command, const char *parameter);
36 // Calls system() with the concatenated string of command, parameter1,
37 // " " and parameter2.
38 extern CPPUNIT_API void ExecCommand(const char *command, const char *parameter1,
39 const char *parameter2);
41 // Calls system() with the given command (kind of silly, but it's consistent :-)
42 extern CPPUNIT_API void ExecCommand(const char *command);
44 #endif // __beos_test_utils_h__