@@ -41,16 +41,19 @@ TEST_MEMBER_FUNCTION(MyString, SetSize, size_t)
4141#define TEST_SETUP_TEARDOWN (Type, is_setup, class_name ) \
4242 class TestSetupTeardownFunctor_ ##Type##_##class_name : public ocl::TestSetupTeardownFunctor \
4343 { \
44+ private: \
45+ TestSetupTeardownFunctor_##Type##_##class_name(TestSetupTeardownFunctor_##Type##_##class_name const &) : \
46+ TestSetupTeardownFunctor_##Type##_##class_name& operator =(TestSetupTeardownFunctor_##Type##_##class_name const &) : \
4447 public: \
45- TestSetupTeardownFunctor_##Type##_##class_name(char const * name = #class_name) : \
46- ocl::TestSetupTeardownFunctor (name, is_setup) \
47- { \
48- if (IsSetup ()) \
49- ocl::TestClass::SetSetup (*this ); \
50- else \
51- ocl::TestClass::SetTeardown (*this ); \
52- } \
53- void Execute (); \
48+ TestSetupTeardownFunctor_##Type##_##class_name(char const * name = #class_name) : \
49+ ocl::TestSetupTeardownFunctor (name, is_setup) \
50+ { \
51+ if (IsSetup ()) \
52+ ocl::TestClass::SetSetup (*this ); \
53+ else \
54+ ocl::TestClass::SetTeardown (*this ); \
55+ } \
56+ void Execute (); \
5457 } TestSetupTeardownFunctor_##Type##_##class_name##_instance; \
5558 void TestSetupTeardownFunctor_##Type##_##class_name::Execute()
5659
@@ -62,7 +65,11 @@ TEST_MEMBER_FUNCTION(MyString, SetSize, size_t)
6265#define TEST (name ) \
6366class TestGeneral_ ##name : public ocl::TestClass \
6467{ \
65- public: TestGeneral_##name(); \
68+ private: \
69+ TestGeneral_##name(TestGeneral_##name const &); \
70+ TestGeneral_##name& operator =(TestGeneral_##name const &); \
71+ public: \
72+ TestGeneral_##name(); \
6673} g_TestGeneral_##name; \
6774TestGeneral_##name::TestGeneral_##name() \
6875 : ocl::TestClass(#name, " " , " " )
@@ -74,7 +81,11 @@ TestGeneral_##name::TestGeneral_##name() \
7481#define TEST_FUNCTION (function_name, args ) \
7582class Test_ ##function_name##_##args : public ocl::TestClass \
7683{ \
77- public: Test_##function_name##_##args(); \
84+ private: \
85+ Test_##function_name##_##args(Test_##function_name##_##args const &); \
86+ Test_##function_name##_##args& operator =(Test_##function_name##_##args const &); \
87+ public: \
88+ Test_##function_name##_##args(); \
7889} g_Test_##function_name##_##args; \
7990Test_##function_name##_##args::Test_##function_name##_##args() \
8091 : ocl::TestClass(" " , #function_name, #args)
@@ -86,7 +97,11 @@ Test_##function_name##_##args::Test_##function_name##_##args() \
8697#define TEST_FUNCTION_TIME (function_name, args, secs, millisecs ) \
8798class TimedTest_ ##function_name##_##args : public ocl::TestClass \
8899{ \
89- public: TimedTest_##function_name##_##args(); \
100+ private: \
101+ TimedTest_##function_name##_##args(TimedTest_##function_name##_##args const &); \
102+ TimedTest_##function_name##_##args& operator =(TimedTest_##function_name##_##args const &); \
103+ public: \
104+ TimedTest_##function_name##_##args(); \
90105} g_TimedTest_##function_name##_##args; \
91106TimedTest_##function_name##_##args::TimedTest_##function_name##_##args() \
92107 : ocl::TestClass(" " , #function_name, #args, false , true , secs, millisecs * ocl::TestTime::MICROSECONDS_PER_SECOND)
@@ -98,7 +113,11 @@ TimedTest_##function_name##_##args::TimedTest_##function_name##_##args() \
98113#define TEST_MEMBER_FUNCTION (class_name, function_name, args ) \
99114class Test_ ##class_name##_##function_name##_##args : public ocl::TestClass \
100115{ \
101- public: Test_##class_name##_##function_name##_##args(); \
116+ private: \
117+ Test_##class_name##_##function_name##_##args(Test_##class_name##_##function_name##_##args const &); \
118+ Test_##class_name##_##function_name##_##args& operator =(Test_##class_name##_##function_name##_##args const &); \
119+ public: \
120+ Test_##class_name##_##function_name##_##args(); \
102121} g_Test_##class_name##_##function_name##_##args; \
103122Test_##class_name##_##function_name##_##args::Test_##class_name##_##function_name##_##args() \
104123 : ocl::TestClass(#class_name, #function_name, #args)
@@ -110,7 +129,11 @@ Test_##class_name##_##function_name##_##args::Test_##class_name##_##function_nam
110129#define TEST_MEMBER_FUNCTION_TIME (class_name, function_name, args, secs, millisecs ) \
111130class TimedTest_ ##class_name##_##function_name##_##args : public ocl::TestClass \
112131{ \
113- public: TimedTest_##class_name##_##function_name##_##args(); \
132+ private: \
133+ TimedTest_##class_name##_##function_name##_##args(TimedTest_##class_name##_##function_name##_##args const &); \
134+ TimedTest_##class_name##_##function_name##_##args& operator =(TimedTest_##class_name##_##function_name##_##args const &); \
135+ public: \
136+ TimedTest_##class_name##_##function_name##_##args(); \
114137} g_TimedTest_##class_name##_##function_name##_##args; \
115138TimedTest_##class_name##_##function_name##_##args::TimedTest_##class_name##_##function_name##_##args() \
116139 : ocl::TestClass(#class_name, #function_name, #args, false , true , secs, millisecs * ocl::TestTime::MICROSECONDS_PER_SECOND)
@@ -122,7 +145,11 @@ TimedTest_##class_name##_##function_name##_##args::TimedTest_##class_name##_##fu
122145#define TEST_CONST_MEMBER_FUNCTION (class_name, function_name, args ) \
123146class Test_ ##class_name##_##function_name##_##args##_const : public ocl::TestClass \
124147{ \
125- public: Test_##class_name##_##function_name##_##args##_const(); \
148+ private: \
149+ Test_##class_name##_##function_name##_##args##_const(Test_##class_name##_##function_name##_##args##_const const &); \
150+ Test_##class_name##_##function_name##_##args##_const& operator =(Test_##class_name##_##function_name##_##args##_const const &); \
151+ public: \
152+ Test_##class_name##_##function_name##_##args##_const(); \
126153} g_Test_##class_name##_##function_name##_##args##_const; \
127154Test_##class_name##_##function_name##_##args##_const::Test_##class_name##_##function_name##_##args##_const() \
128155 : ocl::TestClass(#class_name, #function_name, #args, true )
@@ -134,7 +161,11 @@ Test_##class_name##_##function_name##_##args##_const::Test_##class_name##_##func
134161#define TEST_CONST_MEMBER_FUNCTION_TIME (class_name, function_name, args, secs, millisecs ) \
135162class TimedTest_ ##class_name##_##function_name##_##args##_const : public ocl::TestClass \
136163{ \
137- public: TimedTest_##class_name##_##function_name##_##args##_const(); \
164+ private: \
165+ TimedTest_##class_name##_##function_name##_##args##_const(TimedTest_##class_name##_##function_name##_##args##_const const &); \
166+ TimedTest_##class_name##_##function_name##_##args##_const& operator =(TimedTest_##class_name##_##function_name##_##args##_const const &); \
167+ public: \
168+ TimedTest_##class_name##_##function_name##_##args##_const(); \
138169} g_TimedTest_##class_name##_##function_name##_##args##_const; \
139170TimedTest_##class_name##_##function_name##_##args##_const::TimedTest_##class_name##_##function_name##_##args##_const() \
140171 : ocl::TestClass(#class_name, #function_name, #args, true , true , secs, millisecs * ocl::TestTime::MICROSECONDS_PER_SECOND)
@@ -241,87 +272,87 @@ TEST_OVERRIDE_LOG(MyFunctor, new MyFunctor());
241272 */
242273
243274#ifndef CHECK_TRUE
244- #define CHECK_TRUE (expression ) CheckTrue(#expression, __FILE__, __LINE__, (expression))
275+ #define CHECK_TRUE (expression ) CheckTrue(#expression, __FILE__, (ocl::ocl_size_type) __LINE__, (expression))
245276#else
246277#error Unit test conflict with other macro!
247278#endif
248279
249280#ifndef CHECK_FALSE
250- #define CHECK_FALSE (expression ) CheckFalse(#expression, __FILE__, __LINE__, (expression))
281+ #define CHECK_FALSE (expression ) CheckFalse(#expression, __FILE__, (ocl::ocl_size_type) __LINE__, (expression))
251282#else
252283#error Unit test conflict with other macro!
253284#endif
254285
255286#ifndef CHECK_EQUAL
256- #define CHECK_EQUAL (value1, value2 ) CheckEqual(#value1 " ==" #value2, __FILE__, __LINE__, (value1), (value2))
287+ #define CHECK_EQUAL (value1, value2 ) CheckEqual(#value1 " ==" #value2, __FILE__, (ocl::ocl_size_type) __LINE__, (value1), (value2))
257288#else
258289#error Unit test conflict with other macro!
259290#endif
260291
261292#ifndef CHECK_NOT_EQUAL
262- #define CHECK_NOT_EQUAL (value1, value2 ) CheckNotEqual(#value1 " !=" #value2, __FILE__, __LINE__, (value1), (value2))
293+ #define CHECK_NOT_EQUAL (value1, value2 ) CheckNotEqual(#value1 " !=" #value2, __FILE__, (ocl::ocl_size_type) __LINE__, (value1), (value2))
263294#else
264295#error Unit test conflict with other macro!
265296#endif
266297
267298#ifndef CHECK_GREATER
268- #define CHECK_GREATER (value1, value2 ) CheckGreater(#value1 " >=" #value2, __FILE__, __LINE__, (value1), (value2))
299+ #define CHECK_GREATER (value1, value2 ) CheckGreater(#value1 " >=" #value2, __FILE__, (ocl::ocl_size_type) __LINE__, (value1), (value2))
269300#else
270301#error Unit test conflict with other macro!
271302#endif
272303
273304#ifndef CHECK_GREATER_EQUAL
274- #define CHECK_GREATER_EQUAL (value1, value2 ) CheckGreaterEqual(#value1 " >" #value2, __FILE__, __LINE__, (value1), (value2))
305+ #define CHECK_GREATER_EQUAL (value1, value2 ) CheckGreaterEqual(#value1 " >" #value2, __FILE__, (ocl::ocl_size_type) __LINE__, (value1), (value2))
275306#else
276307#error Unit test conflict with other macro!
277308#endif
278309
279310#ifndef CHECK_LESS
280- #define CHECK_LESS (value1, value2 ) CheckLess(#value1 " <" #value2, __FILE__, __LINE__, (value1), (value2))
311+ #define CHECK_LESS (value1, value2 ) CheckLess(#value1 " <" #value2, __FILE__, (ocl::ocl_size_type) __LINE__, (value1), (value2))
281312#else
282313#error Unit test conflict with other macro!
283314#endif
284315
285316#ifndef CHECK_LESS_EQUAL
286- #define CHECK_LESS_EQUAL (value1, value2 ) CheckLessEqual(#value1 " <=" #value2, __FILE__, __LINE__, (value1), (value2))
317+ #define CHECK_LESS_EQUAL (value1, value2 ) CheckLessEqual(#value1 " <=" #value2, __FILE__, (ocl::ocl_size_type) __LINE__, (value1), (value2))
287318#else
288319#error Unit test conflict with other macro!
289320#endif
290321
291322#ifndef CHECK_NULL
292- #define CHECK_NULL (value ) CheckNull(#value " == NULL" , __FILE__, __LINE__, value)
323+ #define CHECK_NULL (value ) CheckNull(#value " == NULL" , __FILE__, (ocl::ocl_size_type) __LINE__, value)
293324#else
294325#error Unit test conflict with other macro!
295326#endif
296327
297328#ifndef CHECK_NOT_NULL
298- #define CHECK_NOT_NULL (value ) CheckNotNull(#value " != NULL" , __FILE__, __LINE__, value)
329+ #define CHECK_NOT_NULL (value ) CheckNotNull(#value " != NULL" , __FILE__, (ocl::ocl_size_type) __LINE__, value)
299330#else
300331#error Unit test conflict with other macro!
301332#endif
302333
303334#ifndef CHECK_ZERO
304- #define CHECK_ZERO (value ) CheckZero(#value " == 0" , __FILE__, __LINE__, (value))
335+ #define CHECK_ZERO (value ) CheckZero(#value " == 0" , __FILE__, (ocl::ocl_size_type) __LINE__, (value))
305336#endif
306337
307338#ifndef CHECK_NOT_ZERO
308- #define CHECK_NOT_ZERO (value ) CheckNotZero(#value " != 0" , __FILE__, __LINE__, (value))
339+ #define CHECK_NOT_ZERO (value ) CheckNotZero(#value " != 0" , __FILE__, (ocl::ocl_size_type) __LINE__, (value))
309340#endif
310341
311342#ifndef CHECK_STRCMP
312- #define CHECK_STRCMP (str1, str2 ) CheckStrCmp(" StrCmp(" #str1 " ," #str2 " ) == 0" , __FILE__, __LINE__, str1, str2)
343+ #define CHECK_STRCMP (str1, str2 ) CheckStrCmp(" StrCmp(" #str1 " ," #str2 " ) == 0" , __FILE__, (ocl::ocl_size_type) __LINE__, str1, str2)
313344#endif
314345
315346#ifndef CHECK_NOT_STRCMP
316- #define CHECK_NOT_STRCMP (str1, str2 ) CheckNotStrCmp(" StrCmp(" #str1 " ," #str2 " ) != 0" , __FILE__, __LINE__, str1, str2)
347+ #define CHECK_NOT_STRCMP (str1, str2 ) CheckNotStrCmp(" StrCmp(" #str1 " ," #str2 " ) != 0" , __FILE__, (ocl::ocl_size_type) __LINE__, str1, str2)
317348#endif
318349
319350#ifndef CHECK_COMPARE
320- #define CHECK_COMPARE (value1, value2 ) CheckCompare(" compare " #value1 " = " #value2, __FILE__, __LINE__, value1, value2)
351+ #define CHECK_COMPARE (value1, value2 ) CheckCompare(" compare " #value1 " = " #value2, __FILE__, (ocl::ocl_size_type) __LINE__, value1, value2)
321352#endif
322353
323354#ifndef CHECK_NOT_COMPARE
324- #define CHECK_NOT_COMPARE (value1, value2 ) CheckNotCompare(" compare " #value1 " != " #value2, __FILE__, __LINE__, (value1), (value2))
355+ #define CHECK_NOT_COMPARE (value1, value2 ) CheckNotCompare(" compare " #value1 " != " #value2, __FILE__, (ocl::ocl_size_type) __LINE__, (value1), (value2))
325356#endif
326357
327358#define CHECK_EXCEPTION (expression, exception_type, expect_exception ) \
@@ -335,7 +366,7 @@ TEST_OVERRIDE_LOG(MyFunctor, new MyFunctor());
335366 { \
336367 found_exception = true ; \
337368 } \
338- CheckException (#expression, __FILE__, __LINE__, found_exception, expect_exception); \
369+ CheckException (#expression, __FILE__, (ocl::ocl_size_type) __LINE__, found_exception, expect_exception); \
339370}
340371
341372#define CHECK_ALL_EXCEPTIONS (expression, expect_exception ) \
@@ -349,15 +380,15 @@ TEST_OVERRIDE_LOG(MyFunctor, new MyFunctor());
349380 { \
350381 found_exception = true ; \
351382 } \
352- CheckException (#expression, __FILE__, __LINE__, found_exception, expect_exception); \
383+ CheckException (#expression, __FILE__, (ocl::ocl_size_type) __LINE__, found_exception, expect_exception); \
353384}
354385
355386#ifndef CHECK_TIME
356387#define CHECK_TIME (func ) for (; !CheckTime(); ) func
357388#endif
358389
359390#ifndef CHECK_PERFORMANCE
360- #define CHECK_PERFORMANCE (func, min_iterations ) for (ocl::TestString filename (__FILE__); !CheckTime(min_iterations, filename, __LINE__); ) func
391+ #define CHECK_PERFORMANCE (func, min_iterations ) for (ocl::TestString filename (__FILE__); !CheckTime((ocl::ocl_size_type) min_iterations, filename, (ocl::ocl_size_type) __LINE__); ) func
361392#endif
362393
363394#endif // OCL_GUARD_TEST_TESTMACROS_HPP
0 commit comments