• R/O
  • SSH
  • HTTPS

iris-fmw: Commit


Commit MetaInfo

Revision254 (tree)
Time2012-01-06 18:50:50
Authorshirayanagi

Log Message

iutest v0.12.0.0
Combine 対応
gtest 対応強化

Change Summary

Incremental Difference

--- trunk/framework/src/platform/windows/win/os/WXOS.cpp (revision 253)
+++ trunk/framework/src/platform/windows/win/os/WXOS.cpp (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2009-2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2009-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -99,6 +99,7 @@
9999 #if (defined(_IRIS_UNITTEST) || defined(_IRIS_MULTI_UNITTEST))
100100 #include "../debug/unittest/WXDebugUnitTest.h"
101101 #include "environment/WXPCName.h"
102+#include "../base/WXError.h"
102103 #include <stdio.h>
103104 #include "iris_iostream.h"
104105 #include "iris_using.h"
@@ -111,4 +112,11 @@
111112 std::cout << pcname << std::endl;
112113 }
113114
115+IRIS_UNITTEST(CWXOSUnitTest, LastError)
116+{
117+ CScopedLastError sle;
118+ CLastError le(sle);
119+ std::cout << le.ToString() << std::endl;
120+}
121+
114122 #endif // #if (defined(_IRIS_UNITTEST) || defined(_IRIS_MULTI_UNITTEST))
--- trunk/framework/src/platform/windows/win/os/environment/WXEnvironmentStrings.h (revision 253)
+++ trunk/framework/src/platform/windows/win/os/environment/WXEnvironmentStrings.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -68,7 +68,7 @@
6868
6969 public:
7070 // 展開
71- static BOOL Expand(_Mylpcstr lpSrc, _Mylpstr lpDst, DWORD nSize);
71+ static DWORD Expand(_Mylpcstr lpSrc, _Mylpstr lpDst, DWORD nSize);
7272 public:
7373 operator _Mylpstr (void) const { return m_lpEnvStr; }
7474 };
--- trunk/framework/src/platform/windows/win/os/environment/WXEnvironmentStrings.cpp (revision 253)
+++ trunk/framework/src/platform/windows/win/os/environment/WXEnvironmentStrings.cpp (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -111,25 +111,21 @@
111111 * @param [in] lpSrc = 展開文字列
112112 * @param [out] lpDst = 出力
113113 * @param [in] nSize = 出力バッファサイズ
114- * @return 成否
114+ * @return 必要なサイズ
115115 *//***********************************************************************/
116116 template<>
117-BOOL CTEnvironmentStrings<CHAR>::Expand(_Mylpcstr lpSrc, _Mylpstr lpDst, DWORD nSize)
117+DWORD CTEnvironmentStrings<CHAR>::Expand(_Mylpcstr lpSrc, _Mylpstr lpDst, DWORD nSize)
118118 {
119- DWORD dwRequest = ::ExpandEnvironmentStringsA(lpSrc, nullptr, 0);
120- if( dwRequest > nSize ) return FALSE;
121- if( ::ExpandEnvironmentStringsA(lpSrc, lpDst, nSize) == 0 )
122- return FALSE;
123- return TRUE;
119+ //DWORD dwRequest = ::ExpandEnvironmentStringsA(lpSrc, nullptr, 0);
120+ //if( dwRequest > nSize ) return dwRequest;
121+ return ::ExpandEnvironmentStringsA(lpSrc, lpDst, nSize);
124122 }
125123 template<>
126-BOOL CTEnvironmentStrings<WCHAR>::Expand(_Mylpcstr lpSrc, _Mylpstr lpDst, DWORD nSize)
124+DWORD CTEnvironmentStrings<WCHAR>::Expand(_Mylpcstr lpSrc, _Mylpstr lpDst, DWORD nSize)
127125 {
128- DWORD dwRequest = ::ExpandEnvironmentStringsW(lpSrc, nullptr, 0);
129- if( dwRequest > nSize ) return FALSE;
130- if( ::ExpandEnvironmentStringsW(lpSrc, lpDst, nSize) == 0 )
131- return FALSE;
132- return TRUE;
126+ //DWORD dwRequest = ::ExpandEnvironmentStringsW(lpSrc, nullptr, 0);
127+ //if( dwRequest > nSize ) return dwRequest;
128+ return ::ExpandEnvironmentStringsW(lpSrc, lpDst, nSize);
133129 }
134130
135131
@@ -141,8 +137,10 @@
141137
142138 #if (defined(_IRIS_UNITTEST) || defined(_IRIS_MULTI_UNITTEST))
143139 #include "../../debug/unittest/WXDebugUnitTest.h"
140+#include "../../base/WXError.h"
144141 #include "iris_tchar.h"
145142 #include "iris_using.h"
143+#include "iris_iostream.h"
146144
147145 //======================================================================
148146 // test
@@ -153,6 +151,39 @@
153151 _putts(path);
154152 }
155153
154+IRIS_UNITTEST(CWXEnvironmentStringsUnitTest, Japanese)
155+{
156+ DWORD length = CEnvironmentStrings::Expand(IRIS_TEXT("%WINDIR%\\デスクトップ"), nullptr, 0);
157+ std::cout << length << std::endl;
158+}
159+
160+IRIS_UNITTEST(CWXEnvironmentStringsUnitTest, LongLong)
161+{
162+ TCHAR path[0x20000];
163+ for( size_t i=0, n=elementof(path)-1; i<n; ++i )
164+ {
165+ path[i] = IRIS_TEXT('0') + i % 10;
166+ }
167+ path[elementof(path)-1] = IRIS_TEXT('\0');
168+
169+ {
170+ DWORD length = CEnvironmentStrings::Expand(path, nullptr, 0);
171+ if( length == 0 )
172+ {
173+ CScopedLastError sle;
174+ CLastError le(sle);
175+ std::cout << le.ToString() << std::endl;
176+ }
177+ std::cout << length << std::endl;
178+ }
179+ {
180+ TCHAR dst[0x20000] = {0};
181+ DWORD length = CEnvironmentStrings::Expand(path, dst, elementof(path));
182+ _putts(dst);
183+ std::cout << std::endl << length << std::endl;
184+ }
185+}
186+
156187 #endif // #if (defined(_IRIS_UNITTEST) || defined(_IRIS_MULTI_UNITTEST))
157188
158189 #endif
--- trunk/framework/testsuite/iutest/LICENSE (revision 253)
+++ trunk/framework/testsuite/iutest/LICENSE (revision 254)
@@ -3,7 +3,7 @@
33 ==============================================================================
44 /*
55 --------------------------------------------------------------------------------
6-Copyright (c) 2011 Takazumi-Shirayanagi,
6+Copyright (c) 2011-2012 Takazumi-Shirayanagi,
77 All rights reserved.
88 --------------------------------------------------------------------------------
99 */
--- trunk/framework/testsuite/iutest/include/iutest_ver.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/iutest_ver.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -20,23 +20,23 @@
2020 //======================================================================
2121 // include
2222
23-namespace iutest
24-{
25-
2623 //======================================================================
2724 // define
28-#define IUTEST_VER 0x00110102 //!< iutest version 0.11.1.2
25+#define IUTEST_VER 0x00120000 //!< iutest version 0.12.0.0
2926 #define IUTEST_MAJORVER 0x00
30-#define IUTEST_MINORVER 0x11
31-#define IUTEST_BUILD 0x01
32-#define IUTEST_REVISION 0x02
27+#define IUTEST_MINORVER 0x12
28+#define IUTEST_BUILD 0x00
29+#define IUTEST_REVISION 0x00
3330
34-} // end of namespace iutest
35-
3631 /**
3732 * @file iutest_ver.h
3833 * @par release note
3934 <ul>
35+ <li>v0.12.0.0
36+ <ul>
37+ <li>Combine対応/li>
38+ </ul>
39+ </li>
4040 <li>v0.11.0.0
4141 <ul>
4242 <li>型をパラメータ化したテスト<に対応/li>
--- trunk/framework/testsuite/iutest/include/gtest/iutest_switch.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/gtest/iutest_switch.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -111,9 +111,23 @@
111111 #undef INSTANTIATE_TYPED_TEST_CASE_P
112112
113113 #undef GTEST_HAS_PARAM_TEST
114+#undef GTEST_HAS_COMBINE
114115 #undef GTEST_HAS_TYPED_TEST
115116 #undef GTEST_HAS_TYPED_TEST_P
117+
118+#ifdef GTEST_OS_WINDOWS
119+# undef GTEST_OS_WINDOWS
116120 #endif
121+#ifdef GTEST_OS_CYGWIN
122+# undef GTEST_OS_CYGWIN
123+#endif
124+#ifdef GTEST_OS_LINUX
125+# undef GTEST_OS_LINUX
126+# ifdef GTEST_OS_LINUX_ANDROID
127+# undef GTEST_OS_LINUX_ANDROID
128+# endif
129+#endif
130+#endif
117131
118132 #define RUN_ALL_TESTS IUTEST_RUN_ALL_TESTS
119133
@@ -140,9 +154,12 @@
140154 #define ASSERT_THROW IUTEST_ASSERT_THROW
141155 #define ASSERT_NO_THROW IUTEST_ASSERT_NO_THROW
142156 #define ASSERT_ANY_THROW IUTEST_ASSERT_ANY_THROW
143-#define ASSERT_HRESULT_SUCCEEDED IUTEST_ASSERT_HRESULT_SUCCEEDED
144-#define ASSERT_HRESULT_FAILED IUTEST_ASSERT_HRESULT_FAILED
145157
158+#ifdef IUTEST_OS_WINDOWS
159+# define ASSERT_HRESULT_SUCCEEDED IUTEST_ASSERT_HRESULT_SUCCEEDED
160+# define ASSERT_HRESULT_FAILED IUTEST_ASSERT_HRESULT_FAILED
161+#endif
162+
146163 #define ASSERT_PRED1 IUTEST_ASSERT_PRED1
147164 #define ASSERT_PRED2 IUTEST_ASSERT_PRED2
148165 #define ASSERT_PRED3 IUTEST_ASSERT_PRED3
@@ -173,9 +190,12 @@
173190 #define EXPECT_THROW IUTEST_EXPECT_THROW
174191 #define EXPECT_NO_THROW IUTEST_EXPECT_NO_THROW
175192 #define EXPECT_ANY_THROW IUTEST_EXPECT_ANY_THROW
176-#define EXPECT_HRESULT_SUCCEEDED IUTEST_EXPECT_HRESULT_SUCCEEDED
177-#define EXPECT_HRESULT_FAILED IUTEST_EXPECT_HRESULT_FAILED
178193
194+#ifdef IUTEST_OS_WINDOWS
195+# define EXPECT_HRESULT_SUCCEEDED IUTEST_EXPECT_HRESULT_SUCCEEDED
196+# define EXPECT_HRESULT_FAILED IUTEST_EXPECT_HRESULT_FAILED
197+#endif
198+
179199 #define EXPECT_PRED1 IUTEST_EXPECT_PRED1
180200 #define EXPECT_PRED2 IUTEST_EXPECT_PRED2
181201 #define EXPECT_PRED3 IUTEST_EXPECT_PRED3
@@ -207,9 +227,23 @@
207227
208228
209229 #define GTEST_HAS_PARAM_TEST IUTEST_HAS_PARAM_TEST
230+#define GTEST_HAS_COMBINE IUTEST_HAS_COMBINE
210231 #define GTEST_HAS_TYPED_TEST IUTEST_HAS_TYPED_TEST
211232 #define GTEST_HAS_TYPED_TEST_P IUTEST_HAS_TYPED_TEST_P
212233
234+#ifdef IUTEST_OS_CYGWIN
235+# define GTEST_OS_CYGWIN IUTEST_OS_CYGWIN
236+#endif
237+#ifdef IUTEST_OS_WINDOWS
238+# define GTEST_OS_WINDOWS IUTEST_OS_WINDOWS
239+#endif
240+#ifdef IUTEST_OS_LINUX
241+# define GTEST_OS_LINUX IUTEST_OS_LINUX
242+# ifdef IUTEST_OS_LINUX_ANDROID
243+# define GTEST_OS_LINUX_ANDROID IUTEST_OS_LINUX_ANDROID
244+# endif
245+#endif
246+
213247 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
214248
215249 namespace iutest
@@ -236,7 +270,8 @@
236270
237271 //======================================================================
238272 // include
239-#include "gtest/gtest.h"
273+#include "../iutest_ver.h"
274+#include <gtest/gtest.h>
240275
241276 //======================================================================
242277 // define
@@ -260,6 +295,7 @@
260295 #undef IUTEST_ASSERT_DOUBLE_EQ
261296 #undef IUTEST_ASSERT_STREQ
262297 #undef IUTEST_ASSERT_STRNE
298+#undef IUTEST_ASSERTT_STRLNEQ
263299 #undef IUTEST_ASSERT_STRCASEEQ
264300 #undef IUTEST_ASSERT_STRCASENE
265301 #undef IUTEST_ASSERT_THROW
@@ -288,6 +324,7 @@
288324 #undef IUTEST_EXPECT_DOUBLE_EQ
289325 #undef IUTEST_EXPECT_STREQ
290326 #undef IUTEST_EXPECT_STRNE
327+#undef IUTEST_EXPECT_STRLNEQ
291328 #undef IUTEST_EXPECT_STRCASEEQ
292329 #undef IUTEST_EXPECT_STRCASENE
293330 #undef IUTEST_EXPECT_THROW
@@ -305,8 +342,11 @@
305342 #undef IUTEST_EXPECT_PRED5
306343 #undef IUTEST_SUCCEED
307344 #undef IUTEST_FAIL
345+#undef IUTEST_ASSERT_FAIL
308346 #undef IUTEST_ADD_FAILURE
347+#undef IUTEST_EXPECT_FAIL
309348 #undef IUTEST_ADD_FAILURE_AT
349+#undef IUTEST_EXPECT_FAIL_AT
310350 #undef IUTEST_SCOPED_TRACE
311351 #ifdef IUTEST_GTEST_OS_WINDOWS
312352 #undef IUTEST_ASSERT_HRESULT_SUCCEEDED
@@ -322,13 +362,37 @@
322362 #undef IUTEST_TYPED_TEST_P
323363 #undef IUTEST_REGISTER_TYPED_TEST_CASE_P
324364 #undef IUTEST_INSTANTIATE_TYPED_TEST_CASE_P
365+
366+#undef IUTEST_HAS_PARAM_TEST
367+#undef IUTEST_HAS_COMBINE
368+#undef IUTEST_HAS_TYPED_TEST
369+#undef IUTEST_HAS_TYPED_TEST_P
370+#undef IUTEST_HAS_PRED_FORMAT_OR
371+#undef IUTEST_HAS_GENRAND
372+
373+#undef IUTEST_INIT
374+
375+#undef IUTEST_SUPPRESS_UNREACHABLE_CODE_WARNING
376+
377+#ifdef IUTEST_OS_WINDOWS
378+# undef IUTEST_OS_WINDOWS
325379 #endif
380+#ifdef IUTEST_OS_CYGWIN
381+# undef IUTEST_OS_CYGWIN
382+#endif
383+#ifdef IUTEST_OS_LINUX
384+# undef IUTEST_OS_LINUX
385+# ifdef IUTEST_OS_LINUX_ANDROID
386+# undef IUTEST_OS_LINUX_ANDROID
387+# endif
388+#endif
389+#endif
326390
327391 #define IUTEST_RUN_ALL_TESTS RUN_ALL_TESTS
328392
329-#define IUTEST_TEST IUTEST
330-#define IUTEST_TEST_F F
331-#define IUTEST_TEST_P P
393+#define IUTEST TEST
394+#define IUTEST_F TEST_F
395+#define IUTEST_P TEST_P
332396 #define IUTEST_INSTANTIATE_TEST_CASE_P INSTANTIATE_TEST_CASE_P
333397
334398 #define IUTEST_ASSERT_TRUE ASSERT_TRUE
@@ -344,14 +408,18 @@
344408 #define IUTEST_ASSERT_DOUBLE_EQ ASSERT_DOUBLE_EQ
345409 #define IUTEST_ASSERT_STREQ ASSERT_STREQ
346410 #define IUTEST_ASSERT_STRNE ASSERT_STRNE
411+#define IUTEST_ASSERT_STRLNEQ(len, v2) ASSERT_PRED_FORMAT2(testing::CompareHelperSTRLNEQ, len, v2)
347412 #define IUTEST_ASSERT_STRCASEEQ ASSERT_STRCASEEQ
348413 #define IUTEST_ASSERT_STRCASENE ASSERT_STRCASENE
349-#define IUTEST_ASSERT_THROW ASSERT_THROW
350-#define IUTEST_ASSERT_NO_THROW ASSERT_NO_THROW
351-#define IUTEST_ASSERT_ANY_THROW ASSERT_ANY_THROW
352-#define IUTEST_ASSERT_HRESULT_SUCCEEDED ASSERT_HRESULT_SUCCEEDED
353-#define IUTEST_ASSERT_HRESULT_FAILED ASSERT_HRESULT_FAILED
414+#define IUTEST_ASSERT_THROW(statement, expected_exception) ASSERT_THROW((void)statement, expected_exception)
415+#define IUTEST_ASSERT_NO_THROW(statement) ASSERT_NO_THROW((void)statement)
416+#define IUTEST_ASSERT_ANY_THROW(statement) ASSERT_ANY_THROW((void)statement)
354417
418+#ifdef GTEST_OS_WINDOWS
419+# define IUTEST_ASSERT_HRESULT_SUCCEEDED ASSERT_HRESULT_SUCCEEDED
420+# define IUTEST_ASSERT_HRESULT_FAILED ASSERT_HRESULT_FAILED
421+#endif
422+
355423 #define IUTEST_ASSERT_PRED1 ASSERT_PRED1
356424 #define IUTEST_ASSERT_PRED2 ASSERT_PRED2
357425 #define IUTEST_ASSERT_PRED3 ASSERT_PRED3
@@ -377,14 +445,18 @@
377445 #define IUTEST_EXPECT_DOUBLE_EQ EXPECT_DOUBLE_EQ
378446 #define IUTEST_EXPECT_STREQ EXPECT_STREQ
379447 #define IUTEST_EXPECT_STRNE EXPECT_STRNE
448+#define IUTEST_EXPECT_STRLNEQ(len, v2) EXPECT_PRED_FORMAT2(testing::CompareHelperSTRLNEQ, len, v2)
380449 #define IUTEST_EXPECT_STRCASEEQ EXPECT_STRCASEEQ
381450 #define IUTEST_EXPECT_STRCASENE EXPECT_STRCASENE
382-#define IUTEST_EXPECT_THROW EXPECT_THROW
383-#define IUTEST_EXPECT_NO_THROW EXPECT_NO_THROW
384-#define IUTEST_EXPECT_ANY_THROW EXPECT_ANY_THROW
385-#define IUTEST_EXPECT_HRESULT_SUCCEEDED EXPECT_HRESULT_SUCCEEDED
386-#define IUTEST_EXPECT_HRESULT_FAILED EXPECT_HRESULT_FAILED
451+#define IUTEST_EXPECT_THROW(statement, expected_exception) EXPECT_THROW((void)statement, expected_exception)
452+#define IUTEST_EXPECT_NO_THROW(statement) EXPECT_NO_THROW((void)statement)
453+#define IUTEST_EXPECT_ANY_THROW(statement) EXPECT_ANY_THROW((void)statement)
387454
455+#ifdef GTEST_OS_WINDOWS
456+# define IUTEST_EXPECT_HRESULT_SUCCEEDED EXPECT_HRESULT_SUCCEEDED
457+# define IUTEST_EXPECT_HRESULT_FAILED EXPECT_HRESULT_FAILED
458+#endif
459+
388460 #define IUTEST_EXPECT_PRED1 EXPECT_PRED1
389461 #define IUTEST_EXPECT_PRED2 EXPECT_PRED2
390462 #define IUTEST_EXPECT_PRED3 EXPECT_PRED3
@@ -399,8 +471,11 @@
399471
400472 #define IUTEST_SUCCEED SUCCEED
401473 #define IUTEST_FAIL FAIL
474+#define IUTEST_ASSERT_FAIL FAIL
402475 #define IUTEST_ADD_FAILURE ADD_FAILURE
476+#define IUTEST_EXPECT_FAIL ADD_FAILURE
403477 #define IUTEST_ADD_FAILURE_AT ADD_FAILURE_AT
478+#define IUTEST_EXPECT_FAIL_AT ADD_FAILURE_AT
404479
405480 #define IUTEST_SCOPED_MESSAGE SCOPED_TRACE
406481 #define IUTEST_SCOPED_TRACE SCOPED_TRACE
@@ -414,29 +489,65 @@
414489 #define IUTEST_REGISTER_TYPED_TEST_CASE_P REGISTER_TYPED_TEST_CASE_P
415490 #define IUTEST_INSTANTIATE_TYPED_TEST_CASE_P INSTANTIATE_TYPED_TEST_CASE_P
416491
417-#define IUTEST_HAS_PARAM_TEST GTEST_HAS_PARAM_TEST
418-#define IUTEST_HAS_TYPED_TEST GTEST_HAS_TYPED_TEST
419-#define IUTEST_HAS_TYPED_TEST_P GTEST_HAS_TYPED_TEST_P
492+#define IUTEST_HAS_PARAM_TEST GTEST_HAS_PARAM_TEST
493+#define IUTEST_HAS_COMBINE GTEST_HAS_COMBINE
494+#define IUTEST_HAS_TYPED_TEST GTEST_HAS_TYPED_TEST
495+#define IUTEST_HAS_TYPED_TEST_P GTEST_HAS_TYPED_TEST_P
496+#define IUTEST_HAS_PRED_FORMAT_OR 0
497+#define IUTEST_HAS_GENRAND 0
420498
421-#ifndef INCG_IRIS_iutest_H_
499+#ifdef GTEST_OS_CYGWIN
500+# define IUTEST_OS_CYGWIN GTEST_OS_CYGWIN
501+#endif
502+#ifdef GTEST_OS_WINDOWS
503+# define IUTEST_OS_WINDOWS GTEST_OS_WINDOWS
504+# include <windows.h>
505+#endif
506+#ifdef GTEST_OS_LINUX
507+# define IUTEST_OS_LINUX GTEST_OS_LINUX
508+# ifdef GTEST_OS_LINUX_ANDROID
509+# define IUTEST_OS_LINUX_ANDROID GTEST_OS_LINUX_ANDROID
510+# endif
511+#endif
422512
513+#define IUTEST_INIT testing::InitGoogleTest
514+
515+#define IUTEST_SUPPRESS_UNREACHABLE_CODE_WARNING GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_
516+
423517 namespace testing
424518 {
425519
426520 //======================================================================
427521 // function
428-static void InitIrisUnitTest(int* argc, char** argv)
522+static void InitGoogleTest(int argc, const char** argv)
429523 {
430- InitGoogleTest(argc, argv);
524+ int targc = argc;
525+ InitGoogleTest(&targc, const_cast<char**>(argv));
431526 }
432-static void InitIrisUnitTest(int* argc, wchar_t** argv)
527+static void InitGoogleTest(int argc, const wchar_t** argv)
433528 {
434- InitGoogleTest(argc, argv);
529+ int targc = argc;
530+ InitGoogleTest(&targc, const_cast<wchar_t**>(argv));
435531 }
436532
533+static AssertionResult CompareHelperSTRLNEQ(const char* expr1, const char* expr2
534+ , size_t len1, const char* val2)
535+{
536+ size_t len2 = strlen(val2);
537+ if( len2 == len1 ) return AssertionSuccess();
538+ return AssertionFailure() << "error: Value of: " << expr1 << " == strlen(" << expr2 << ")"
539+ << "\n Actual: " << val2 << " : " << len2 << "\nExpected: " << len1 ;
437540 }
541+static AssertionResult CompareHelperSTRLNEQ(const char* expr1, const char* expr2
542+ , size_t len1, const wchar_t* val2)
543+{
544+ size_t len2 = wcslen(val2);
545+ if( len2 == len1 ) return AssertionSuccess();
546+ return AssertionFailure() << "error: Value of: " << expr1 << " == wcslen(" << expr2 << ")"
547+ << "\n Actual: " << val2 << " : " << len2 << "\nExpected: " << len1 ;
548+}
438549
439-#endif
550+}
440551
441552 namespace iutest = testing;
442553
--- trunk/framework/testsuite/iutest/include/iutest_assertion.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/iutest_assertion.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -457,6 +457,9 @@
457457
458458 #endif
459459
460+
461+#if IUTEST_HAS_PRED_FORMAT_OR
462+
460463 /**
461464 * @brief OR テスト用オブジェクト郡
462465 */
@@ -537,6 +540,8 @@
537540 }
538541 };
539542
543+#endif
544+
540545 } // end of namespace iutest
541546
542547 #endif
--- trunk/framework/testsuite/iutest/include/iutest_result.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/iutest_result.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -20,7 +20,7 @@
2020 //======================================================================
2121 // include
2222 #include "iutest_defs.h"
23-#include "internal/iutest_util.h"
23+#include "internal/iutest_internal_defs.h"
2424 #include "internal/iutest_string.h"
2525 #include "internal/iutest_message.h"
2626 #include "internal/iutest_console.h"
--- trunk/framework/testsuite/iutest/include/iutest.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/iutest.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 *
--- trunk/framework/testsuite/iutest/include/iutest_defs.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/iutest_defs.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -116,6 +116,9 @@
116116 # define IUTEST_HAS_COMBINE 0
117117 #endif
118118
119+#define IUTEST_HAS_PRED_FORMAT_OR 1 //!< or アサーションヘルパー対応かどうか
120+#define IUTEST_HAS_GENRAND 1 //!< テストごとの genrand 関数が使用可能かどうか
121+
119122 namespace iutest
120123 {
121124
--- trunk/framework/testsuite/iutest/include/iutest_param_tests.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/iutest_param_tests.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -35,7 +35,7 @@
3535 * @biref パラメータテスト登録
3636 */
3737 #define IIUT_INSTANTIATE_TEST_CASE_P_(prefix_, testcase_, generator_) \
38- iutest::detail::iuParamGenerator<testcase_::ParamType>* \
38+ iutest::detail::iuIParamGenerator<testcase_::ParamType>* \
3939 s_##prefix_##_##testcase_##__EvalGenerator_(void) { return generator_; } \
4040 int s_##prefix_##_##testcase_##_dummy = \
4141 iutest::UnitTest::GetInstance()->parameterized_test_registry(). \
@@ -131,7 +131,7 @@
131131 * @brief 範囲パラメータ
132132 */
133133 template<typename T>
134-static detail::iuParamGenerator<T>* Range(T begin, T end, T step=1)
134+static detail::iuIParamGenerator<T>* Range(T begin, T end, T step=1)
135135 {
136136 return new detail::iuRangeParamsGenerator<T>(begin, end, step);
137137 }
@@ -139,7 +139,7 @@
139139 /**
140140 * @brief 真偽値パラメータ
141141 */
142-static detail::iuParamGenerator<bool> IUTEST_ATTRIBUTE_UNUSED * Bool(void)
142+static detail::iuIParamGenerator<bool> IUTEST_ATTRIBUTE_UNUSED * Bool(void)
143143 {
144144 return new detail::iuBoolParamsGenerator<bool>();
145145 }
@@ -148,19 +148,19 @@
148148 * @brief 値配列パラメータ
149149 */
150150 template<typename Container>
151-static detail::iuParamGenerator< typename Container::value_type >* ValueIn(Container containor)
151+static detail::iuIParamGenerator< typename Container::value_type >* ValuesIn(Container containor)
152152 {
153153 return new detail::iuValueInParamsGenerator< typename Container::value_type >(containor);
154154 }
155155
156156 template<typename T, size_t SIZE>
157-static detail::iuParamGenerator<T>* ValueIn(const T (&v)[SIZE])
157+static detail::iuIParamGenerator<T>* ValuesIn(const T (&v)[SIZE])
158158 {
159159 return new detail::iuValueInParamsGenerator<T>(v, v+SIZE);
160160 }
161161
162162 template<typename Ite>
163-static detail::iuParamGenerator< typename detail::IteratorTraits<Ite>::type >* ValueIn(Ite begin, Ite end)
163+static detail::iuIParamGenerator< typename detail::IteratorTraits<Ite>::type >* ValuesIn(Ite begin, Ite end)
164164 {
165165 return new detail::iuValueInParamsGenerator< typename detail::IteratorTraits<Ite>::type >(begin, end);
166166 }
@@ -1118,7 +1118,62 @@
11181118 );
11191119 }
11201120
1121+#if IUTEST_HAS_COMBINE
11211122
1123+template<typename G1, typename G2>
1124+detail::iuCartesianProductHolder2<G1, G2> Combine(const G1& g1, const G2& g2)
1125+{
1126+ return detail::iuCartesianProductHolder2<G1, G2>(g1, g2);
1127+}
1128+
1129+template<typename G1, typename G2, typename G3>
1130+detail::iuCartesianProductHolder3<G1, G2, G3> Combine(const G1& g1, const G2& g2, const G3& g3)
1131+{
1132+ return detail::iuCartesianProductHolder3<G1, G2, G3>(g1, g2, g3);
1133+}
1134+
1135+template<typename G1, typename G2, typename G3, typename G4>
1136+detail::iuCartesianProductHolder4<G1, G2, G3, G4> Combine(const G1& g1, const G2& g2, const G3& g3, const G4& g4)
1137+{
1138+ return detail::iuCartesianProductHolder4<G1, G2, G3, G4>(g1, g2, g3, g4);
1139+}
1140+
1141+template<typename G1, typename G2, typename G3, typename G4, typename G5>
1142+detail::iuCartesianProductHolder5<G1, G2, G3, G4, G5> Combine(const G1& g1, const G2& g2, const G3& g3, const G4& g4, const G5& g5)
1143+{
1144+ return detail::iuCartesianProductHolder5<G1, G2, G3, G4, G5>(g1, g2, g3, g4, g5);
1145+}
1146+
1147+template<typename G1, typename G2, typename G3, typename G4, typename G5, typename G6>
1148+detail::iuCartesianProductHolder6<G1, G2, G3, G4, G5, G6> Combine(const G1& g1, const G2& g2, const G3& g3, const G4& g4, const G5& g5
1149+ , const G6& g6)
1150+{
1151+ return detail::iuCartesianProductHolder6<G1, G2, G3, G4, G5, G6>(g1, g2, g3, g4, g5, g6);
1152+}
1153+
1154+template<typename G1, typename G2, typename G3, typename G4, typename G5, typename G6, typename G7>
1155+detail::iuCartesianProductHolder7<G1, G2, G3, G4, G5, G6, G7> Combine(const G1& g1, const G2& g2, const G3& g3, const G4& g4, const G5& g5
1156+ , const G6& g6, const G7& g7)
1157+{
1158+ return detail::iuCartesianProductHolder7<G1, G2, G3, G4, G5, G6, G7>(g1, g2, g3, g4, g5, g6, g7);
1159+}
1160+
1161+template<typename G1, typename G2, typename G3, typename G4, typename G5, typename G6, typename G7, typename G8>
1162+detail::iuCartesianProductHolder8<G1, G2, G3, G4, G5, G6, G7, G8> Combine(const G1& g1, const G2& g2, const G3& g3, const G4& g4, const G5& g5
1163+ , const G6& g6, const G7& g7, const G8& g8)
1164+{
1165+ return detail::iuCartesianProductHolder8<G1, G2, G3, G4, G5, G6, G7, G8>(g1, g2, g3, g4, g5, g6, g7, g8);
1166+}
1167+
1168+template<typename G1, typename G2, typename G3, typename G4, typename G5, typename G6, typename G7, typename G8, typename G9>
1169+detail::iuCartesianProductHolder9<G1, G2, G3, G4, G5, G6, G7, G8, G9> Combine(const G1& g1, const G2& g2, const G3& g3, const G4& g4, const G5& g5
1170+ , const G6& g6, const G7& g7, const G8& g8, const G9& g9)
1171+{
1172+ return detail::iuCartesianProductHolder9<G1, G2, G3, G4, G5, G6, G7, G8, G9>(g1, g2, g3, g4, g5, g6, g7, g8, g9);
1173+}
1174+
1175+#endif
1176+
11221177 } // end of namespace iutest
11231178
11241179 #endif // IUTEST_HAS_PARAM_TEST
--- trunk/framework/testsuite/iutest/include/iutest_core.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/iutest_core.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -37,8 +37,11 @@
3737 static UnitTest* GetInstance(void) { return &instance(); }
3838
3939 public:
40- /** テスト中の TestInfo の取得 */
41- static const TestInfo* current_test_info(void) { return Test::CurrentTestObserver::GetCurrentTestInfo(); }
40+ /**
41+ * @brief テスト中の TestInfo の取得
42+ * @note 互換性のため メンバ関数 にしています。
43+ */
44+ const TestInfo* current_test_info(void) { return Test::CurrentTestObserver::GetCurrentTestInfo(); }
4245
4346 public:
4447 /** テスト総数 */
--- trunk/framework/testsuite/iutest/include/internal/iutest_util.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_util.h (nonexistent)
@@ -1,272 +0,0 @@
1-//======================================================================
2-//-----------------------------------------------------------------------
3-/**
4- * @file iutest_util.h
5- * @brief iris unit test utility ファイル
6- *
7- * @author t.sirayanagi
8- * @version 1.0
9- *
10- * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
12- * The new BSD License is applied to this software.
13- * see LICENSE
14-*/
15-//-----------------------------------------------------------------------
16-//======================================================================
17-#ifndef INCG_IRIS_iutest_util_H_4B0AF5C2_8E8D_43ef_BFC5_F385E68F18DB_
18-#define INCG_IRIS_iutest_util_H_4B0AF5C2_8E8D_43ef_BFC5_F385E68F18DB_
19-
20-//======================================================================
21-// include
22-#include "../iutest_defs.h"
23-#include "iutest_pp.h"
24-
25-//======================================================================
26-// define
27-#define IUTEST_PP_DISALLOW_COPY_AND_ASSIGN(TypeName) \
28- TypeName( const TypeName& ); \
29- TypeName& operator = ( const TypeName& )
30-
31-/**
32- * @brief 曖昧な else 文の警告抑制
33-*/
34-#ifdef __INTEL_COMPILER
35-# define IUTEST_AMBIGUOUS_ELSE_BLOCKER
36-#else
37-# define IUTEST_AMBIGUOUS_ELSE_BLOCKER switch(iutest::detail::AlwaysZero()) case 0: default:
38-#endif
39-
40-#define IUTEST_SUPPRESS_UNREACHABLE_CODE_WARNING(statement) if( iutest::detail::AlwaysTrue() ) statement
41-
42-#ifndef NULL
43-# ifdef __cplusplus
44-# define NULL 0
45-# else
46-# define NULL (void*)0
47-# endif
48-#endif
49-
50-#ifndef IUTEST_BREAK
51-# if defined(_MSC_VER)
52-# define IUTEST_BREAK() do { __asm{ int 3 } } while(::iutest::detail::AlwaysFalse())
53-# else
54-# define IUTEST_BREAK() (void)0
55-# endif
56-#endif
57-
58-namespace iutest {
59-namespace detail
60-{
61-
62-template<typename Ite>
63-struct IteratorTraits
64-{
65- typedef typename Ite::value_type type;
66-};
67-template<typename T>
68-struct IteratorTraits<T*>
69-{
70- typedef T type;
71-};
72-template<typename T>
73-struct IteratorTraits<const T*>
74-{
75- typedef T type;
76-};
77-
78-/**
79- * @internal
80- * @brief 空オブジェクト
81-*/
82-class None {};
83-template<typename T>
84-class NoneT1 {};
85-
86-namespace helper
87-{
88-
89-//======================================================================
90-// struct
91-/**
92- * @internal
93- * @brief TypeId Generator Implementation
94-*/
95-template<typename TN>
96-struct TestTypeIdHelper { public: static bool _dummy; };
97-
98-template<typename TN>bool TestTypeIdHelper<TN>::_dummy = false;
99-
100-}
101-
102-//======================================================================
103-// function
104-/**
105- * @internal
106- * @brief TypeId Generator
107-*/
108-template<typename TN>
109-TestTypeId GetTestTypeId(void)
110-{
111- return &(helper::TestTypeIdHelper<TN>::_dummy);
112-}
113-
114-/**
115- * @internal
116- * @brief auto_ptr
117-*/
118-template<typename TN>
119-class auto_ptr
120-{
121- typedef auto_ptr<TN> _Myt;
122- mutable TN* ptr;
123-public:
124- auto_ptr(const _Myt& o) : ptr(o.ptr) { o.ptr = NULL; }
125- auto_ptr(TN* p=NULL) : ptr(p) {}
126- ~auto_ptr(void) { if( ptr != NULL ) delete ptr; }
127-
128- TN* operator ->(void) { return ptr; }
129-};
130-
131-/**
132- * @internal
133- * @brief NULL リテラルかどうか
134-*/
135-struct IsNullLiteralHelper
136-{
137- class Object;
138-
139- static char IsNullLiteral(Object*);
140- static char (&IsNullLiteral(...))[2];
141-};
142-
143-
144-#define IUTEST_IS_NULLLITERAL(x) \
145- (sizeof(iutest::detail::IsNullLiteralHelper::IsNullLiteral(x)) == 1)
146-
147-/**
148- * @internal
149- * @brief stl コンテナかどうか
150-*/
151-struct IsContainerHelper
152-{
153- typedef int yes_t;
154- typedef char no_t;
155-
156- template<typename T>
157- static yes_t IsContainer(int , typename T::iterator* =NULL, typename T::const_iterator* =NULL) { return 0; }
158-
159- template<typename T>
160- static no_t IsContainer(long) { return 0; }
161-};
162-
163-/**
164- * @brief remove_const
165-*/
166-template<typename T>
167-class remove_const
168-{
169- template<typename U>
170- struct impl { typedef U type; };
171- template<typename U>
172- struct impl<const U> { typedef U type; };
173-public:
174- typedef typename impl<T>::type type;
175-};
176-
177-/**
178- * @brief enable_if
179-*/
180-template<bool B, typename T>
181-struct enable_if
182-{
183- typedef T type;
184-};
185-template<typename T>
186-struct enable_if<false, T> {};
187-
188-template<class COND, typename T = void>
189-struct enable_if_t : public enable_if<COND::value, T> {};
190-
191-/**
192- * @brief disable_if
193-*/
194-template<bool B, typename T>
195-struct disable_if : public enable_if<!B, T> {};
196-template<class COND, typename T = void>
197-struct disable_if_t : public disable_if<COND::value, T> {};
198-
199-template<typename TN>
200-struct enabler_t
201-{
202- static void* value;
203-};
204-template<typename TN>void* enabler_t<TN>::value = NULL;
205-
206-typedef enabler_t<void> enabler;
207-
208-/**
209- * @brief bool constant
210-*/
211-template<bool B>
212-struct bool_constant
213-{
214- static const bool value = B;
215-};
216-template<bool B>const bool bool_constant<B>::value;
217-
218-typedef bool_constant<true> true_type;
219-typedef bool_constant<false> false_type;
220-
221-/**
222- * @brief is_pointer
223-*/
224-template<typename T>
225-struct is_pointer : public false_type {};
226-template<typename T>
227-struct is_pointer<T*> : public true_type {};
228-
229-/**
230- * @brief is convertible
231-*/
232-template<typename From, typename To>
233-class is_convertible
234-{
235- static From MakeFrom(void);
236-
237- static char IsConvertibleHelper(To);
238- static char (&IsConvertibleHelper(...))[2];
239-public:
240- static const bool value = (sizeof(IsConvertibleHelper(is_convertible::MakeFrom())) == 1);
241-};
242-
243-template<typename From, typename To>
244-const bool is_convertible<From, To>::value;
245-
246-
247-/**
248- * @brief true を返す(警告対策用)
249-*/
250-static bool AlwaysTrue(void)
251-{
252- return true;
253-}
254-/**
255- * @brief false を返す(警告対策用)
256-*/
257-inline bool AlwaysFalse(void) { return !AlwaysTrue(); }
258-
259-/**
260- * @brief 0 を返す(警告対策用)
261-*/
262-inline int AlwaysZero(void) { return 0; }
263-
264-/**
265- * @brief
266-*/
267-
268-} // end of namespace detail
269-} // end of namespace iutest
270-
271-
272-#endif
--- trunk/framework/testsuite/iutest/include/internal/iutest_time.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_time.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -19,8 +19,7 @@
1919
2020 //======================================================================
2121 // include
22-#include "../iutest_defs.h"
23-#include "iutest_util.h"
22+#include "iutest_internal_defs.h"
2423 #include "iutest_string.h"
2524 #include <time.h>
2625
--- trunk/framework/testsuite/iutest/include/internal/iutest_console.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_console.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -19,7 +19,7 @@
1919
2020 //======================================================================
2121 // include
22-#include "iutest_util.h"
22+#include "iutest_internal_defs.h"
2323 #include "../iutest_env.h"
2424 #include <stdio.h>
2525 #include <stdarg.h>
--- trunk/framework/testsuite/iutest/include/internal/iutest_factory.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_factory.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -20,7 +20,7 @@
2020 //======================================================================
2121 // include
2222 #include "iutest_list.h"
23-#include "iutest_util.h"
23+#include "iutest_internal_defs.h"
2424
2525 namespace iutest {
2626
--- trunk/framework/testsuite/iutest/include/internal/iutest_internal.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_internal.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -19,7 +19,7 @@
1919
2020 //======================================================================
2121 // include
22-#include "iutest_util.h"
22+#include "iutest_internal_defs.h"
2323 #include "iutest_factory.h"
2424
2525 //======================================================================
--- trunk/framework/testsuite/iutest/include/internal/iutest_internal_defs.h (nonexistent)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_internal_defs.h (revision 254)
@@ -0,0 +1,272 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file iutest_internal_defs.h
5+ * @brief iris unit test utility ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see LICENSE
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#ifndef INCG_IRIS_iutest_internal_defs_H_4B0AF5C2_8E8D_43ef_BFC5_F385E68F18DB_
18+#define INCG_IRIS_iutest_internal_defs_H_4B0AF5C2_8E8D_43ef_BFC5_F385E68F18DB_
19+
20+//======================================================================
21+// include
22+#include "../iutest_defs.h"
23+#include "iutest_pp.h"
24+
25+//======================================================================
26+// define
27+#define IUTEST_PP_DISALLOW_COPY_AND_ASSIGN(TypeName) \
28+ TypeName( const TypeName& ); \
29+ TypeName& operator = ( const TypeName& )
30+
31+/**
32+ * @brief 曖昧な else 文の警告抑制
33+*/
34+#ifdef __INTEL_COMPILER
35+# define IUTEST_AMBIGUOUS_ELSE_BLOCKER
36+#else
37+# define IUTEST_AMBIGUOUS_ELSE_BLOCKER switch(iutest::detail::AlwaysZero()) case 0: default:
38+#endif
39+
40+#define IUTEST_SUPPRESS_UNREACHABLE_CODE_WARNING(statement) if( iutest::detail::AlwaysTrue() ) statement
41+
42+#ifndef NULL
43+# ifdef __cplusplus
44+# define NULL 0
45+# else
46+# define NULL (void*)0
47+# endif
48+#endif
49+
50+#ifndef IUTEST_BREAK
51+# if defined(_MSC_VER)
52+# define IUTEST_BREAK() do { __asm{ int 3 } } while(::iutest::detail::AlwaysFalse())
53+# else
54+# define IUTEST_BREAK() (void)0
55+# endif
56+#endif
57+
58+namespace iutest {
59+namespace detail
60+{
61+
62+template<typename Ite>
63+struct IteratorTraits
64+{
65+ typedef typename Ite::value_type type;
66+};
67+template<typename T>
68+struct IteratorTraits<T*>
69+{
70+ typedef T type;
71+};
72+template<typename T>
73+struct IteratorTraits<const T*>
74+{
75+ typedef T type;
76+};
77+
78+/**
79+ * @internal
80+ * @brief 空オブジェクト
81+*/
82+class None {};
83+template<typename T>
84+class NoneT1 {};
85+
86+namespace helper
87+{
88+
89+//======================================================================
90+// struct
91+/**
92+ * @internal
93+ * @brief TypeId Generator Implementation
94+*/
95+template<typename TN>
96+struct TestTypeIdHelper { public: static bool _dummy; };
97+
98+template<typename TN>bool TestTypeIdHelper<TN>::_dummy = false;
99+
100+}
101+
102+//======================================================================
103+// function
104+/**
105+ * @internal
106+ * @brief TypeId Generator
107+*/
108+template<typename TN>
109+TestTypeId GetTestTypeId(void)
110+{
111+ return &(helper::TestTypeIdHelper<TN>::_dummy);
112+}
113+
114+/**
115+ * @internal
116+ * @brief auto_ptr
117+*/
118+template<typename TN>
119+class auto_ptr
120+{
121+ typedef auto_ptr<TN> _Myt;
122+ mutable TN* ptr;
123+public:
124+ auto_ptr(const _Myt& o) : ptr(o.ptr) { o.ptr = NULL; }
125+ auto_ptr(TN* p=NULL) : ptr(p) {}
126+ ~auto_ptr(void) { if( ptr != NULL ) delete ptr; }
127+
128+ TN* operator ->(void) { return ptr; }
129+};
130+
131+/**
132+ * @internal
133+ * @brief NULL リテラルかどうか
134+*/
135+struct IsNullLiteralHelper
136+{
137+ class Object;
138+
139+ static char IsNullLiteral(Object*);
140+ static char (&IsNullLiteral(...))[2];
141+};
142+
143+
144+#define IUTEST_IS_NULLLITERAL(x) \
145+ (sizeof(iutest::detail::IsNullLiteralHelper::IsNullLiteral(x)) == 1)
146+
147+/**
148+ * @internal
149+ * @brief stl コンテナかどうか
150+*/
151+struct IsContainerHelper
152+{
153+ typedef int yes_t;
154+ typedef char no_t;
155+
156+ template<typename T>
157+ static yes_t IsContainer(int , typename T::iterator* =NULL, typename T::const_iterator* =NULL) { return 0; }
158+
159+ template<typename T>
160+ static no_t IsContainer(long) { return 0; }
161+};
162+
163+/**
164+ * @brief remove_const
165+*/
166+template<typename T>
167+class remove_const
168+{
169+ template<typename U>
170+ struct impl { typedef U type; };
171+ template<typename U>
172+ struct impl<const U> { typedef U type; };
173+public:
174+ typedef typename impl<T>::type type;
175+};
176+
177+/**
178+ * @brief enable_if
179+*/
180+template<bool B, typename T>
181+struct enable_if
182+{
183+ typedef T type;
184+};
185+template<typename T>
186+struct enable_if<false, T> {};
187+
188+template<class COND, typename T = void>
189+struct enable_if_t : public enable_if<COND::value, T> {};
190+
191+/**
192+ * @brief disable_if
193+*/
194+template<bool B, typename T>
195+struct disable_if : public enable_if<!B, T> {};
196+template<class COND, typename T = void>
197+struct disable_if_t : public disable_if<COND::value, T> {};
198+
199+template<typename TN>
200+struct enabler_t
201+{
202+ static void* value;
203+};
204+template<typename TN>void* enabler_t<TN>::value = NULL;
205+
206+typedef enabler_t<void> enabler;
207+
208+/**
209+ * @brief bool constant
210+*/
211+template<bool B>
212+struct bool_constant
213+{
214+ static const bool value = B;
215+};
216+template<bool B>const bool bool_constant<B>::value;
217+
218+typedef bool_constant<true> true_type;
219+typedef bool_constant<false> false_type;
220+
221+/**
222+ * @brief is_pointer
223+*/
224+template<typename T>
225+struct is_pointer : public false_type {};
226+template<typename T>
227+struct is_pointer<T*> : public true_type {};
228+
229+/**
230+ * @brief is convertible
231+*/
232+template<typename From, typename To>
233+class is_convertible
234+{
235+ static From MakeFrom(void);
236+
237+ static char IsConvertibleHelper(To);
238+ static char (&IsConvertibleHelper(...))[2];
239+public:
240+ static const bool value = (sizeof(IsConvertibleHelper(is_convertible::MakeFrom())) == 1);
241+};
242+
243+template<typename From, typename To>
244+const bool is_convertible<From, To>::value;
245+
246+
247+/**
248+ * @brief true を返す(警告対策用)
249+*/
250+static bool AlwaysTrue(void)
251+{
252+ return true;
253+}
254+/**
255+ * @brief false を返す(警告対策用)
256+*/
257+inline bool AlwaysFalse(void) { return !AlwaysTrue(); }
258+
259+/**
260+ * @brief 0 を返す(警告対策用)
261+*/
262+inline int AlwaysZero(void) { return 0; }
263+
264+/**
265+ * @brief
266+*/
267+
268+} // end of namespace detail
269+} // end of namespace iutest
270+
271+
272+#endif
--- trunk/framework/testsuite/iutest/include/internal/iutest_genparams.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_genparams.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -19,7 +19,7 @@
1919
2020 //======================================================================
2121 // include
22-#include "iutest_util.h"
22+#include "iutest_internal_defs.h"
2323 #include <vector>
2424
2525 #if IUTEST_HAS_PARAM_TEST
@@ -34,13 +34,13 @@
3434 * @brief パラメータ生成器インターフェイス
3535 */
3636 template<typename T>
37-class iuParamGenerator
37+class iuIParamGenerator
3838 {
39- typedef iuParamGenerator<T> _Myt;
39+ typedef iuIParamGenerator<T> _Myt;
4040 public:
4141 typedef _Myt* (*Generator)(void);
4242 public:
43- virtual ~iuParamGenerator(void) {}
43+ virtual ~iuIParamGenerator(void) {}
4444 public:
4545 virtual void Begin(void) = 0; //!< パラメータリストの先頭に移動
4646 virtual T GetCurrent(void) const = 0; // 現在のパラメータを取得
@@ -49,11 +49,32 @@
4949 };
5050
5151 /**
52+ * @brief パラメータ生成器保持クラス
53+*/
54+template<typename T>
55+class iuParamGenerator : public iuIParamGenerator<T>
56+{
57+ typedef iuIParamGenerator<T> _Interface;
58+
59+public:
60+ iuParamGenerator(_Interface* pInterface) : m_pInterface(pInterface) {}
61+
62+public:
63+ virtual void Begin(void) { m_pInterface->Begin(); } //!< パラメータリストの先頭に移動
64+ virtual T GetCurrent(void) const { return m_pInterface->GetCurrent(); } // 現在のパラメータを取得
65+ virtual void Next(void) { m_pInterface->Next(); } //!< パラメータを取得して次に移動
66+ virtual bool IsEnd(void) const { return m_pInterface->IsEnd(); } //!< パラメータリストの終端にいるかどうか
67+private:
68+ _Interface* m_pInterface;
69+};
70+
71+
72+/**
5273 * @brief 範囲パラメータ生成器
5374 * @tparam T = パラメータ型
5475 */
5576 template<typename T>
56-class iuRangeParamsGenerator : public iuParamGenerator<T>
77+class iuRangeParamsGenerator : public iuIParamGenerator<T>
5778 {
5879 T m_begin;
5980 T m_end;
@@ -86,7 +107,7 @@
86107 * @tparam T = パラメータ型
87108 */
88109 template<typename T>
89-class iuBoolParamsGenerator : public iuParamGenerator<T>
110+class iuBoolParamsGenerator : public iuIParamGenerator<T>
90111 {
91112 T m_cur;
92113 int m_n;
@@ -107,7 +128,7 @@
107128 * @tparam T = パラメータ型
108129 */
109130 template<typename T>
110-class iuValueInParamsGenerator : public iuParamGenerator<T>
131+class iuValueInParamsGenerator : public iuIParamGenerator<T>
111132 {
112133 typedef std::vector<T> params_t;
113134 params_t m_values;
@@ -156,7 +177,7 @@
156177 {}
157178 public:
158179 template<typename T>
159- operator iuParamGenerator<T>* (void) const
180+ operator iuIParamGenerator<T>* (void) const
160181 {
161182 const T val[] = { static_cast<T>(v1)
162183 };
@@ -174,7 +195,7 @@
174195 {}
175196 public:
176197 template<typename T>
177- operator iuParamGenerator<T>* (void) const
198+ operator iuIParamGenerator<T>* (void) const
178199 {
179200 const T val[] = { static_cast<T>(v1), static_cast<T>(v2)
180201 };
@@ -193,7 +214,7 @@
193214 {}
194215 public:
195216 template<typename T>
196- operator iuParamGenerator<T>* (void) const
217+ operator iuIParamGenerator<T>* (void) const
197218 {
198219 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3)
199220 };
@@ -211,7 +232,7 @@
211232 {}
212233 public:
213234 template<typename T>
214- operator iuParamGenerator<T>* (void) const
235+ operator iuIParamGenerator<T>* (void) const
215236 {
216237 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
217238 };
@@ -230,7 +251,7 @@
230251 {}
231252 public:
232253 template<typename T>
233- operator iuParamGenerator<T>* (void) const
254+ operator iuIParamGenerator<T>* (void) const
234255 {
235256 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
236257 , static_cast<T>(v5)
@@ -250,7 +271,7 @@
250271 {}
251272 public:
252273 template<typename T>
253- operator iuParamGenerator<T>* (void) const
274+ operator iuIParamGenerator<T>* (void) const
254275 {
255276 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
256277 , static_cast<T>(v5), static_cast<T>(v6)
@@ -270,7 +291,7 @@
270291 {}
271292 public:
272293 template<typename T>
273- operator iuParamGenerator<T>* (void) const
294+ operator iuIParamGenerator<T>* (void) const
274295 {
275296 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
276297 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7)
@@ -290,7 +311,7 @@
290311 {}
291312 public:
292313 template<typename T>
293- operator iuParamGenerator<T>* (void) const
314+ operator iuIParamGenerator<T>* (void) const
294315 {
295316 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
296317 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8)
@@ -310,7 +331,7 @@
310331 {}
311332 public:
312333 template<typename T>
313- operator iuParamGenerator<T>* (void) const
334+ operator iuIParamGenerator<T>* (void) const
314335 {
315336 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
316337 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -333,7 +354,7 @@
333354 {}
334355 public:
335356 template<typename T>
336- operator iuParamGenerator<T>* (void) const
357+ operator iuIParamGenerator<T>* (void) const
337358 {
338359 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
339360 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -358,7 +379,7 @@
358379 {}
359380 public:
360381 template<typename T>
361- operator iuParamGenerator<T>* (void) const
382+ operator iuIParamGenerator<T>* (void) const
362383 {
363384 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
364385 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -383,7 +404,7 @@
383404 {}
384405 public:
385406 template<typename T>
386- operator iuParamGenerator<T>* (void) const
407+ operator iuIParamGenerator<T>* (void) const
387408 {
388409 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
389410 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -408,7 +429,7 @@
408429 {}
409430 public:
410431 template<typename T>
411- operator iuParamGenerator<T>* (void) const
432+ operator iuIParamGenerator<T>* (void) const
412433 {
413434 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
414435 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -433,7 +454,7 @@
433454 {}
434455 public:
435456 template<typename T>
436- operator iuParamGenerator<T>* (void) const
457+ operator iuIParamGenerator<T>* (void) const
437458 {
438459 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
439460 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -458,7 +479,7 @@
458479 {}
459480 public:
460481 template<typename T>
461- operator iuParamGenerator<T>* (void) const
482+ operator iuIParamGenerator<T>* (void) const
462483 {
463484 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
464485 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -484,7 +505,7 @@
484505 {}
485506 public:
486507 template<typename T>
487- operator iuParamGenerator<T>* (void) const
508+ operator iuIParamGenerator<T>* (void) const
488509 {
489510 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
490511 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -510,7 +531,7 @@
510531 {}
511532 public:
512533 template<typename T>
513- operator iuParamGenerator<T>* (void) const
534+ operator iuIParamGenerator<T>* (void) const
514535 {
515536 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
516537 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -536,7 +557,7 @@
536557 {}
537558 public:
538559 template<typename T>
539- operator iuParamGenerator<T>* (void) const
560+ operator iuIParamGenerator<T>* (void) const
540561 {
541562 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
542563 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -562,7 +583,7 @@
562583 {}
563584 public:
564585 template<typename T>
565- operator iuParamGenerator<T>* (void) const
586+ operator iuIParamGenerator<T>* (void) const
566587 {
567588 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
568589 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -591,7 +612,7 @@
591612 {}
592613 public:
593614 template<typename T>
594- operator iuParamGenerator<T>* (void) const
615+ operator iuIParamGenerator<T>* (void) const
595616 {
596617 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
597618 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -622,7 +643,7 @@
622643 {}
623644 public:
624645 template<typename T>
625- operator iuParamGenerator<T>* (void) const
646+ operator iuIParamGenerator<T>* (void) const
626647 {
627648 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
628649 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -653,7 +674,7 @@
653674 {}
654675 public:
655676 template<typename T>
656- operator iuParamGenerator<T>* (void) const
677+ operator iuIParamGenerator<T>* (void) const
657678 {
658679 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
659680 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -684,7 +705,7 @@
684705 {}
685706 public:
686707 template<typename T>
687- operator iuParamGenerator<T>* (void) const
708+ operator iuIParamGenerator<T>* (void) const
688709 {
689710 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
690711 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -715,7 +736,7 @@
715736 {}
716737 public:
717738 template<typename T>
718- operator iuParamGenerator<T>* (void) const
739+ operator iuIParamGenerator<T>* (void) const
719740 {
720741 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
721742 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -746,7 +767,7 @@
746767 {}
747768 public:
748769 template<typename T>
749- operator iuParamGenerator<T>* (void) const
770+ operator iuIParamGenerator<T>* (void) const
750771 {
751772 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
752773 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -778,7 +799,7 @@
778799 {}
779800 public:
780801 template<typename T>
781- operator iuParamGenerator<T>* (void) const
802+ operator iuIParamGenerator<T>* (void) const
782803 {
783804 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
784805 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -810,7 +831,7 @@
810831 {}
811832 public:
812833 template<typename T>
813- operator iuParamGenerator<T>* (void) const
834+ operator iuIParamGenerator<T>* (void) const
814835 {
815836 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
816837 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -842,7 +863,7 @@
842863 {}
843864 public:
844865 template<typename T>
845- operator iuParamGenerator<T>* (void) const
866+ operator iuIParamGenerator<T>* (void) const
846867 {
847868 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
848869 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -874,7 +895,7 @@
874895 {}
875896 public:
876897 template<typename T>
877- operator iuParamGenerator<T>* (void) const
898+ operator iuIParamGenerator<T>* (void) const
878899 {
879900 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
880901 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -909,7 +930,7 @@
909930 {}
910931 public:
911932 template<typename T>
912- operator iuParamGenerator<T>* (void) const
933+ operator iuIParamGenerator<T>* (void) const
913934 {
914935 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
915936 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -946,7 +967,7 @@
946967 {}
947968 public:
948969 template<typename T>
949- operator iuParamGenerator<T>* (void) const
970+ operator iuIParamGenerator<T>* (void) const
950971 {
951972 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
952973 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -983,7 +1004,7 @@
9831004 {}
9841005 public:
9851006 template<typename T>
986- operator iuParamGenerator<T>* (void) const
1007+ operator iuIParamGenerator<T>* (void) const
9871008 {
9881009 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
9891010 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1020,7 +1041,7 @@
10201041 {}
10211042 public:
10221043 template<typename T>
1023- operator iuParamGenerator<T>* (void) const
1044+ operator iuIParamGenerator<T>* (void) const
10241045 {
10251046 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
10261047 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1057,7 +1078,7 @@
10571078 {}
10581079 public:
10591080 template<typename T>
1060- operator iuParamGenerator<T>* (void) const
1081+ operator iuIParamGenerator<T>* (void) const
10611082 {
10621083 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
10631084 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1094,7 +1115,7 @@
10941115 {}
10951116 public:
10961117 template<typename T>
1097- operator iuParamGenerator<T>* (void) const
1118+ operator iuIParamGenerator<T>* (void) const
10981119 {
10991120 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
11001121 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1132,7 +1153,7 @@
11321153 {}
11331154 public:
11341155 template<typename T>
1135- operator iuParamGenerator<T>* (void) const
1156+ operator iuIParamGenerator<T>* (void) const
11361157 {
11371158 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
11381159 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1170,7 +1191,7 @@
11701191 {}
11711192 public:
11721193 template<typename T>
1173- operator iuParamGenerator<T>* (void) const
1194+ operator iuIParamGenerator<T>* (void) const
11741195 {
11751196 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
11761197 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1208,7 +1229,7 @@
12081229 {}
12091230 public:
12101231 template<typename T>
1211- operator iuParamGenerator<T>* (void) const
1232+ operator iuIParamGenerator<T>* (void) const
12121233 {
12131234 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
12141235 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1246,7 +1267,7 @@
12461267 {}
12471268 public:
12481269 template<typename T>
1249- operator iuParamGenerator<T>* (void) const
1270+ operator iuIParamGenerator<T>* (void) const
12501271 {
12511272 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
12521273 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1287,7 +1308,7 @@
12871308 {}
12881309 public:
12891310 template<typename T>
1290- operator iuParamGenerator<T>* (void) const
1311+ operator iuIParamGenerator<T>* (void) const
12911312 {
12921313 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
12931314 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1330,7 +1351,7 @@
13301351 {}
13311352 public:
13321353 template<typename T>
1333- operator iuParamGenerator<T>* (void) const
1354+ operator iuIParamGenerator<T>* (void) const
13341355 {
13351356 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
13361357 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1373,7 +1394,7 @@
13731394 {}
13741395 public:
13751396 template<typename T>
1376- operator iuParamGenerator<T>* (void) const
1397+ operator iuIParamGenerator<T>* (void) const
13771398 {
13781399 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
13791400 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1416,7 +1437,7 @@
14161437 {}
14171438 public:
14181439 template<typename T>
1419- operator iuParamGenerator<T>* (void) const
1440+ operator iuIParamGenerator<T>* (void) const
14201441 {
14211442 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
14221443 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1459,7 +1480,7 @@
14591480 {}
14601481 public:
14611482 template<typename T>
1462- operator iuParamGenerator<T>* (void) const
1483+ operator iuIParamGenerator<T>* (void) const
14631484 {
14641485 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
14651486 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1502,7 +1523,7 @@
15021523 {}
15031524 public:
15041525 template<typename T>
1505- operator iuParamGenerator<T>* (void) const
1526+ operator iuIParamGenerator<T>* (void) const
15061527 {
15071528 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
15081529 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1546,7 +1567,7 @@
15461567 {}
15471568 public:
15481569 template<typename T>
1549- operator iuParamGenerator<T>* (void) const
1570+ operator iuIParamGenerator<T>* (void) const
15501571 {
15511572 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
15521573 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1590,7 +1611,7 @@
15901611 {}
15911612 public:
15921613 template<typename T>
1593- operator iuParamGenerator<T>* (void) const
1614+ operator iuIParamGenerator<T>* (void) const
15941615 {
15951616 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
15961617 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1634,7 +1655,7 @@
16341655 {}
16351656 public:
16361657 template<typename T>
1637- operator iuParamGenerator<T>* (void) const
1658+ operator iuIParamGenerator<T>* (void) const
16381659 {
16391660 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
16401661 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1678,7 +1699,7 @@
16781699 {}
16791700 public:
16801701 template<typename T>
1681- operator iuParamGenerator<T>* (void) const
1702+ operator iuIParamGenerator<T>* (void) const
16821703 {
16831704 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
16841705 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1725,7 +1746,7 @@
17251746 {}
17261747 public:
17271748 template<typename T>
1728- operator iuParamGenerator<T>* (void) const
1749+ operator iuIParamGenerator<T>* (void) const
17291750 {
17301751 const T val[] = { static_cast<T>(v1), static_cast<T>(v2), static_cast<T>(v3), static_cast<T>(v4)
17311752 , static_cast<T>(v5), static_cast<T>(v6), static_cast<T>(v7), static_cast<T>(v8), static_cast<T>(v9)
@@ -1752,18 +1773,13 @@
17521773
17531774 #if IUTEST_HAS_COMBINE
17541775
1755-template<typename T1, typename T2>
1756-class iuCartesianProductGenerator2 : public iuParamGenerator< std::tr1::tuple<T1, T2> >
1776+template<typename Generator1, typename Generator2, typename ParamType>
1777+class iuICartesianProductGeneratorBase : public iuIParamGenerator< ParamType >
17571778 {
1758- typedef iuParamGenerator<T1> Generator1;
1759- typedef iuParamGenerator<T2> Generator2;
17601779 public:
1761- typedef std::tr1::tuple<T1, T2> ParamType;
1762-public:
1763- iuCartesianProductGenerator2(const Generator1& g1, const Generator2& g2)
1780+ iuICartesianProductGeneratorBase(const Generator1& g1, const Generator2& g2)
17641781 : m_g1(g1), m_g2(g2)
17651782 {}
1766-
17671783 public:
17681784 virtual void Begin(void)
17691785 {
@@ -1770,21 +1786,15 @@
17701786 m_g1.Begin();
17711787 m_g2.Begin();
17721788 }
1773- virtual ParamType GetCurrent(void) const
1774- {
1775- return ParamType(m_g1.GetCurrent(), m_g2.GetCurrent());
1776- }
17771789 virtual void Next(void)
17781790 {
1791+ if( m_g2.IsEnd() ) return;
1792+ m_g2.Next();
17791793 if( m_g2.IsEnd() )
17801794 {
17811795 m_g1.Next();
1782- m_g2.Begin();
1796+ if( !m_g1.IsEnd() ) m_g2.Begin();
17831797 }
1784- else
1785- {
1786- m_g2.Next();
1787- }
17881798 }
17891799 virtual bool IsEnd(void) const
17901800 {
@@ -1791,11 +1801,512 @@
17911801 return m_g1.IsEnd() && m_g2.IsEnd();
17921802 }
17931803
1804+protected:
1805+ Generator1 m_g1;
1806+ Generator2 m_g2;
1807+};
1808+
1809+template<typename T1, typename T2>
1810+class iuCartesianProductGenerator2 : public iuICartesianProductGeneratorBase<iuParamGenerator<T1>, iuParamGenerator<T2>, std::tr1::tuple<T1, T2> >
1811+{
1812+ typedef iuICartesianProductGeneratorBase<iuParamGenerator<T1>, iuParamGenerator<T2>, std::tr1::tuple<T1, T2> > _Mybase;
1813+ typedef iuParamGenerator<T1> Generator1;
1814+ typedef iuParamGenerator<T2> Generator2;
1815+public:
1816+ typedef std::tr1::tuple<T1, T2> ParamType;
1817+
1818+public:
1819+ iuCartesianProductGenerator2(const Generator1& g1, const Generator2& g2)
1820+ : _Mybase(g1, g2)
1821+ {}
1822+
1823+public:
1824+ virtual ParamType GetCurrent(void) const
1825+ {
1826+ return ParamType(this->m_g1.GetCurrent(), this->m_g2.GetCurrent());
1827+ }
1828+};
1829+
1830+template<typename T1, typename T2, typename T3>
1831+class iuCartesianProductGenerator3 : public iuICartesianProductGeneratorBase<iuParamGenerator<T1>
1832+ , iuCartesianProductGenerator2<T2, T3>
1833+ , std::tr1::tuple<T1, T2, T3> >
1834+{
1835+ typedef iuICartesianProductGeneratorBase<iuParamGenerator<T1>, iuCartesianProductGenerator2<T2, T3>, std::tr1::tuple<T1, T2, T3> > _Mybase;
1836+ typedef iuParamGenerator<T1> Generator1;
1837+ typedef iuParamGenerator<T2> Generator2;
1838+ typedef iuParamGenerator<T3> Generator3;
1839+public:
1840+ typedef std::tr1::tuple<T1, T2, T3> ParamType;
1841+public:
1842+ iuCartesianProductGenerator3(const Generator1& g1, const Generator2& g2, const Generator3& g3)
1843+ : _Mybase(g1, iuCartesianProductGenerator2<T2, T3>(g2, g3))
1844+ {}
1845+
1846+public:
1847+ virtual ParamType GetCurrent(void) const
1848+ {
1849+ std::tr1::tuple<T2, T3> param(this->m_g2.GetCurrent());
1850+ return ParamType(this->m_g1.GetCurrent(), std::tr1::get<0>(param), std::tr1::get<1>(param) );
1851+ }
1852+};
1853+
1854+template<typename T1, typename T2, typename T3, typename T4>
1855+class iuCartesianProductGenerator4 : public iuICartesianProductGeneratorBase<iuParamGenerator<T1>
1856+ , iuCartesianProductGenerator3<T2, T3, T4>
1857+ , std::tr1::tuple<T1, T2, T3, T4> >
1858+{
1859+ typedef iuICartesianProductGeneratorBase<iuParamGenerator<T1>
1860+ , iuCartesianProductGenerator3<T2, T3, T4>
1861+ , std::tr1::tuple<T1, T2, T3, T4> > _Mybase;
1862+
1863+ typedef iuParamGenerator<T1> Generator1;
1864+ typedef iuParamGenerator<T2> Generator2;
1865+ typedef iuParamGenerator<T3> Generator3;
1866+ typedef iuParamGenerator<T4> Generator4;
1867+public:
1868+ typedef std::tr1::tuple<T1, T2, T3, T4> ParamType;
1869+public:
1870+ iuCartesianProductGenerator4(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4)
1871+ : _Mybase(g1, iuCartesianProductGenerator3<T2, T3, T4>(g2, g3, g4))
1872+ {}
1873+
1874+public:
1875+ virtual ParamType GetCurrent(void) const
1876+ {
1877+ std::tr1::tuple<T2, T3, T4> param(this->m_g2.GetCurrent());
1878+ return ParamType(this->m_g1.GetCurrent(), std::tr1::get<0>(param), std::tr1::get<1>(param), std::tr1::get<2>(param));
1879+ }
1880+};
1881+
1882+template<typename T1, typename T2, typename T3, typename T4, typename T5>
1883+class iuCartesianProductGenerator5 : public iuICartesianProductGeneratorBase<iuParamGenerator<T1>
1884+ , iuCartesianProductGenerator4<T2, T3, T4, T5>
1885+ , std::tr1::tuple<T1, T2, T3, T4, T5> >
1886+{
1887+ typedef iuICartesianProductGeneratorBase<iuParamGenerator<T1>
1888+ , iuCartesianProductGenerator4<T2, T3, T4, T5>
1889+ , std::tr1::tuple<T1, T2, T3, T4, T5> > _Mybase;
1890+
1891+ typedef iuParamGenerator<T1> Generator1;
1892+ typedef iuParamGenerator<T2> Generator2;
1893+ typedef iuParamGenerator<T3> Generator3;
1894+ typedef iuParamGenerator<T4> Generator4;
1895+ typedef iuParamGenerator<T5> Generator5;
1896+public:
1897+ typedef std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
1898+public:
1899+ iuCartesianProductGenerator5(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5)
1900+ : _Mybase(g1, iuCartesianProductGenerator4<T2, T3, T4, T5>(g2, g3, g4, g5))
1901+ {}
1902+
1903+public:
1904+ virtual ParamType GetCurrent(void) const
1905+ {
1906+ std::tr1::tuple<T2, T3, T4, T5> param(this->m_g2.GetCurrent());
1907+ return ParamType(this->m_g1.GetCurrent(), std::tr1::get<0>(param), std::tr1::get<1>(param), std::tr1::get<2>(param), std::tr1::get<3>(param) );
1908+ }
1909+};
1910+
1911+template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
1912+class iuCartesianProductGenerator6 : public iuICartesianProductGeneratorBase<iuParamGenerator<T1>
1913+ , iuCartesianProductGenerator5<T2, T3, T4, T5, T6>
1914+ , std::tr1::tuple<T1, T2, T3, T4, T5, T6> >
1915+{
1916+ typedef iuICartesianProductGeneratorBase<iuParamGenerator<T1>
1917+ , iuCartesianProductGenerator5<T2, T3, T4, T5, T6>
1918+ , std::tr1::tuple<T1, T2, T3, T4, T5, T6> > _Mybase;
1919+
1920+ typedef iuParamGenerator<T1> Generator1;
1921+ typedef iuParamGenerator<T2> Generator2;
1922+ typedef iuParamGenerator<T3> Generator3;
1923+ typedef iuParamGenerator<T4> Generator4;
1924+ typedef iuParamGenerator<T5> Generator5;
1925+ typedef iuParamGenerator<T6> Generator6;
1926+public:
1927+ typedef std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
1928+public:
1929+ iuCartesianProductGenerator6(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5
1930+ , const Generator6& g6)
1931+ : _Mybase(g1, iuCartesianProductGenerator5<T2, T3, T4, T5, T6>(g2, g3, g4, g5, g6))
1932+ {}
1933+
1934+public:
1935+ virtual ParamType GetCurrent(void) const
1936+ {
1937+ std::tr1::tuple<T2, T3, T4, T5, T6> param(this->m_g2.GetCurrent());
1938+ return ParamType(this->m_g1.GetCurrent(), std::tr1::get<0>(param), std::tr1::get<1>(param), std::tr1::get<2>(param), std::tr1::get<3>(param), std::tr1::get<4>(param) );
1939+ }
1940+};
1941+
1942+template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
1943+class iuCartesianProductGenerator7 : public iuICartesianProductGeneratorBase<iuParamGenerator<T1>
1944+ , iuCartesianProductGenerator6<T2, T3, T4, T5, T6, T7>
1945+ , std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >
1946+{
1947+ typedef iuICartesianProductGeneratorBase<iuParamGenerator<T1>
1948+ , iuCartesianProductGenerator6<T2, T3, T4, T5, T6, T7>
1949+ , std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> > _Mybase;
1950+
1951+ typedef iuParamGenerator<T1> Generator1;
1952+ typedef iuParamGenerator<T2> Generator2;
1953+ typedef iuParamGenerator<T3> Generator3;
1954+ typedef iuParamGenerator<T4> Generator4;
1955+ typedef iuParamGenerator<T5> Generator5;
1956+ typedef iuParamGenerator<T6> Generator6;
1957+ typedef iuParamGenerator<T7> Generator7;
1958+public:
1959+ typedef std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
1960+public:
1961+ iuCartesianProductGenerator7(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5
1962+ , const Generator6& g6, const Generator7& g7)
1963+ : _Mybase(g1, iuCartesianProductGenerator6<T2, T3, T4, T5, T6, T7>(g2, g3, g4, g5, g6, g7))
1964+ {}
1965+
1966+public:
1967+ virtual ParamType GetCurrent(void) const
1968+ {
1969+ std::tr1::tuple<T2, T3, T4, T5, T6, T7> param(this->m_g2.GetCurrent());
1970+ return ParamType(this->m_g1.GetCurrent(), std::tr1::get<0>(param), std::tr1::get<1>(param), std::tr1::get<2>(param), std::tr1::get<3>(param), std::tr1::get<4>(param)
1971+ , std::tr1::get<5>(param) );
1972+ }
1973+};
1974+
1975+template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
1976+class iuCartesianProductGenerator8 : public iuICartesianProductGeneratorBase<iuParamGenerator<T1>
1977+ , iuCartesianProductGenerator7<T2, T3, T4, T5, T6, T7, T8>
1978+ , std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >
1979+{
1980+ typedef iuICartesianProductGeneratorBase<iuParamGenerator<T1>
1981+ , iuCartesianProductGenerator7<T2, T3, T4, T5, T6, T7, T8>
1982+ , std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> > _Mybase;
1983+
1984+ typedef iuParamGenerator<T1> Generator1;
1985+ typedef iuParamGenerator<T2> Generator2;
1986+ typedef iuParamGenerator<T3> Generator3;
1987+ typedef iuParamGenerator<T4> Generator4;
1988+ typedef iuParamGenerator<T5> Generator5;
1989+ typedef iuParamGenerator<T6> Generator6;
1990+ typedef iuParamGenerator<T7> Generator7;
1991+ typedef iuParamGenerator<T8> Generator8;
1992+public:
1993+ typedef std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
1994+public:
1995+ iuCartesianProductGenerator8(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5
1996+ , const Generator6& g6, const Generator7& g7, const Generator8& g8)
1997+ : _Mybase(g1, iuCartesianProductGenerator7<T2, T3, T4, T5, T6, T7, T8>(g2, g3, g4, g5, g6, g7, g8))
1998+ {}
1999+
2000+public:
2001+ virtual ParamType GetCurrent(void) const
2002+ {
2003+ std::tr1::tuple<T2, T3, T4, T5, T6, T7, T8> param(this->m_g2.GetCurrent());
2004+ return ParamType(this->m_g1.GetCurrent(), std::tr1::get<0>(param), std::tr1::get<1>(param), std::tr1::get<2>(param), std::tr1::get<3>(param), std::tr1::get<4>(param)
2005+ , std::tr1::get<5>(param), std::tr1::get<6>(param) );
2006+ }
2007+};
2008+
2009+template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
2010+class iuCartesianProductGenerator9 : public iuICartesianProductGeneratorBase<iuParamGenerator<T1>
2011+ , iuCartesianProductGenerator8<T2, T3, T4, T5, T6, T7, T8, T9>
2012+ , std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> >
2013+{
2014+ typedef iuICartesianProductGeneratorBase<iuParamGenerator<T1>
2015+ , iuCartesianProductGenerator8<T2, T3, T4, T5, T6, T7, T8, T9>
2016+ , std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> > _Mybase;
2017+
2018+ typedef iuParamGenerator<T1> Generator1;
2019+ typedef iuParamGenerator<T2> Generator2;
2020+ typedef iuParamGenerator<T3> Generator3;
2021+ typedef iuParamGenerator<T4> Generator4;
2022+ typedef iuParamGenerator<T5> Generator5;
2023+ typedef iuParamGenerator<T6> Generator6;
2024+ typedef iuParamGenerator<T7> Generator7;
2025+ typedef iuParamGenerator<T8> Generator8;
2026+ typedef iuParamGenerator<T9> Generator9;
2027+public:
2028+ typedef std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T9, T8> ParamType;
2029+public:
2030+ iuCartesianProductGenerator9(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5
2031+ , const Generator6& g6, const Generator7& g7, const Generator8& g8, const Generator9& g9)
2032+ : _Mybase(g1, iuCartesianProductGenerator8<T2, T3, T4, T5, T6, T7, T8, T9>(g2, g3, g4, g5, g6, g7, g8, g9))
2033+ {}
2034+
2035+public:
2036+ virtual ParamType GetCurrent(void) const
2037+ {
2038+ std::tr1::tuple<T2, T3, T4, T5, T6, T7, T8, T9> param(this->m_g2.GetCurrent());
2039+ return ParamType(this->m_g1.GetCurrent(), std::tr1::get<0>(param), std::tr1::get<1>(param), std::tr1::get<2>(param), std::tr1::get<3>(param), std::tr1::get<4>(param)
2040+ , std::tr1::get<5>(param), std::tr1::get<6>(param), std::tr1::get<7>(param) );
2041+ }
2042+};
2043+
2044+// iuCartesianProductHolder
2045+
2046+template<typename Generator1, typename Generator2>
2047+class iuCartesianProductHolder2
2048+{
2049+ typedef iuCartesianProductHolder2<Generator1, Generator2> _Myt;
2050+public:
2051+ iuCartesianProductHolder2(const Generator1& g1, const Generator2& g2)
2052+ : m_g1(g1), m_g2(g2) {}
2053+
2054+public:
2055+ template<typename T1, typename T2>
2056+ operator iuIParamGenerator< std::tr1::tuple<T1, T2> >* () const
2057+ {
2058+ return new iuCartesianProductGenerator2<T1, T2>(
2059+ static_cast< iuIParamGenerator<T1>* >(m_g1)
2060+ , static_cast< iuIParamGenerator<T2>* >(m_g2)
2061+ );
2062+ }
2063+
17942064 private:
2065+ void operator = (const _Myt&) {}
2066+private:
17952067 const Generator1 m_g1;
17962068 const Generator2 m_g2;
17972069 };
17982070
2071+template<typename Generator1, typename Generator2, typename Generator3>
2072+class iuCartesianProductHolder3
2073+{
2074+ typedef iuCartesianProductHolder3<Generator1, Generator2, Generator3> _Myt;
2075+public:
2076+ iuCartesianProductHolder3(const Generator1& g1, const Generator2& g2, const Generator3& g3)
2077+ : m_g1(g1), m_g2(g2), m_g3(g3) {}
2078+
2079+public:
2080+ template<typename T1, typename T2, typename T3>
2081+ operator iuIParamGenerator< std::tr1::tuple<T1, T2, T3> >* () const
2082+ {
2083+ return new iuCartesianProductGenerator3<T1, T2, T3>(
2084+ static_cast< iuIParamGenerator<T1>* >(m_g1)
2085+ , static_cast< iuIParamGenerator<T2>* >(m_g2)
2086+ , static_cast< iuIParamGenerator<T3>* >(m_g3)
2087+ );
2088+ }
2089+
2090+private:
2091+ void operator = (const _Myt&) {}
2092+private:
2093+ const Generator1 m_g1;
2094+ const Generator2 m_g2;
2095+ const Generator3 m_g3;
2096+};
2097+
2098+template<typename Generator1, typename Generator2, typename Generator3, typename Generator4>
2099+class iuCartesianProductHolder4
2100+{
2101+ typedef iuCartesianProductHolder4<Generator1, Generator2, Generator3, Generator4> _Myt;
2102+public:
2103+ iuCartesianProductHolder4(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4)
2104+ : m_g1(g1), m_g2(g2), m_g3(g3), m_g4(g4) {}
2105+
2106+public:
2107+ template<typename T1, typename T2, typename T3, typename T4>
2108+ operator iuIParamGenerator< std::tr1::tuple<T1, T2, T3, T4> >* () const
2109+ {
2110+ return new iuCartesianProductGenerator4<T1, T2, T3, T4>(
2111+ static_cast< iuIParamGenerator<T1>* >(m_g1)
2112+ , static_cast< iuIParamGenerator<T2>* >(m_g2)
2113+ , static_cast< iuIParamGenerator<T3>* >(m_g3)
2114+ , static_cast< iuIParamGenerator<T4>* >(m_g4)
2115+ );
2116+ }
2117+
2118+private:
2119+ void operator = (const _Myt&) {}
2120+private:
2121+ const Generator1 m_g1;
2122+ const Generator2 m_g2;
2123+ const Generator3 m_g3;
2124+ const Generator4 m_g4;
2125+};
2126+
2127+template<typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5>
2128+class iuCartesianProductHolder5
2129+{
2130+ typedef iuCartesianProductHolder5<Generator1, Generator2, Generator3, Generator4, Generator5> _Myt;
2131+public:
2132+ iuCartesianProductHolder5(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5)
2133+ : m_g1(g1), m_g2(g2), m_g3(g3), m_g4(g4), m_g5(g5) {}
2134+
2135+public:
2136+ template<typename T1, typename T2, typename T3, typename T4, typename T5>
2137+ operator iuIParamGenerator< std::tr1::tuple<T1, T2, T3, T4, T5> >* () const
2138+ {
2139+ return new iuCartesianProductGenerator5<T1, T2, T3, T4, T5>(
2140+ static_cast< iuIParamGenerator<T1>* >(m_g1)
2141+ , static_cast< iuIParamGenerator<T2>* >(m_g2)
2142+ , static_cast< iuIParamGenerator<T3>* >(m_g3)
2143+ , static_cast< iuIParamGenerator<T4>* >(m_g4)
2144+ , static_cast< iuIParamGenerator<T5>* >(m_g5)
2145+ );
2146+ }
2147+
2148+private:
2149+ void operator = (const _Myt&) {}
2150+private:
2151+ const Generator1 m_g1;
2152+ const Generator2 m_g2;
2153+ const Generator3 m_g3;
2154+ const Generator4 m_g4;
2155+ const Generator5 m_g5;
2156+};
2157+
2158+template<typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5
2159+, typename Generator6>
2160+class iuCartesianProductHolder6
2161+{
2162+ typedef iuCartesianProductHolder6<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6> _Myt;
2163+public:
2164+ iuCartesianProductHolder6(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5
2165+ , const Generator6& g6)
2166+ : m_g1(g1), m_g2(g2), m_g3(g3), m_g4(g4), m_g5(g5), m_g6(g6) {}
2167+
2168+public:
2169+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
2170+ operator iuIParamGenerator< std::tr1::tuple<T1, T2, T3, T4, T5, T6> >* () const
2171+ {
2172+ return new iuCartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
2173+ static_cast< iuIParamGenerator<T1>* >(m_g1)
2174+ , static_cast< iuIParamGenerator<T2>* >(m_g2)
2175+ , static_cast< iuIParamGenerator<T3>* >(m_g3)
2176+ , static_cast< iuIParamGenerator<T4>* >(m_g4)
2177+ , static_cast< iuIParamGenerator<T5>* >(m_g5)
2178+ , static_cast< iuIParamGenerator<T6>* >(m_g6)
2179+ );
2180+ }
2181+
2182+private:
2183+ void operator = (const _Myt&) {}
2184+private:
2185+ const Generator1 m_g1;
2186+ const Generator2 m_g2;
2187+ const Generator3 m_g3;
2188+ const Generator4 m_g4;
2189+ const Generator5 m_g5;
2190+ const Generator6 m_g6;
2191+};
2192+
2193+template<typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5
2194+, typename Generator6, typename Generator7>
2195+class iuCartesianProductHolder7
2196+{
2197+ typedef iuCartesianProductHolder7<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7> _Myt;
2198+public:
2199+ iuCartesianProductHolder7(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5
2200+ , const Generator6& g6, const Generator7& g7)
2201+ : m_g1(g1), m_g2(g2), m_g3(g3), m_g4(g4), m_g5(g5), m_g6(g6), m_g7(g7) {}
2202+
2203+public:
2204+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
2205+ operator iuIParamGenerator< std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >* () const
2206+ {
2207+ return new iuCartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
2208+ static_cast< iuIParamGenerator<T1>* >(m_g1)
2209+ , static_cast< iuIParamGenerator<T2>* >(m_g2)
2210+ , static_cast< iuIParamGenerator<T3>* >(m_g3)
2211+ , static_cast< iuIParamGenerator<T4>* >(m_g4)
2212+ , static_cast< iuIParamGenerator<T5>* >(m_g5)
2213+ , static_cast< iuIParamGenerator<T6>* >(m_g6)
2214+ , static_cast< iuIParamGenerator<T7>* >(m_g7)
2215+ );
2216+ }
2217+
2218+private:
2219+ void operator = (const _Myt&) {}
2220+private:
2221+ const Generator1 m_g1;
2222+ const Generator2 m_g2;
2223+ const Generator3 m_g3;
2224+ const Generator4 m_g4;
2225+ const Generator5 m_g5;
2226+ const Generator6 m_g6;
2227+ const Generator7 m_g7;
2228+};
2229+
2230+template<typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5
2231+, typename Generator6, typename Generator7, typename Generator8>
2232+class iuCartesianProductHolder8
2233+{
2234+ typedef iuCartesianProductHolder8<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8> _Myt;
2235+public:
2236+ iuCartesianProductHolder8(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5
2237+ , const Generator6& g6, const Generator7& g7, const Generator8& g8)
2238+ : m_g1(g1), m_g2(g2), m_g3(g3), m_g4(g4), m_g5(g5), m_g6(g6), m_g7(g7), m_g8(g8) {}
2239+
2240+public:
2241+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
2242+ operator iuIParamGenerator< std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >* () const
2243+ {
2244+ return new iuCartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
2245+ static_cast< iuIParamGenerator<T1>* >(m_g1)
2246+ , static_cast< iuIParamGenerator<T2>* >(m_g2)
2247+ , static_cast< iuIParamGenerator<T3>* >(m_g3)
2248+ , static_cast< iuIParamGenerator<T4>* >(m_g4)
2249+ , static_cast< iuIParamGenerator<T5>* >(m_g5)
2250+ , static_cast< iuIParamGenerator<T6>* >(m_g6)
2251+ , static_cast< iuIParamGenerator<T7>* >(m_g7)
2252+ , static_cast< iuIParamGenerator<T8>* >(m_g8)
2253+ );
2254+ }
2255+
2256+private:
2257+ void operator = (const _Myt&) {}
2258+private:
2259+ const Generator1 m_g1;
2260+ const Generator2 m_g2;
2261+ const Generator3 m_g3;
2262+ const Generator4 m_g4;
2263+ const Generator5 m_g5;
2264+ const Generator6 m_g6;
2265+ const Generator7 m_g7;
2266+ const Generator8 m_g8;
2267+};
2268+
2269+template<typename Generator1, typename Generator2, typename Generator3, typename Generator4, typename Generator5
2270+, typename Generator6, typename Generator7, typename Generator8, typename Generator9>
2271+class iuCartesianProductHolder9
2272+{
2273+ typedef iuCartesianProductHolder9<Generator1, Generator2, Generator3, Generator4, Generator5, Generator6, Generator7, Generator8, Generator9> _Myt;
2274+public:
2275+ iuCartesianProductHolder9(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5
2276+ , const Generator6& g6, const Generator7& g7, const Generator8& g8, const Generator9& g9)
2277+ : m_g1(g1), m_g2(g2), m_g3(g3), m_g4(g4), m_g5(g5), m_g6(g6), m_g7(g7), m_g8(g8), m_g9(g9) {}
2278+
2279+public:
2280+ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
2281+ operator iuIParamGenerator< std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> >* () const
2282+ {
2283+ return new iuCartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
2284+ static_cast< iuIParamGenerator<T1>* >(m_g1)
2285+ , static_cast< iuIParamGenerator<T2>* >(m_g2)
2286+ , static_cast< iuIParamGenerator<T3>* >(m_g3)
2287+ , static_cast< iuIParamGenerator<T4>* >(m_g4)
2288+ , static_cast< iuIParamGenerator<T5>* >(m_g5)
2289+ , static_cast< iuIParamGenerator<T6>* >(m_g6)
2290+ , static_cast< iuIParamGenerator<T7>* >(m_g7)
2291+ , static_cast< iuIParamGenerator<T8>* >(m_g8)
2292+ , static_cast< iuIParamGenerator<T9>* >(m_g9)
2293+ );
2294+ }
2295+
2296+private:
2297+ void operator = (const _Myt&) {}
2298+private:
2299+ const Generator1 m_g1;
2300+ const Generator2 m_g2;
2301+ const Generator3 m_g3;
2302+ const Generator4 m_g4;
2303+ const Generator5 m_g5;
2304+ const Generator6 m_g6;
2305+ const Generator7 m_g7;
2306+ const Generator8 m_g8;
2307+ const Generator9 m_g9;
2308+};
2309+
17992310 #endif
18002311
18012312
--- trunk/framework/testsuite/iutest/include/internal/iutest_params_util.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_params_util.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -68,7 +68,7 @@
6868 {
6969 typedef T Tester;
7070 typedef typename Tester::ParamType ParamType;
71- typedef detail::iuParamGenerator<ParamType> ParamGenerator;
71+ typedef detail::iuIParamGenerator<ParamType> ParamGenerator;
7272 typedef typename ParamGenerator::Generator Generator;
7373 typedef ITestInfoData<ParamType> TestInfoData;
7474
--- trunk/framework/testsuite/iutest/include/internal/iutest_typed_util.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_typed_util.h (revision 254)
@@ -5,10 +5,10 @@
55 * @brief iris unit test typed util ファイル
66 *
77 * @author t.sirayanagi
8- * @typedsion 1.0
8+ * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -19,7 +19,7 @@
1919
2020 //======================================================================
2121 // include
22-#include "iutest_util.h"
22+#include "iutest_internal_defs.h"
2323 #include "iutest_typelist.h"
2424
2525 namespace iutest
--- trunk/framework/testsuite/iutest/include/iutest_pred.h (revision 253)
+++ trunk/framework/testsuite/iutest/include/iutest_pred.h (revision 254)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
@@ -19,7 +19,6 @@
1919
2020 //======================================================================
2121 // include
22-#include "internal/iutest_util.h"
2322 #include "iutest_assertion.h"
2423
2524 //======================================================================
--- trunk/framework/testsuite/iutest/samples/main.cpp (revision 253)
+++ trunk/framework/testsuite/iutest/samples/main.cpp (revision 254)
@@ -7,7 +7,8 @@
77 /*
88 * include testing framework
99 */
10-#include "../include/iutest.h"
10+//#include "../include/iutest.h"
11+#include "../include/gtest/iutest_switch.h"
1112
1213 class FooEnvironment : public iutest::Environment
1314 {
@@ -54,7 +55,7 @@
5455
5556 IUTEST(Test, Test1)
5657 {
57- IUTEST_ASSERT_STREQ("Test1", iutest::UnitTest::current_test_info()->name());
58+ IUTEST_ASSERT_STREQ("Test1", iutest::UnitTest::GetInstance()->current_test_info()->name());
5859 }
5960
6061 IUTEST(Test, Test2)
@@ -162,7 +163,7 @@
162163 }
163164 };
164165 int TestPValueIn::a = 0;
165-IUTEST_INSTANTIATE_TEST_CASE_P(TestPValueInInstance, TestPValueIn, iutest::ValueIn(ValueInTestText));
166+IUTEST_INSTANTIATE_TEST_CASE_P(TestPValueInInstance, TestPValueIn, iutest::ValuesIn(ValueInTestText));
166167
167168 IUTEST_P(TestPValueIn, TestA)
168169 {
@@ -202,8 +203,26 @@
202203 IUTEST_ASSERT_EQ(a++, GetParam());
203204 }
204205
206+#if IUTEST_HAS_COMBINE
207+
208+class TestPCombine : public iutest::TestWithParam< std::tr1::tuple<bool, int, int> >
209+{
210+};
211+
212+IUTEST_P(TestPCombine, TestA)
213+{
214+ bool b = ::std::tr1::get<0>(GetParam());
215+ int i1 = ::std::tr1::get<1>(GetParam());
216+ int i2 = ::std::tr1::get<2>(GetParam());
217+ IUTEST_SUCCEED() << b << ", " << i1 << ", " << i2;
218+}
219+
220+IUTEST_INSTANTIATE_TEST_CASE_P(TestPCombineInstance, TestPCombine
221+ , iutest::Combine( iutest::Bool(), iutest::Values(1, 2), iutest::Values(10, 11) ) );
205222 #endif
206223
224+#endif
225+
207226 /**
208227 * 各種テストマクロ
209228 */
@@ -301,6 +320,8 @@
301320 IUTEST_ASSERT_STRLNEQ(4, e);
302321 }
303322
323+#if IUTEST_HAS_PRED_FORMAT_OR
324+
304325 IUTEST(TestOp, OREQ)
305326 {
306327 int x=1;
@@ -321,6 +342,8 @@
321342 IUTEST_ASSERT_PRED_FORMAT5(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, x, 2, 3, 0, 1);
322343 }
323344
345+#endif
346+
324347 /**
325348 * 述語アサーション
326349 */
@@ -524,6 +547,8 @@
524547 #endif
525548
526549
550+#if IUTEST_HAS_GENRAND
551+
527552 IUTEST(TestExpectFailure, Random)
528553 {
529554 IUTEST_EXPECT_EQ( genrand(), genrand() );
@@ -534,6 +559,8 @@
534559 IUTEST_EXPECT_EQ( genrand(), genrand() );
535560 }
536561
562+#endif
563+
537564 IUTEST(TestExpectFailure, Pred)
538565 {
539566 int x=4, y=5;
@@ -541,6 +568,8 @@
541568 IUTEST_EXPECT_PRED2(IsGreater, x, y);
542569 }
543570
571+#if IUTEST_HAS_PRED_FORMAT_OR
572+
544573 IUTEST(TestExpectFailure, OREQ)
545574 {
546575 IUTEST_EXPECT_PRED_FORMAT2(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 0);
@@ -554,6 +583,7 @@
554583 IUTEST_EXPECT_PRED_FORMAT5(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 3, 0, 2, 1);
555584 IUTEST_EXPECT_PRED_FORMAT5(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 3, 2, 0, 1);
556585 }
586+#endif
557587
558588 #if !defined(IUTEST_NOT_SUPPORT_EXCEPTION)
559589 IUTEST(TestExpectFailure, Exception)
--- trunk/framework/testsuite/iutest/readme.txt (revision 253)
+++ trunk/framework/testsuite/iutest/readme.txt (revision 254)
@@ -40,7 +40,7 @@
4040 --------------------------------------------------
4141 License
4242
43- Copyright (c) 2011 Takazumi-Shirayanagi,
43+ Copyright (c) 2011-2012 Takazumi-Shirayanagi,
4444 All rights reserved.
4545
4646 The new(modified) BSD License is applied to this software, see LICENSE
Show on old repository browser