• R/O
  • SSH
  • HTTPS

iris-fmw: Commit


Commit MetaInfo

Revision256 (tree)
Time2012-01-10 18:40:30
Authorshirayanagi

Log Message

iutest v0.13.0.0
gtest 相互互換対応

Change Summary

Incremental Difference

--- trunk/framework/sample/Windows/unittest/src/nacl_test/iutest/main.cpp (revision 255)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/iutest/main.cpp (revision 256)
@@ -14,11 +14,11 @@
1414 {
1515 virtual void SetUp(void)
1616 {
17- iutest::detail::iuConsole::output("FooEnvironment::SetUp\n");
17+ iuutil::Console::output("FooEnvironment::SetUp\n");
1818 }
1919 virtual void TearDown(void)
2020 {
21- iutest::detail::iuConsole::output("FooEnvironment::TearDown\n");
21+ iuutil::Console::output("FooEnvironment::TearDown\n");
2222 }
2323 };
2424
@@ -172,7 +172,7 @@
172172
173173 // Param Test Values
174174 class TestPValues1 : public iutest::TestWithParam<float> {};
175-IUTEST_INSTANTIATE_TEST_CASE_P(TestPValues1Instance, TestPValues1, iutest::Values(1));
175+IUTEST_INSTANTIATE_TEST_CASE_P(TestPValues1Instance, TestPValues1, iutest::Values(1.0f));
176176
177177 IUTEST_P(TestPValues1, TestA)
178178 {
@@ -320,30 +320,26 @@
320320 IUTEST_ASSERT_STRLNEQ(4, e);
321321 }
322322
323-#if IUTEST_HAS_PRED_FORMAT_OR
324-
325323 IUTEST(TestOp, OREQ)
326324 {
327325 int x=1;
328- IUTEST_ASSERT_PRED_FORMAT2(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, x, 1);
329- IUTEST_ASSERT_PRED_FORMAT2(iutest::CompareHelperOR<iutest::CompareHelper::NE>::Comp, x, 0);
330- IUTEST_ASSERT_PRED_FORMAT2(iutest::CompareHelperOR<iutest::CompareHelper::LE>::Comp, x, 1);
331- IUTEST_ASSERT_PRED_FORMAT2(iutest::CompareHelperOR<iutest::CompareHelper::LT>::Comp, x, 2);
332- IUTEST_ASSERT_PRED_FORMAT2(iutest::CompareHelperOR<iutest::CompareHelper::GE>::Comp, x, 1);
333- IUTEST_ASSERT_PRED_FORMAT2(iutest::CompareHelperOR<iutest::CompareHelper::GT>::Comp, x, 0);
334- IUTEST_ASSERT_PRED_FORMAT3(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, x, 1, 0);
335- IUTEST_ASSERT_PRED_FORMAT3(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, x, 0, 1);
336- IUTEST_ASSERT_PRED_FORMAT4(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, x, 1, 2, 0);
337- IUTEST_ASSERT_PRED_FORMAT4(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, x, 0, 1, 2);
338- IUTEST_ASSERT_PRED_FORMAT4(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, x, 2, 0, 1);
339- IUTEST_ASSERT_PRED_FORMAT5(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, x, 1, 2, 3, 0);
340- IUTEST_ASSERT_PRED_FORMAT5(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, x, 0, 1, 2, 3);
341- IUTEST_ASSERT_PRED_FORMAT5(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, x, 3, 0, 1, 2);
342- IUTEST_ASSERT_PRED_FORMAT5(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, x, 2, 3, 0, 1);
326+ IUTEST_ASSERT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 1);
327+ IUTEST_ASSERT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::NE>::Comp, x, 0);
328+ IUTEST_ASSERT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::LE>::Comp, x, 1);
329+ IUTEST_ASSERT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::LT>::Comp, x, 2);
330+ IUTEST_ASSERT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::GE>::Comp, x, 1);
331+ IUTEST_ASSERT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::GT>::Comp, x, 0);
332+ IUTEST_ASSERT_PRED_FORMAT3(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 1, 0);
333+ IUTEST_ASSERT_PRED_FORMAT3(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 0, 1);
334+ IUTEST_ASSERT_PRED_FORMAT4(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 1, 2, 0);
335+ IUTEST_ASSERT_PRED_FORMAT4(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 0, 1, 2);
336+ IUTEST_ASSERT_PRED_FORMAT4(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 2, 0, 1);
337+ IUTEST_ASSERT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 1, 2, 3, 0);
338+ IUTEST_ASSERT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 0, 1, 2, 3);
339+ IUTEST_ASSERT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 3, 0, 1, 2);
340+ IUTEST_ASSERT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 2, 3, 0, 1);
343341 }
344342
345-#endif
346-
347343 /**
348344 * 述語アサーション
349345 */
@@ -568,22 +564,19 @@
568564 IUTEST_EXPECT_PRED2(IsGreater, x, y);
569565 }
570566
571-#if IUTEST_HAS_PRED_FORMAT_OR
572-
573567 IUTEST(TestExpectFailure, OREQ)
574568 {
575- IUTEST_EXPECT_PRED_FORMAT2(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 0);
576- IUTEST_EXPECT_PRED_FORMAT3(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 1, 0);
577- IUTEST_EXPECT_PRED_FORMAT3(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 0, 1);
578- IUTEST_EXPECT_PRED_FORMAT4(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 2, 1, 0);
579- IUTEST_EXPECT_PRED_FORMAT4(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 0, 2, 1);
580- IUTEST_EXPECT_PRED_FORMAT4(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 2, 0, 1);
581- IUTEST_EXPECT_PRED_FORMAT5(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 3, 2, 1, 0);
582- IUTEST_EXPECT_PRED_FORMAT5(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 0, 3, 2, 1);
583- IUTEST_EXPECT_PRED_FORMAT5(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 3, 0, 2, 1);
584- IUTEST_EXPECT_PRED_FORMAT5(iutest::CompareHelperOR<iutest::CompareHelper::EQ>::Comp, 100, 3, 2, 0, 1);
569+ IUTEST_EXPECT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 0);
570+ IUTEST_EXPECT_PRED_FORMAT3(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 1, 0);
571+ IUTEST_EXPECT_PRED_FORMAT3(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 0, 1);
572+ IUTEST_EXPECT_PRED_FORMAT4(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 2, 1, 0);
573+ IUTEST_EXPECT_PRED_FORMAT4(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 0, 2, 1);
574+ IUTEST_EXPECT_PRED_FORMAT4(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 2, 0, 1);
575+ IUTEST_EXPECT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 3, 2, 1, 0);
576+ IUTEST_EXPECT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 0, 3, 2, 1);
577+ IUTEST_EXPECT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 3, 0, 2, 1);
578+ IUTEST_EXPECT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 3, 2, 0, 1);
585579 }
586-#endif
587580
588581 #if !defined(IUTEST_NOT_SUPPORT_EXCEPTION)
589582 IUTEST(TestExpectFailure, Exception)
--- trunk/framework/src/fnd/container/FndObserver.h (revision 255)
+++ trunk/framework/src/fnd/container/FndObserver.h (revision 256)
@@ -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 */
--- trunk/framework/testsuite/iutest/include/iutest_ver.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/iutest_ver.h (revision 256)
@@ -22,16 +22,21 @@
2222
2323 //======================================================================
2424 // define
25-#define IUTEST_VER 0x00120001 //!< iutest version 0.12.0.1
25+#define IUTEST_VER 0x00130000 //!< iutest version 0.13.0.0
2626 #define IUTEST_MAJORVER 0x00
27-#define IUTEST_MINORVER 0x12
27+#define IUTEST_MINORVER 0x13
2828 #define IUTEST_BUILD 0x00
29-#define IUTEST_REVISION 0x01
29+#define IUTEST_REVISION 0x00
3030
3131 /**
3232 * @file iutest_ver.h
3333 * @par release note
3434 <ul>
35+ <li>v0.13.0.0
36+ <ul>
37+ <li>googletest との相互互換対応</li>
38+ </ul>
39+ </li>
3540 <li>v0.12.0.0
3641 <ul>
3742 <li>Combine対応/li>
--- trunk/framework/testsuite/iutest/include/gtest/LICENSE (nonexistent)
+++ trunk/framework/testsuite/iutest/include/gtest/LICENSE (revision 256)
@@ -0,0 +1,28 @@
1+Copyright 2008, Google Inc.
2+All rights reserved.
3+
4+Redistribution and use in source and binary forms, with or without
5+modification, are permitted provided that the following conditions are
6+met:
7+
8+ * Redistributions of source code must retain the above copyright
9+notice, this list of conditions and the following disclaimer.
10+ * Redistributions in binary form must reproduce the above
11+copyright notice, this list of conditions and the following disclaimer
12+in the documentation and/or other materials provided with the
13+distribution.
14+ * Neither the name of Google Inc. nor the names of its
15+contributors may be used to endorse or promote products derived from
16+this software without specific prior written permission.
17+
18+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--- trunk/framework/testsuite/iutest/include/gtest/iutest_switch.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/gtest/iutest_switch.h (revision 256)
@@ -115,12 +115,21 @@
115115 #undef GTEST_HAS_TYPED_TEST
116116 #undef GTEST_HAS_TYPED_TEST_P
117117
118+#ifdef GTEST_OS_CYGWIN
119+# undef GTEST_OS_CYGWIN
120+#endif
118121 #ifdef GTEST_OS_WINDOWS
119122 # undef GTEST_OS_WINDOWS
123+# ifdef GTEST_OS_WINDOWS_MOBILE
124+# undef GTEST_OS_WINDOWS_MOBILE
125+# endif
126+# ifdef GTEST_OS_WINDOWS_MINGW
127+# undef GTEST_OS_WINDOWS_MINGW
128+# endif
129+# ifdef GTEST_OS_WINDOWS_DESKTOP
130+# undef GTEST_OS_WINDOWS_DESKTOP
131+# endif
120132 #endif
121-#ifdef GTEST_OS_CYGWIN
122-# undef GTEST_OS_CYGWIN
123-#endif
124133 #ifdef GTEST_OS_LINUX
125134 # undef GTEST_OS_LINUX
126135 # ifdef GTEST_OS_LINUX_ANDROID
@@ -238,6 +247,15 @@
238247 #endif
239248 #ifdef IUTEST_OS_WINDOWS
240249 # define GTEST_OS_WINDOWS IUTEST_OS_WINDOWS
250+# ifdef IUTEST_OS_WINDOWS_MOBILE
251+# define GTEST_OS_WINDOWS_MOBILE IUTEST_OS_WINDOWS_MOBILE
252+# endif
253+# ifdef IUTEST_OS_WINDOWS_MINGW
254+# define GTEST_OS_WINDOWS_MINGW IUTEST_OS_WINDOWS_MINGW
255+# endif
256+# ifdef IUTEST_OS_WINDOWS_DESKTOP
257+# define GTEST_OS_WINDOWS_DESKTOP IUTEST_OS_WINDOWS_DESKTOP
258+# endif
241259 #endif
242260 #ifdef IUTEST_OS_LINUX
243261 # define GTEST_OS_LINUX IUTEST_OS_LINUX
@@ -378,12 +396,21 @@
378396
379397 #undef IUTEST_SUPPRESS_UNREACHABLE_CODE_WARNING
380398
399+#ifdef IUTEST_OS_CYGWIN
400+# undef IUTEST_OS_CYGWIN
401+#endif
381402 #ifdef IUTEST_OS_WINDOWS
382403 # undef IUTEST_OS_WINDOWS
404+# ifdef IUTEST_OS_WINDOWS_MOBILE
405+# undef IUTEST_OS_WINDOWS_MOBILE
406+# endif
407+# ifdef IUTEST_OS_WINDOWS_MINGW
408+# undef IUTEST_OS_WINDOWS_MINGW
409+# endif
410+# ifdef IUTEST_OS_WINDOWS_DESKTOP
411+# undef IUTEST_OS_WINDOWS_DESKTOP
412+# endif
383413 #endif
384-#ifdef IUTEST_OS_CYGWIN
385-# undef IUTEST_OS_CYGWIN
386-#endif
387414 #ifdef IUTEST_OS_LINUX
388415 # undef IUTEST_OS_LINUX
389416 # ifdef IUTEST_OS_LINUX_ANDROID
@@ -406,7 +433,7 @@
406433 #define IUTEST_ASSERT_TRUE ASSERT_TRUE
407434 #define IUTEST_ASSERT_FALSE ASSERT_FALSE
408435 #define IUTEST_ASSERT_EQ ASSERT_EQ
409-#define IUTEST_ASSERT_NE ASSERT_NE
436+#define IUTEST_ASSERT_NE(expected, actual) ASSERT_PRED_FORMAT2(::testing::internal::NeHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, expected, actual)
410437 #define IUTEST_ASSERT_LT ASSERT_LT
411438 #define IUTEST_ASSERT_LE ASSERT_LE
412439 #define IUTEST_ASSERT_GT ASSERT_GT
@@ -416,7 +443,7 @@
416443 #define IUTEST_ASSERT_DOUBLE_EQ ASSERT_DOUBLE_EQ
417444 #define IUTEST_ASSERT_STREQ ASSERT_STREQ
418445 #define IUTEST_ASSERT_STRNE ASSERT_STRNE
419-#define IUTEST_ASSERT_STRLNEQ(len, v2) ASSERT_PRED_FORMAT2(iuutil::CompareHelperSTRLNEQ, len, v2)
446+#define IUTEST_ASSERT_STRLNEQ(len, v2) ASSERT_PRED_FORMAT2(iuutil::CmpHelperSTRLNEQ, len, v2)
420447 #define IUTEST_ASSERT_STRCASEEQ ASSERT_STRCASEEQ
421448 #define IUTEST_ASSERT_STRCASENE ASSERT_STRCASENE
422449 #define IUTEST_ASSERT_THROW(statement, expected_exception) ASSERT_THROW((void)statement, expected_exception)
@@ -443,7 +470,7 @@
443470 #define IUTEST_EXPECT_TRUE EXPECT_TRUE
444471 #define IUTEST_EXPECT_FALSE EXPECT_FALSE
445472 #define IUTEST_EXPECT_EQ EXPECT_EQ
446-#define IUTEST_EXPECT_NE EXPECT_NE
473+#define IUTEST_EXPECT_NE(expected, actual) EXPECT_PRED_FORMAT2(::testing::internal::NeHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, expected, actual)
447474 #define IUTEST_EXPECT_LT EXPECT_LT
448475 #define IUTEST_EXPECT_LE EXPECT_LE
449476 #define IUTEST_EXPECT_GT EXPECT_GT
@@ -453,7 +480,7 @@
453480 #define IUTEST_EXPECT_DOUBLE_EQ EXPECT_DOUBLE_EQ
454481 #define IUTEST_EXPECT_STREQ EXPECT_STREQ
455482 #define IUTEST_EXPECT_STRNE EXPECT_STRNE
456-#define IUTEST_EXPECT_STRLNEQ(len, v2) EXPECT_PRED_FORMAT2(iuutil::CompareHelperSTRLNEQ, len, v2)
483+#define IUTEST_EXPECT_STRLNEQ(len, v2) EXPECT_PRED_FORMAT2(iuutil::CmpHelperSTRLNEQ, len, v2)
457484 #define IUTEST_EXPECT_STRCASEEQ EXPECT_STRCASEEQ
458485 #define IUTEST_EXPECT_STRCASENE EXPECT_STRCASENE
459486 #define IUTEST_EXPECT_THROW(statement, expected_exception) EXPECT_THROW((void)statement, expected_exception)
@@ -501,7 +528,6 @@
501528 #define IUTEST_HAS_COMBINE GTEST_HAS_COMBINE
502529 #define IUTEST_HAS_TYPED_TEST GTEST_HAS_TYPED_TEST
503530 #define IUTEST_HAS_TYPED_TEST_P GTEST_HAS_TYPED_TEST_P
504-#define IUTEST_HAS_PRED_FORMAT_OR 0
505531 #define IUTEST_HAS_GENRAND 0
506532
507533 #ifdef GTEST_OS_CYGWIN
@@ -509,6 +535,15 @@
509535 #endif
510536 #ifdef GTEST_OS_WINDOWS
511537 # define IUTEST_OS_WINDOWS GTEST_OS_WINDOWS
538+# ifdef GTEST_OS_WINDOWS_MOBILE
539+# define IUTEST_OS_WINDOWS_MOBILE GTEST_OS_WINDOWS_MOBILE
540+# endif
541+# ifdef GTEST_OS_WINDOWS_MINGW
542+# define IUTEST_OS_WINDOWS_MINGW GTEST_OS_WINDOWS_MINGW
543+# endif
544+# ifdef GTEST_OS_WINDOWS_DESKTOP
545+# define IUTEST_OS_WINDOWS_DESKTOP GTEST_OS_WINDOWS_DESKTOP
546+# endif
512547 # include <windows.h>
513548 #endif
514549 #ifdef GTEST_OS_LINUX
@@ -540,8 +575,59 @@
540575 InitGoogleTest(&targc, const_cast<wchar_t**>(argv));
541576 }
542577
578+namespace internal
579+{
580+
581+template <bool lhs_is_null_literal>
582+class NeHelper {
583+public:
584+ template <typename T1, typename T2>
585+ static AssertionResult Compare(const char* expected_expression,
586+ const char* actual_expression,
587+ const T1& expected,
588+ const T2& actual) {
589+ return CmpHelperNE(expected_expression, actual_expression, expected,
590+ actual);
591+ }
592+
593+ static AssertionResult Compare(const char* expected_expression,
594+ const char* actual_expression,
595+ BiggestInt expected,
596+ BiggestInt actual) {
597+ return CmpHelperNE(expected_expression, actual_expression, expected,
598+ actual);
599+ }
600+};
601+
602+template <>
603+class NeHelper<true> {
604+public:
605+ template <typename T1, typename T2>
606+ static AssertionResult Compare(
607+ const char* expected_expression,
608+ const char* actual_expression,
609+ const T1& expected,
610+ const T2& actual,
611+ typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
612+ return CmpHelperNE(expected_expression, actual_expression, expected,
613+ actual);
614+ }
615+
616+ template <typename T>
617+ static AssertionResult Compare(
618+ const char* expected_expression,
619+ const char* actual_expression,
620+ Secret* /* expected (NULL) */,
621+ T* actual) {
622+ return CmpHelperNE(expected_expression, actual_expression,
623+ static_cast<T*>(NULL), actual);
624+ }
625+};
626+
543627 }
544628
629+}
630+
545631 namespace iutest = testing;
546632
547633 #include "../iutest_util.h"
--- trunk/framework/testsuite/iutest/include/iutest_printers.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/iutest_printers.h (revision 256)
@@ -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_assertion.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/iutest_assertion.h (revision 256)
@@ -157,6 +157,20 @@
157157 AssertionHelper::msg_list AssertionHelper::List<T>::s_scoped_message;
158158
159159 //======================================================================
160+// function
161+/**
162+ * @brief テスト成功を示す AssertionResult オブジェクトの取得
163+*/
164+static AssertionResult AssertionSuccess(void) { return AssertionResult::Success(); }
165+/**
166+ * @brief テスト失敗を示す AssertionResult オブジェクトの取得
167+*/
168+static AssertionResult AssertionFailure(void) { return AssertionResult::Failure(); }
169+
170+namespace internal
171+{
172+
173+//======================================================================
160174 // declare
161175 #if defined(__MWERKS__)
162176 template<typename T1, typename T2>
@@ -167,18 +181,7 @@
167181
168182 #endif
169183
170-//======================================================================
171-// function
172184 /**
173- * @brief テスト成功を示す AssertionResult オブジェクトの取得
174-*/
175-static AssertionResult AssertionSuccess(void) { return AssertionResult::Success(); }
176-/**
177- * @brief テスト失敗を示す AssertionResult オブジェクトの取得
178-*/
179-static AssertionResult AssertionFailure(void) { return AssertionResult::Failure(); }
180-
181-/**
182185 * @brief 比較テストの値を文字列にフォーマット
183186 */
184187 template<typename T1, typename T2>
@@ -199,7 +202,7 @@
199202 #define COMPARE_HELPER(op_name, op) \
200203 COMPARE_HELPER_DECLARE(op_name) \
201204 template<typename T1, typename T2> \
202- static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelper##op_name(const char* expr1, const char* expr2 \
205+ static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelper##op_name(const char* expr1, const char* expr2 \
203206 , const T1& val1, const T2& val2) { \
204207 if( val1 op val2 ) return AssertionSuccess(); \
205208 else { \
@@ -208,7 +211,7 @@
208211 << " vs " << FormatForComparisonFailureMessage(val2, val1); \
209212 } \
210213 } \
211- static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelper##op_name(const char* expr1, const char* expr2 \
214+ static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelper##op_name(const char* expr1, const char* expr2 \
212215 , BiggestInt val1, BiggestInt val2) { \
213216 if( val1 op val2 ) return AssertionSuccess(); \
214217 else { \
@@ -227,7 +230,7 @@
227230 #undef COMPARE_HELPER
228231
229232 template<typename T1, typename T2>
230-static AssertionResult CompareHelperEQ(const char* expected_str, const char* actual_str
233+static AssertionResult CmpHelperEQ(const char* expected_str, const char* actual_str
231234 , const T1& expected, const T2& actual)
232235 {
233236 IUTEST_UNUSED_VAR(actual_str);
@@ -253,7 +256,7 @@
253256 template<typename T1, typename T2>
254257 static AssertionResult Compare(const char* expr1, const char* expr2, const T1& val1, const T2& val2)
255258 {
256- return CompareHelperEQ(expr1, expr2, val1, val2);
259+ return CmpHelperEQ(expr1, expr2, val1, val2);
257260 }
258261 };
259262
@@ -265,13 +268,13 @@
265268 static AssertionResult Compare(const char* expr1, const char* expr2, const T1& val1, const T2& val2
266269 , typename detail::enable_if< !detail::is_pointer<T2>::value, void>::type*& = detail::enabler::value)
267270 {
268- return CompareHelperEQ(expr1, expr2, val1, val2);
271+ return CmpHelperEQ(expr1, expr2, val1, val2);
269272 }
270273 template<typename T2>
271274 static AssertionResult Compare(const char* expr1, const char* expr2, detail::IsNullLiteralHelper::Object* val1, T2* val2)
272275 {
273276 IUTEST_UNUSED_VAR(val1);
274- return CompareHelperEQ(expr1, expr2, static_cast<T2*>(NULL), val2);
277+ return CmpHelperEQ(expr1, expr2, static_cast<T2*>(NULL), val2);
275278 }
276279 };
277280
@@ -282,7 +285,7 @@
282285 template<typename T1, typename T2>
283286 static AssertionResult Compare(const char* expr1, const char* expr2, const T1& val1, const T2& val2)
284287 {
285- return CompareHelperNE(expr1, expr2, val1, val2);
288+ return CmpHelperNE(expr1, expr2, val1, val2);
286289 }
287290 };
288291
@@ -294,18 +297,18 @@
294297 static AssertionResult Compare(const char* expr1, const char* expr2, const T1& val1, const T2& val2
295298 , typename detail::enable_if< !detail::is_pointer<T2>::value, void>::type*& = detail::enabler::value)
296299 {
297- return CompareHelperNE(expr1, expr2, val1, val2);
300+ return CmpHelperNE(expr1, expr2, val1, val2);
298301 }
299302 template<typename T2>
300303 static AssertionResult Compare(const char* expr1, const char* expr2, detail::IsNullLiteralHelper::Object* val1, T2* val2)
301304 {
302305 IUTEST_UNUSED_VAR(val1);
303- return CompareHelperNE(expr1, expr2, static_cast<T2*>(NULL), val2);
306+ return CmpHelperNE(expr1, expr2, static_cast<T2*>(NULL), val2);
304307 }
305308 };
306309
307310 template<typename T>
308-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperTrue(const char* expr, const T& val)
311+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperTrue(const char* expr, const T& val)
309312 {
310313 if( val ) return AssertionSuccess();
311314 return AssertionFailure() << "error: Value of: " << expr
@@ -313,7 +316,7 @@
313316 }
314317
315318 template<typename T>
316-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperFalse(const char* expr, const T& val)
319+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperFalse(const char* expr, const T& val)
317320 {
318321 if( !val ) return AssertionSuccess();
319322 return AssertionFailure() << "error: Value of: " << expr
@@ -320,8 +323,24 @@
320323 << "\n Actual: false" << "\nExpected: " << FormatForComparisonFailureMessage(val, false) ;
321324 }
322325
326+template<typename RawType>
327+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperNearFloatingPoint(const char* expr1, const char* expr2, const char* absc
328+ , RawType val1, RawType val2, RawType abs_v)
329+{
330+ RawType diff = val1 > val2 ? val1 - val2 : val2 - val1;
331+ if( diff < abs_v ) return AssertionSuccess();
332+ floating_point<RawType> f1(diff), f2(abs_v);
333+ if( f1.AlmostEquals(f2) ) return AssertionSuccess();
334+ return AssertionFailure() << "error: Value of: abs(" << expr1 << " - " << expr2 << ") <= " << absc
335+ << "\n Actual: abs(" << val1 << " - " << val2 << ") : " << diff << "\nExpected: " << FormatForComparisonFailureMessage(abs_v, diff) ;
336+}
337+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ DoubleNearPredFormat(const char* expr1, const char* expr2, const char* absc
338+ , double val1, double val2, double abs_v)
339+{
340+ return CmpHelperNearFloatingPoint(expr1, expr2, absc, val1, val2, abs_v);
341+}
323342 template<typename T, typename A>
324-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperNear(const char* expr1, const char* expr2, const char* absc
343+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperNear(const char* expr1, const char* expr2, const char* absc
325344 , const T& val1, const T& val2, const A& abs_v)
326345 {
327346 T diff = val1 > val2 ? val1 - val2 : val2 - val1;
@@ -329,8 +348,20 @@
329348 return AssertionFailure() << "error: Value of: abs(" << expr1 << " - " << expr2 << ") <= " << absc
330349 << "\n Actual: abs(" << val1 << " - " << val2 << ") : " << diff << "\nExpected: " << FormatForComparisonFailureMessage(abs_v, diff) ;
331350 }
351+template<typename A>
352+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperNear(const char* expr1, const char* expr2, const char* absc
353+ , double val1, double val2, const A& abs_v)
354+{
355+ return CmpHelperNearFloatingPoint<double>(expr1, expr2, absc, val1, val2, static_cast<double>(abs_v));
356+}
357+template<typename A>
358+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperNear(const char* expr1, const char* expr2, const char* absc
359+ , float val1, float val2, const A& abs_v)
360+{
361+ return CmpHelperNearFloatingPoint<float>(expr1, expr2, absc, val1, val2, static_cast<float>(abs_v));
362+}
332363
333-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperSTREQ(const char* expr1, const char* expr2
364+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperSTREQ(const char* expr1, const char* expr2
334365 , const char* val1, const char* val2)
335366 {
336367 if( strcmp(val1, val2) == 0 ) return AssertionSuccess();
@@ -337,7 +368,7 @@
337368 return AssertionFailure() << "error: Value of: " << expr1 << " == " << expr2
338369 << "\n Actual: " << val2 << "\nExpected: " << val1 ;
339370 }
340-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperSTREQ(const char* expr1, const char* expr2
371+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperSTREQ(const char* expr1, const char* expr2
341372 , const wchar_t* val1, const wchar_t* val2)
342373 {
343374 if( wcscmp(val1, val2) == 0 ) return AssertionSuccess();
@@ -344,7 +375,7 @@
344375 return AssertionFailure() << "error: Value of: " << expr1 << " == " << expr2
345376 << "\n Actual: " << val2 << "\nExpected: " << val1 ;
346377 }
347-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperSTRNE(const char* expr1, const char* expr2
378+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperSTRNE(const char* expr1, const char* expr2
348379 , const char* val1, const char* val2)
349380 {
350381 if( strcmp(val1, val2) != 0 ) return AssertionSuccess();
@@ -351,7 +382,7 @@
351382 return AssertionFailure() << "error: Value of: " << expr1 << " != " << expr2
352383 << "\n Actual: " << val2 << "\nExpected: " << val1 ;
353384 }
354-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperSTRNE(const char* expr1, const char* expr2
385+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperSTRNE(const char* expr1, const char* expr2
355386 , const wchar_t* val1, const wchar_t* val2)
356387 {
357388 if( wcscmp(val1, val2) != 0 ) return AssertionSuccess();
@@ -359,7 +390,7 @@
359390 << "\n Actual: " << val2 << "\nExpected: " << val1 ;
360391 }
361392
362-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperSTRCASEEQ(const char* expr1, const char* expr2
393+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperSTRCASEEQ(const char* expr1, const char* expr2
363394 , const char* val1, const char* val2)
364395 {
365396 if( iutest_stricmp(val1, val2) == 0 ) return AssertionSuccess();
@@ -366,7 +397,7 @@
366397 return AssertionFailure() << "error: Value of: " << expr1 << " == " << expr2
367398 << "\n Actual: " << val2 << "\nExpected: " << val1 ;
368399 }
369-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperSTRCASEEQ(const char* expr1, const char* expr2
400+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperSTRCASEEQ(const char* expr1, const char* expr2
370401 , const wchar_t* val1, const wchar_t* val2)
371402 {
372403 if( iutest_wcsicmp(val1, val2) == 0 ) return AssertionSuccess();
@@ -373,7 +404,7 @@
373404 return AssertionFailure() << "error: Value of: " << expr1 << " == " << expr2
374405 << "\n Actual: " << val2 << "\nExpected: " << val1 ;
375406 }
376-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperSTRCASENE(const char* expr1, const char* expr2
407+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperSTRCASENE(const char* expr1, const char* expr2
377408 , const char* val1, const char* val2)
378409 {
379410 if( iutest_stricmp(val1, val2) != 0 ) return AssertionSuccess();
@@ -380,7 +411,7 @@
380411 return AssertionFailure() << "error: Value of: " << expr1 << " != " << expr2
381412 << "\n Actual: " << val2 << "\nExpected: " << val1 ;
382413 }
383-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperSTRCASENE(const char* expr1, const char* expr2
414+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperSTRCASENE(const char* expr1, const char* expr2
384415 , const wchar_t* val1, const wchar_t* val2)
385416 {
386417 if( iutest_wcsicmp(val1, val2) != 0 ) return AssertionSuccess();
@@ -390,7 +421,7 @@
390421
391422
392423 template<typename RawType>
393-static AssertionResult CompareHelperFloatingPointEQ(const char* expr1, const char* expr2
424+static AssertionResult CmpHelperFloatingPointEQ(const char* expr1, const char* expr2
394425 , RawType val1, RawType val2)
395426 {
396427 floating_point<RawType> f1(val1), f2(val2);
@@ -400,7 +431,7 @@
400431 }
401432
402433 template<typename RawType>
403-static AssertionResult CompareHelperFloatingPointLE(const char* expr1, const char* expr2
434+static AssertionResult CmpHelperFloatingPointLE(const char* expr1, const char* expr2
404435 , RawType val1, RawType val2)
405436 {
406437 if( val1 < val2 ) return AssertionSuccess();
@@ -413,25 +444,24 @@
413444 static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ FloatLE(const char* expr1, const char* expr2
414445 , float val1, float val2)
415446 {
416- return CompareHelperFloatingPointLE<float>(expr1, expr2, val1, val2);
447+ return CmpHelperFloatingPointLE<float>(expr1, expr2, val1, val2);
417448 }
418449
419450 static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ DoubleLE(const char* expr1, const char* expr2
420451 , double val1, double val2)
421452 {
422- return CompareHelperFloatingPointLE<double>(expr1, expr2, val1, val2);
453+ return CmpHelperFloatingPointLE<double>(expr1, expr2, val1, val2);
423454 }
424455
425-
426456 #if defined(IUTEST_OS_WINDOWS)
427457
428-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperHRTrue(const char* expr, HRESULT hr)
458+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ IsHRESULTSuccess(const char* expr, HRESULT hr)
429459 {
430460 if( SUCCEEDED(hr) ) return AssertionSuccess();
431461 return AssertionFailure() << "error: Value of: " << expr
432462 << "\n Actual: SUCCEEDED(hr)" << "\nExpected: " << hr << ": " << detail::win::GetHResultString(hr);
433463 }
434-static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperHRFalse(const char* expr, HRESULT hr)
464+static AssertionResult IUTEST_ATTRIBUTE_UNUSED_ IsHRESULTFailure(const char* expr, HRESULT hr)
435465 {
436466 if( FAILED(hr) ) return AssertionSuccess();
437467 return AssertionFailure() << "error: Value of: " << expr
@@ -440,6 +470,8 @@
440470
441471 #endif
442472
473+} // end of namespace internal
474+
443475 } // end of namespace iutest
444476
445477 #endif
--- trunk/framework/testsuite/iutest/include/iutest_typed_tests.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/iutest_typed_tests.h (revision 256)
@@ -5,10 +5,10 @@
55 * @brief iris unit test typed test ファイル
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 */
--- trunk/framework/testsuite/iutest/include/iutest_util.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/iutest_util.h (revision 256)
@@ -8,17 +8,18 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2011-2012 Takazumi Shirayanagi\n
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see LICENSE
1414 */
1515 //-----------------------------------------------------------------------
1616 //======================================================================
17-#ifndef INCG_IRIS_iutest_util_H_
18-#define INCG_IRIS_iutest_util_H_
17+#ifndef INCG_IRIS_iutest_util_H_EBAC3846_4D1E_4b32_A85F_6D6A7CCFAF75_
18+#define INCG_IRIS_iutest_util_H_EBAC3846_4D1E_4b32_A85F_6D6A7CCFAF75_
1919
2020 //======================================================================
2121 // include
2222 #include "util/iutest_util_assertion.h"
23+#include "util/iutest_util_output.h"
2324
2425 #endif
--- trunk/framework/testsuite/iutest/include/iutest_result.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/iutest_result.h (revision 256)
@@ -20,6 +20,7 @@
2020 //======================================================================
2121 // include
2222 #include "iutest_defs.h"
23+#include "iutest_env.h"
2324 #include "internal/iutest_internal_defs.h"
2425 #include "internal/iutest_string.h"
2526 #include "internal/iutest_message.h"
--- trunk/framework/testsuite/iutest/include/iutest_defs.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/iutest_defs.h (revision 256)
@@ -29,6 +29,13 @@
2929 # if _MSC_VER > 1400
3030 # define IUTEST_HAS_STRUCTED_EXCEPTION 1
3131 # endif
32+# if defined(_WIN32_WCE)
33+# define IUTEST_OS_WINDOWS_MOBILE 1
34+# elif defined(__MINGW__) || defined(__MINGW32__)
35+# define IUTEST_OS_WINDOWS_MINGW 1
36+# else
37+# define IUTEST_OS_WINDOWS_DESKTOP 1
38+# endif
3239 #elif defined(__linux__)
3340 # define IUTEST_OS_LINUX 1
3441 # ifdef ANDROID
@@ -38,12 +45,6 @@
3845 # define IUTEST_HAS_STRUCTED_EXCEPTION 1
3946 #endif
4047
41-#if defined(_WIN32_WCE)
42-# define IUTEST_OS_WINDOWS_MOBILE 1
43-# define IUTEST_NOT_COLORCONSOLE 1
44-# undef IUTEST_SUPPORT_GETTIMEOFDAY 1
45-#endif
46-
4748 #ifndef IUTEST_HAS_STRUCTED_EXCEPTION
4849 # define IUTEST_HAS_STRUCTED_EXCEPTION 0
4950 #endif
@@ -116,7 +117,6 @@
116117 # define IUTEST_HAS_COMBINE 0
117118 #endif
118119
119-#define IUTEST_HAS_PRED_FORMAT_OR 1 //!< or アサーションヘルパー対応かどうか
120120 #define IUTEST_HAS_GENRAND 1 //!< テストごとの genrand 関数が使用可能かどうか
121121
122122 namespace iutest
--- trunk/framework/testsuite/iutest/include/iutest_env.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/iutest_env.h (revision 256)
@@ -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,6 +19,7 @@
1919
2020 //======================================================================
2121 // include
22+#include "internal/iutest_charcode.h"
2223 #include "internal/iutest_random.h"
2324 #include "internal/iutest_regex.h"
2425 #include "internal/iutest_os.h"
@@ -40,9 +41,10 @@
4041 * catch_exceptions (bool)\n
4142 * random_seed (unsigned int)\n
4243 * print_time (bool)\n
44+ * color (string)\n
4345 */
4446 #define IUTEST_FLAG(name) IIUT_FLAG(name)
45-#define IIUT_FLAG(name) TestEnv::name IUTEST_PP_CAT(iutest_flag_set_object_, __LINE__)
47+#define IIUT_FLAG(name) TestEnv::name()
4648
4749 namespace iutest
4850 {
@@ -117,8 +119,10 @@
117119 {
118120 typedef Fragment<KIND> _Myt;
119121 public:
122+ Fragment(void) {}
120123 Fragment(bool f) { SetFlag(KIND, f ? -1 : ~KIND); }
121124 _Myt& operator = (bool f) { SetFlag(KIND, f ? -1 : ~KIND); return *this; }
125+ operator bool (void) const { return IsEnableFlag(KIND); }
122126 };
123127
124128 private:
@@ -149,6 +153,7 @@
149153 typedef class RandomSeedSet
150154 {
151155 public:
156+ RandomSeedSet(void) {}
152157 RandomSeedSet(unsigned int seed) { init_random(seed); }
153158 RandomSeedSet& operator = (unsigned int seed) { init_random(seed); return *this; }
154159 } random_seed;
@@ -160,10 +165,52 @@
160165 typedef class RepeatCountSet
161166 {
162167 public:
168+ RepeatCountSet(void) {}
163169 RepeatCountSet(int count) { set_repeat_count(count); }
164170 RepeatCountSet& operator = (int count) { set_repeat_count(count); return *this; }
165171 } repeat;
166172
173+ /**
174+ * @private
175+ * @brief 色付き出力オプション設定用オブジェクト
176+ */
177+ typedef class ColorOptionSet
178+ {
179+ std::string m_option;
180+ public:
181+ ColorOptionSet(void)
182+ {
183+ if( TestFlag::IsEnableFlag(TestFlag::CONSOLE_COLOR_OFF) ) m_option = "no";
184+ else if( TestFlag::IsEnableFlag(TestFlag::CONSOLE_COLOR_ON) ) m_option = "yes";
185+ else m_option = "auto";
186+ }
187+ const ColorOptionSet& operator = (const char* c_str_)
188+ {
189+ m_option = c_str_;
190+ ParseOutputOption(c_str_);
191+ return *this;
192+ }
193+ const ColorOptionSet& operator = (const std::string& str)
194+ {
195+ m_option = str;
196+ ParseOutputOption(str.c_str());
197+ return *this;
198+ }
199+ bool operator == (const char* c_str_)
200+ {
201+ return m_option == c_str_;
202+ }
203+ bool operator == (const std::string& str)
204+ {
205+ return m_option == str;
206+ }
207+
208+ public:
209+ const char* c_str(void) const { return m_option.c_str(); }
210+ size_t length(void) const { return m_option.length(); }
211+
212+ } color;
213+
167214 private:
168215 struct Variable
169216 {
--- trunk/framework/testsuite/iutest/include/internal/iutest_console.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_console.h (revision 256)
@@ -19,8 +19,6 @@
1919
2020 //======================================================================
2121 // include
22-#include "iutest_internal_defs.h"
23-#include "../iutest_env.h"
2422 #include <stdio.h>
2523 #include <stdarg.h>
2624
@@ -29,6 +27,12 @@
2927 {
3028
3129 //======================================================================
30+// define
31+#ifndef IUTEST_VPRINTF
32+# define IUTEST_VPRINTF(f, a) vprintf(f, a)
33+#endif
34+
35+//======================================================================
3236 // class
3337 /**
3438 * @internal
@@ -69,7 +73,7 @@
6973 va_list va;
7074 va_start(va, fmt);
7175
72- if( TestFlag::IsEnableFlag(TestFlag::CONSOLE_COLOR_OFF) )
76+ if( IsColorModeOff() )
7377 {
7478 IUTEST_VPRINTF(fmt, va);
7579 }
@@ -76,7 +80,7 @@
7680 else
7781 {
7882 #if defined(IUTEST_NOT_COLORCONSOLE)
79- if( TestFlag::IsEnableFlag(TestFlag::CONSOLE_COLOR_ON) )
83+ if( IsColorModeOn() )
8084 {
8185 IUTEST_PRINTF("\033[1;3%cm", '0' + color);
8286 IUTEST_VPRINTF(fmt, va);
@@ -87,7 +91,7 @@
8791 IUTEST_VPRINTF(fmt, va);
8892 }
8993 #else
90-#if defined(IUTEST_OS_WINDOWS)
94+#if defined(IUTEST_OS_WINDOWS) && !defined(IUTEST_OS_WINDOWS_MOBILE)
9195 {
9296 const WORD attr[] = {
9397 0,
@@ -121,6 +125,24 @@
121125 }
122126 va_end(va);
123127 }
128+
129+private:
130+ static bool IsColorModeOff(void)
131+ {
132+#ifdef INCG_IRIS_iutest_H_
133+ return TestFlag::IsEnableFlag(TestFlag::CONSOLE_COLOR_OFF);
134+#else
135+ return IUTEST_FLAG(color) == "no";
136+#endif
137+ }
138+ static bool IsColorModeOn(void)
139+ {
140+#ifdef INCG_IRIS_iutest_H_
141+ return TestFlag::IsEnableFlag(TestFlag::CONSOLE_COLOR_ON);
142+#else
143+ return IUTEST_FLAG(color) == "yes";
144+#endif
145+ }
124146 };
125147
126148
--- trunk/framework/testsuite/iutest/include/internal/iutest_runner.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_runner.h (revision 256)
@@ -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/internal/iutest_internal.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_internal.h (revision 256)
@@ -166,29 +166,29 @@
166166 * @brief テストマクロ
167167 * @{
168168 */
169-#define IUTEST_TEST_EQ(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::EqHelper<IUTEST_IS_NULLLITERAL(v1)>::Compare, v1, v2, on_failure )
170-#define IUTEST_TEST_NE(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::NeHelper<IUTEST_IS_NULLLITERAL(v1)>::Compare, v1, v2, on_failure )
171-//#define IUTEST_TEST_NE(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::CompareHelperNE, v1, v2, on_failure )
172-#define IUTEST_TEST_LE(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::CompareHelperLE, v1, v2, on_failure )
173-#define IUTEST_TEST_LT(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::CompareHelperLT, v1, v2, on_failure )
174-#define IUTEST_TEST_GE(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::CompareHelperGE, v1, v2, on_failure )
175-#define IUTEST_TEST_GT(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::CompareHelperGT, v1, v2, on_failure )
169+#define IUTEST_TEST_EQ(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::EqHelper<IUTEST_IS_NULLLITERAL(v1)>::Compare, v1, v2, on_failure )
170+#define IUTEST_TEST_NE(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::NeHelper<IUTEST_IS_NULLLITERAL(v1)>::Compare, v1, v2, on_failure )
171+//#define IUTEST_TEST_NE(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::CmpHelperNE, v1, v2, on_failure )
172+#define IUTEST_TEST_LE(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::CmpHelperLE, v1, v2, on_failure )
173+#define IUTEST_TEST_LT(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::CmpHelperLT, v1, v2, on_failure )
174+#define IUTEST_TEST_GE(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::CmpHelperGE, v1, v2, on_failure )
175+#define IUTEST_TEST_GT(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::CmpHelperGT, v1, v2, on_failure )
176176
177-#define IUTEST_TEST_TRUE(v, on_failure) IUTEST_PRED_FORMAT1_( iutest::CompareHelperTrue , v, on_failure)
178-#define IUTEST_TEST_FALSE(v, on_failure) IUTEST_PRED_FORMAT1_( iutest::CompareHelperFalse, v, on_failure)
177+#define IUTEST_TEST_TRUE(v, on_failure) IUTEST_PRED_FORMAT1_( iutest::internal::CmpHelperTrue , v, on_failure)
178+#define IUTEST_TEST_FALSE(v, on_failure) IUTEST_PRED_FORMAT1_( iutest::internal::CmpHelperFalse, v, on_failure)
179179
180-#define IUTEST_TEST_FLOAT_EQ(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::CompareHelperFloatingPointEQ<float> , v1, v2, on_failure )
181-#define IUTEST_TEST_DOUBLE_EQ(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::CompareHelperFloatingPointEQ<double>, v1, v2, on_failure )
180+#define IUTEST_TEST_FLOAT_EQ(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::CmpHelperFloatingPointEQ<float> , v1, v2, on_failure )
181+#define IUTEST_TEST_DOUBLE_EQ(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::CmpHelperFloatingPointEQ<double>, v1, v2, on_failure )
182182
183-#define IUTEST_TEST_NEAR(v1, v2, abs_v, on_failure) IUTEST_PRED_FORMAT3_( iutest::CompareHelperNear, v1, v2, abs_v, on_failure )
183+#define IUTEST_TEST_NEAR(v1, v2, abs_v, on_failure) IUTEST_PRED_FORMAT3_( iutest::internal::CmpHelperNear, v1, v2, abs_v, on_failure )
184184
185-#define IUTEST_TEST_STREQ(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::CompareHelperSTREQ, v1, v2, on_failure )
186-#define IUTEST_TEST_STRNE(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::CompareHelperSTRNE, v1, v2, on_failure )
187-#define IUTEST_TEST_STRCASEEQ(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::CompareHelperSTRCASEEQ, v1, v2, on_failure )
188-#define IUTEST_TEST_STRCASENE(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::CompareHelperSTRCASENE, v1, v2, on_failure )
185+#define IUTEST_TEST_STREQ(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::CmpHelperSTREQ, v1, v2, on_failure )
186+#define IUTEST_TEST_STRNE(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::CmpHelperSTRNE, v1, v2, on_failure )
187+#define IUTEST_TEST_STRCASEEQ(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::CmpHelperSTRCASEEQ, v1, v2, on_failure )
188+#define IUTEST_TEST_STRCASENE(v1, v2, on_failure) IUTEST_PRED_FORMAT2_( iutest::internal::CmpHelperSTRCASENE, v1, v2, on_failure )
189189
190-#define IUTEST_TEST_HRESULT_SUCCEEDED(hr, on_failure) IUTEST_PRED_FORMAT1_( iutest::CompareHelperHRTrue , hr, on_failure )
191-#define IUTEST_TEST_HRESULT_FAILED(hr, on_failure) IUTEST_PRED_FORMAT1_( iutest::CompareHelperHRFalse, hr, on_failure )
190+#define IUTEST_TEST_HRESULT_SUCCEEDED(hr, on_failure) IUTEST_PRED_FORMAT1_( iutest::internal::IsHRESULTSuccess, hr, on_failure )
191+#define IUTEST_TEST_HRESULT_FAILED(hr, on_failure) IUTEST_PRED_FORMAT1_( iutest::internal::IsHRESULTFailure, hr, on_failure )
192192
193193 /**
194194 * @}
--- trunk/framework/testsuite/iutest/include/internal/iutest_os.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_os.h (revision 256)
@@ -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/util/iutest_util_output.h (nonexistent)
+++ trunk/framework/testsuite/iutest/include/util/iutest_util_output.h (revision 256)
@@ -0,0 +1,37 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file iutest_util_output.h
5+ * @brief iris unit test print 出力 utility ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 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_util_output_H_44C683CF_3452_4f68_B34E_10606EB9E190_
18+#define INCG_IRIS_iutest_util_output_H_44C683CF_3452_4f68_B34E_10606EB9E190_
19+
20+//======================================================================
21+// include
22+#ifdef INCG_IRIS_iutest_switch_H_9E5FA1C8_EFB5_40a9_A3AD_971584ECAE56_
23+# ifdef IUTEST_USE_GTEST
24+# define iutest testing
25+# include "../internal/iutest_console.h"
26+# undef iutest
27+# endif
28+#endif
29+
30+namespace iuutil
31+{
32+
33+typedef iutest::detail::iuConsole Console;
34+
35+} // end of namespace iutest
36+
37+#endif
--- trunk/framework/testsuite/iutest/include/util/iutest_util_assertion.h (revision 255)
+++ trunk/framework/testsuite/iutest/include/util/iutest_util_assertion.h (revision 256)
@@ -14,8 +14,8 @@
1414 */
1515 //-----------------------------------------------------------------------
1616 //======================================================================
17-#ifndef INCG_IRIS_iutest_util_assertion_H_
18-#define INCG_IRIS_iutest_util_assertion_H_
17+#ifndef INCG_IRIS_iutest_util_assertion_H_A45F8265_40E0_44f2_91C6_090B1778657C_
18+#define INCG_IRIS_iutest_util_assertion_H_A45F8265_40E0_44f2_91C6_090B1778657C_
1919
2020 //======================================================================
2121 // include
@@ -41,7 +41,7 @@
4141 # define IUTEST_EXPECT_STRLNEQ(l1, v2) IIUT_EXPECT_STRLNEQ_(l1, v2)
4242 #endif
4343
44-#define IUTEST_TEST_STRLNEQ(len, v2, on_failure) IUTEST_PRED_FORMAT2_( iuutil::CompareHelperSTRLNEQ, len, v2, on_failure )
44+#define IUTEST_TEST_STRLNEQ(len, v2, on_failure) IUTEST_PRED_FORMAT2_( iuutil::CmpHelperSTRLNEQ, len, v2, on_failure )
4545
4646 #define IIUT_ASSERT_STRLNEQ_(len, v2) IUTEST_TEST_STRLNEQ(len, v2, IUTEST_ASSERT_FAILURE)
4747 #define IIUT_EXPECT_STRLNEQ_(len, v2) IUTEST_TEST_STRLNEQ(len, v2, IUTEST_EXPECT_FAILURE)
@@ -48,7 +48,7 @@
4848
4949 //======================================================================
5050 // function
51-static iutest::AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperSTRLNEQ(const char* expr1, const char* expr2
51+static iutest::AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperSTRLNEQ(const char* expr1, const char* expr2
5252 , size_t len1, const char* val2)
5353 {
5454 size_t len2 = strlen(val2);
@@ -56,7 +56,7 @@
5656 return iutest::AssertionFailure() << "error: Value of: " << expr1 << " == strlen(" << expr2 << ")"
5757 << "\n Actual: " << val2 << " : " << len2 << "\nExpected: " << len1 ;
5858 }
59-static iutest::AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CompareHelperSTRLNEQ(const char* expr1, const char* expr2
59+static iutest::AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperSTRLNEQ(const char* expr1, const char* expr2
6060 , size_t len1, const wchar_t* val2)
6161 {
6262 size_t len2 = wcslen(val2);
@@ -65,17 +65,15 @@
6565 << "\n Actual: " << val2 << " : " << len2 << "\nExpected: " << len1 ;
6666 }
6767
68-#if IUTEST_HAS_PRED_FORMAT_OR
69-
7068 /**
7169 * @brief OR テスト用オブジェクト郡
7270 */
73-struct CompareHelper
71+struct CmpHelper
7472 {
7573 #define COMPARE_HELPER_DEC(name) struct name { \
7674 template<typename T1, typename T2> \
7775 static iutest::AssertionResult Comp(const char* expr1, const char* expr2, const T1& val1, const T2& val2) { \
78- return iutest::CompareHelper##name(expr1, expr2, val1, val2); \
76+ return iutest::internal::CmpHelper##name(expr1, expr2, val1, val2); \
7977 } \
8078 }
8179 COMPARE_HELPER_DEC(EQ);
@@ -91,7 +89,7 @@
9189 * @brief OR テスト用比較ヘルパー
9290 */
9391 template<typename COMP>
94-struct CompareHelperOR
92+struct CmpHelperOR
9593 {
9694 template<typename T, typename DMY=void>
9795 struct CompImpl
@@ -104,7 +102,7 @@
104102 }
105103 };
106104 template<typename DMY>
107- struct CompImpl<CompareHelper::EQ, DMY>
105+ struct CompImpl<CmpHelper::EQ, DMY>
108106 {
109107 template<typename T1, typename T2>
110108 static iutest::AssertionResult Comp(const char* expr1, const char* expr2
@@ -111,7 +109,7 @@
111109 , T1 val1, T2 val2)
112110 {
113111 // val1 == actual
114- return CompareHelper::EQ::Comp(expr2, expr1, val2, val1);
112+ return CmpHelper::EQ::Comp(expr2, expr1, val2, val1);
115113 }
116114 };
117115 public:
@@ -126,7 +124,7 @@
126124 , T1 val1, T2 val2, T3 val3)
127125 {
128126 iutest::AssertionResult ar = Comp(expr1, expr2, val1, val2);
129- if( !ar.failed() ) return ar;
127+ if( ar ) return ar;
130128 return Comp(expr1, expr3, val1, val3) << "\n" << ar.message();
131129 }
132130 template<typename T1, typename T2, typename T3, typename T4>
@@ -134,7 +132,7 @@
134132 , T1 val1, T2 val2, T3 val3, T4 val4)
135133 {
136134 iutest::AssertionResult ar = Comp(expr1, expr2, expr3, val1, val2, val3);
137- if( !ar.failed() ) return ar;
135+ if( ar ) return ar;
138136 return Comp(expr1, expr4, val1, val4) << "\n" << ar.message();
139137 }
140138 template<typename T1, typename T2, typename T3, typename T4, typename T5>
@@ -142,13 +140,11 @@
142140 , T1 val1, T2 val2, T3 val3, T4 val4, T5 val5)
143141 {
144142 iutest::AssertionResult ar = Comp(expr1, expr2, expr3, expr4, val1, val2, val3, val4);
145- if( !ar.failed() ) return ar;
143+ if( ar ) return ar;
146144 return Comp(expr1, expr5, val1, val5) << "\n" << ar.message();
147145 }
148146 };
149147
150-#endif
151-
152148 } // end of namespace iutest
153149
154150 #endif
--- trunk/framework/testsuite/iutest/samples/main.cpp (revision 255)
+++ trunk/framework/testsuite/iutest/samples/main.cpp (revision 256)
@@ -14,11 +14,11 @@
1414 {
1515 virtual void SetUp(void)
1616 {
17- iutest::detail::iuConsole::output("FooEnvironment::SetUp\n");
17+ iuutil::Console::output("FooEnvironment::SetUp\n");
1818 }
1919 virtual void TearDown(void)
2020 {
21- iutest::detail::iuConsole::output("FooEnvironment::TearDown\n");
21+ iuutil::Console::output("FooEnvironment::TearDown\n");
2222 }
2323 };
2424
@@ -172,7 +172,7 @@
172172
173173 // Param Test Values
174174 class TestPValues1 : public iutest::TestWithParam<float> {};
175-IUTEST_INSTANTIATE_TEST_CASE_P(TestPValues1Instance, TestPValues1, iutest::Values(1));
175+IUTEST_INSTANTIATE_TEST_CASE_P(TestPValues1Instance, TestPValues1, iutest::Values(1.0f));
176176
177177 IUTEST_P(TestPValues1, TestA)
178178 {
@@ -320,30 +320,26 @@
320320 IUTEST_ASSERT_STRLNEQ(4, e);
321321 }
322322
323-#if IUTEST_HAS_PRED_FORMAT_OR
324-
325323 IUTEST(TestOp, OREQ)
326324 {
327325 int x=1;
328- IUTEST_ASSERT_PRED_FORMAT2(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, x, 1);
329- IUTEST_ASSERT_PRED_FORMAT2(iuutil::CompareHelperOR<iuutil::CompareHelper::NE>::Comp, x, 0);
330- IUTEST_ASSERT_PRED_FORMAT2(iuutil::CompareHelperOR<iuutil::CompareHelper::LE>::Comp, x, 1);
331- IUTEST_ASSERT_PRED_FORMAT2(iuutil::CompareHelperOR<iuutil::CompareHelper::LT>::Comp, x, 2);
332- IUTEST_ASSERT_PRED_FORMAT2(iuutil::CompareHelperOR<iuutil::CompareHelper::GE>::Comp, x, 1);
333- IUTEST_ASSERT_PRED_FORMAT2(iuutil::CompareHelperOR<iuutil::CompareHelper::GT>::Comp, x, 0);
334- IUTEST_ASSERT_PRED_FORMAT3(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, x, 1, 0);
335- IUTEST_ASSERT_PRED_FORMAT3(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, x, 0, 1);
336- IUTEST_ASSERT_PRED_FORMAT4(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, x, 1, 2, 0);
337- IUTEST_ASSERT_PRED_FORMAT4(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, x, 0, 1, 2);
338- IUTEST_ASSERT_PRED_FORMAT4(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, x, 2, 0, 1);
339- IUTEST_ASSERT_PRED_FORMAT5(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, x, 1, 2, 3, 0);
340- IUTEST_ASSERT_PRED_FORMAT5(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, x, 0, 1, 2, 3);
341- IUTEST_ASSERT_PRED_FORMAT5(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, x, 3, 0, 1, 2);
342- IUTEST_ASSERT_PRED_FORMAT5(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, x, 2, 3, 0, 1);
326+ IUTEST_ASSERT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 1);
327+ IUTEST_ASSERT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::NE>::Comp, x, 0);
328+ IUTEST_ASSERT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::LE>::Comp, x, 1);
329+ IUTEST_ASSERT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::LT>::Comp, x, 2);
330+ IUTEST_ASSERT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::GE>::Comp, x, 1);
331+ IUTEST_ASSERT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::GT>::Comp, x, 0);
332+ IUTEST_ASSERT_PRED_FORMAT3(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 1, 0);
333+ IUTEST_ASSERT_PRED_FORMAT3(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 0, 1);
334+ IUTEST_ASSERT_PRED_FORMAT4(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 1, 2, 0);
335+ IUTEST_ASSERT_PRED_FORMAT4(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 0, 1, 2);
336+ IUTEST_ASSERT_PRED_FORMAT4(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 2, 0, 1);
337+ IUTEST_ASSERT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 1, 2, 3, 0);
338+ IUTEST_ASSERT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 0, 1, 2, 3);
339+ IUTEST_ASSERT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 3, 0, 1, 2);
340+ IUTEST_ASSERT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, x, 2, 3, 0, 1);
343341 }
344342
345-#endif
346-
347343 /**
348344 * 述語アサーション
349345 */
@@ -568,22 +564,19 @@
568564 IUTEST_EXPECT_PRED2(IsGreater, x, y);
569565 }
570566
571-#if IUTEST_HAS_PRED_FORMAT_OR
572-
573567 IUTEST(TestExpectFailure, OREQ)
574568 {
575- IUTEST_EXPECT_PRED_FORMAT2(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, 100, 0);
576- IUTEST_EXPECT_PRED_FORMAT3(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, 100, 1, 0);
577- IUTEST_EXPECT_PRED_FORMAT3(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, 100, 0, 1);
578- IUTEST_EXPECT_PRED_FORMAT4(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, 100, 2, 1, 0);
579- IUTEST_EXPECT_PRED_FORMAT4(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, 100, 0, 2, 1);
580- IUTEST_EXPECT_PRED_FORMAT4(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, 100, 2, 0, 1);
581- IUTEST_EXPECT_PRED_FORMAT5(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, 100, 3, 2, 1, 0);
582- IUTEST_EXPECT_PRED_FORMAT5(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, 100, 0, 3, 2, 1);
583- IUTEST_EXPECT_PRED_FORMAT5(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, 100, 3, 0, 2, 1);
584- IUTEST_EXPECT_PRED_FORMAT5(iuutil::CompareHelperOR<iuutil::CompareHelper::EQ>::Comp, 100, 3, 2, 0, 1);
569+ IUTEST_EXPECT_PRED_FORMAT2(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 0);
570+ IUTEST_EXPECT_PRED_FORMAT3(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 1, 0);
571+ IUTEST_EXPECT_PRED_FORMAT3(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 0, 1);
572+ IUTEST_EXPECT_PRED_FORMAT4(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 2, 1, 0);
573+ IUTEST_EXPECT_PRED_FORMAT4(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 0, 2, 1);
574+ IUTEST_EXPECT_PRED_FORMAT4(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 2, 0, 1);
575+ IUTEST_EXPECT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 3, 2, 1, 0);
576+ IUTEST_EXPECT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 0, 3, 2, 1);
577+ IUTEST_EXPECT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 3, 0, 2, 1);
578+ IUTEST_EXPECT_PRED_FORMAT5(iuutil::CmpHelperOR<iuutil::CmpHelper::EQ>::Comp, 100, 3, 2, 0, 1);
585579 }
586-#endif
587580
588581 #if !defined(IUTEST_NOT_SUPPORT_EXCEPTION)
589582 IUTEST(TestExpectFailure, Exception)
Show on old repository browser