• R/O
  • SSH
  • HTTPS

iris-fmw: Commit


Commit MetaInfo

Revision253 (tree)
Time2011-12-28 18:40:02
Authorshirayanagi

Log Message

iutext v0.11.1.2

Change Summary

Incremental Difference

--- trunk/framework/testsuite/cppcheck/check.bat (revision 252)
+++ trunk/framework/testsuite/cppcheck/check.bat (revision 253)
@@ -2,9 +2,12 @@
22
33 SET TARGETPATH=%~dp0/../../src
44
5-SET OPTIONS=-D__cplusplus --template vs --enable=style,information,missingInclude --check-config
6-rem SET OPTIONS=-D__cplusplus --template vs --enable=all
7-rem SET OPTIONS=-D__cplusplus
5+SET INC=-I %~dp0/../../src
6+rem SET EXCLUDE=-i/src/fnd/container/FndAllocator.h
7+SET DEFS=-D__cplusplus
8+SET OPTIONS=%DEFS% --template vs --enable=style,information --check-config %INC% %EXCLUDE%
9+rem SET OPTIONS=--template vs --enable=all
10+rem SET OPTIONS=
811
912 rem 未使用関数チェックをしない場合はこっち
1013 rem call cppcheck --enable=exceptNew --enable=exceptRealloc --enable=style -j %NUMBER_OF_PROCESSORS% "%TARGETPATH%"
@@ -11,10 +14,22 @@
1114 rem call cppcheck --enable=exceptNew --enable=exceptRealloc --enable=style "%TARGETPATH%"
1215
1316 rem 全部やる場合はこっち
14-call cppcheck %OPTIONS% -I %~dp0/../../src --xml "%TARGETPATH%" 2> result.xml
17+@echo %OPTIONS%
18+call cppcheck %OPTIONS% --xml "%TARGETPATH%" 2> result.xml
19+if errorlevel 1 goto error
1520
1621 call add_xsl.bat result.xml
22+if errorlevel 1 goto error
1723
1824 del /F /Q result.xml.org
25+if errorlevel 1 goto error
1926
27+goto end
28+
29+:error
2030 pause
31+exit /b 1
32+
33+:end
34+exit /b 0
35+
--- trunk/framework/testsuite/iutest/include/iutest_ver.h (revision 252)
+++ trunk/framework/testsuite/iutest/include/iutest_ver.h (revision 253)
@@ -25,11 +25,11 @@
2525
2626 //======================================================================
2727 // define
28-#define IUTEST_VER 0x00110101 //!< iutest version 0.11.1.1
28+#define IUTEST_VER 0x00110102 //!< iutest version 0.11.1.2
2929 #define IUTEST_MAJORVER 0x00
3030 #define IUTEST_MINORVER 0x11
3131 #define IUTEST_BUILD 0x01
32-#define IUTEST_REVISION 0x01
32+#define IUTEST_REVISION 0x02
3333
3434 } // end of namespace iutest
3535
--- trunk/framework/testsuite/iutest/include/listener/iutest_default_xml_generator.h (revision 252)
+++ trunk/framework/testsuite/iutest/include/listener/iutest_default_xml_generator.h (revision 253)
@@ -25,10 +25,7 @@
2525 #include "../internal/iutest_file.h"
2626 #include "../internal/iutest_time.h"
2727
28-#ifdef _MSC_VER
29-# pragma warning (push)
30-# pragma warning (disable:4996)
31-#endif
28+IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_BEGIN()
3229
3330 namespace iutest
3431 {
@@ -256,4 +253,6 @@
256253
257254 } // end of namespace iutest
258255
256+IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_END()
257+
259258 #endif
--- trunk/framework/testsuite/iutest/include/iutest.h (revision 252)
+++ trunk/framework/testsuite/iutest/include/iutest.h (revision 253)
@@ -78,6 +78,8 @@
7878 */
7979 #define IUTEST_F(testcase_, testname_) IIUT_TEST_(testcase_, testcase_, testname_)
8080
81+#if IUTEST_HAS_PARAM_TEST
82+
8183 /**
8284 * @ingroup TESTDEF
8385 * @def IUTEST_INSTANTIATE_TEST_CASE_P
@@ -93,6 +95,8 @@
9395 */
9496 #define IUTEST_P(testcase_, testname_) IIUT_TEST_P_(testcase_, testname_)
9597
98+#endif
99+
96100 /**
97101 * @ingroup TESTDEF
98102 * @brief iutest の初期化処理
--- trunk/framework/testsuite/iutest/include/iutest_defs.h (revision 252)
+++ trunk/framework/testsuite/iutest/include/iutest_defs.h (revision 253)
@@ -103,8 +103,19 @@
103103 // support
104104 #define IUTEST_HAS_PARAM_TEST 1
105105 #define IUTEST_HAS_TYPED_TEST 1
106-#define IUTEST_HAS_TYPED_TEST_P 1
107106
107+#if IUTEST_HAS_TYPED_TEST
108+# define IUTEST_HAS_TYPED_TEST_P 1
109+#else
110+# define IUTEST_HAS_TYPED_TEST_P 0
111+#endif
112+
113+#if IUTEST_HAS_PARAM_TEST && defined(IUTEST_HAS_TR1_TUPLE)
114+# define IUTEST_HAS_COMBINE 1
115+#else
116+# define IUTEST_HAS_COMBINE 0
117+#endif
118+
108119 namespace iutest
109120 {
110121
--- trunk/framework/testsuite/iutest/include/iutest_param_tests.h (revision 252)
+++ trunk/framework/testsuite/iutest/include/iutest_param_tests.h (revision 253)
@@ -23,6 +23,8 @@
2323 #include "iutest_core.h"
2424 #include "internal/iutest_pool.h"
2525
26+#if IUTEST_HAS_PARAM_TEST
27+
2628 namespace iutest
2729 {
2830
@@ -1119,4 +1121,6 @@
11191121
11201122 } // end of namespace iutest
11211123
1124+#endif // IUTEST_HAS_PARAM_TEST
1125+
11221126 #endif
--- trunk/framework/testsuite/iutest/include/iutest_core.h (revision 252)
+++ trunk/framework/testsuite/iutest/include/iutest_core.h (revision 253)
@@ -260,7 +260,9 @@
260260 // 初期化処理
261261 void Initialize(void)
262262 {
263+#if IUTEST_HAS_PARAM_TEST
263264 m_param_testcase_holder.RegisterTests();
265+#endif
264266
265267 // ファイルシステムの初期化
266268 if( detail::IFileSystem::GetInstance() == NULL )
@@ -275,10 +277,14 @@
275277 }
276278 }
277279
280+#if IUTEST_HAS_PARAM_TEST
278281 public:
279282 ParamTestCaseHolder& parameterized_test_registry(void) { return m_param_testcase_holder; }
280283 private:
281284 ParamTestCaseHolder m_param_testcase_holder;
285+#endif
286+
287+private:
282288 friend class UnitTestSource;
283289 };
284290
--- trunk/framework/testsuite/iutest/include/internal/iutest_compiler.h (revision 252)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_compiler.h (revision 253)
@@ -77,7 +77,7 @@
7777
7878 // tuple
7979 #if defined(_MSC_VER)
80-# if (_MSC_VER >= 1600)
80+# if (_MSC_VER >= 1500)
8181 # define IUTEST_HAS_TR1_TUPLE 1
8282 # endif
8383 #elif defined(__GNUC__)
--- trunk/framework/testsuite/iutest/include/internal/iutest_genparams.h (revision 252)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_genparams.h (revision 253)
@@ -22,6 +22,8 @@
2222 #include "iutest_util.h"
2323 #include <vector>
2424
25+#if IUTEST_HAS_PARAM_TEST
26+
2527 namespace iutest {
2628 namespace detail
2729 {
@@ -41,7 +43,8 @@
4143 virtual ~iuParamGenerator(void) {}
4244 public:
4345 virtual void Begin(void) = 0; //!< パラメータリストの先頭に移動
44- virtual T Next(void) = 0; //!< パラメータを取得して次に移動
46+ virtual T GetCurrent(void) const = 0; // 現在のパラメータを取得
47+ virtual void Next(void) = 0; //!< パラメータを取得して次に移動
4548 virtual bool IsEnd(void) const = 0; //!< パラメータリストの終端にいるかどうか
4649 };
4750
@@ -73,7 +76,8 @@
7376
7477 public:
7578 virtual void Begin(void) { m_cur = m_begin; }
76- virtual T Next(void) { T temp = m_cur; m_cur += m_step; return temp; }
79+ virtual T GetCurrent(void) const { return m_cur; }
80+ virtual void Next(void) { m_cur += m_step; }
7781 virtual bool IsEnd(void) const { if( m_cur < m_end ) return false; return true; }
7882 };
7983
@@ -93,7 +97,8 @@
9397
9498 public:
9599 virtual void Begin(void) { m_cur = 0; m_n = 0; }
96- virtual T Next(void) { ++m_n; T temp = m_cur; m_cur = !m_cur; return temp; }
100+ virtual T GetCurrent(void) const { return m_cur; }
101+ virtual void Next(void) { ++m_n; m_cur = !m_cur; }
97102 virtual bool IsEnd(void) const { if( m_n < 2 ) return false; return true; }
98103 };
99104
@@ -138,7 +143,8 @@
138143 }
139144 public:
140145 virtual void Begin(void) { m_it = m_values.begin(); }
141- virtual T Next(void) { T temp = *m_it; ++m_it; return temp; }
146+ virtual T GetCurrent(void) const { return *m_it; }
147+ virtual void Next(void) { ++m_it; }
142148 virtual bool IsEnd(void) const { return (m_it == m_values.end()); }
143149 };
144150
@@ -1744,7 +1750,58 @@
17441750 A50 v50;
17451751 };
17461752
1753+#if IUTEST_HAS_COMBINE
1754+
1755+template<typename T1, typename T2>
1756+class iuCartesianProductGenerator2 : public iuParamGenerator< std::tr1::tuple<T1, T2> >
1757+{
1758+ typedef iuParamGenerator<T1> Generator1;
1759+ typedef iuParamGenerator<T2> Generator2;
1760+public:
1761+ typedef std::tr1::tuple<T1, T2> ParamType;
1762+public:
1763+ iuCartesianProductGenerator2(const Generator1& g1, const Generator2& g2)
1764+ : m_g1(g1), m_g2(g2)
1765+ {}
1766+
1767+public:
1768+ virtual void Begin(void)
1769+ {
1770+ m_g1.Begin();
1771+ m_g2.Begin();
1772+ }
1773+ virtual ParamType GetCurrent(void) const
1774+ {
1775+ return ParamType(m_g1.GetCurrent(), m_g2.GetCurrent());
1776+ }
1777+ virtual void Next(void)
1778+ {
1779+ if( m_g2.IsEnd() )
1780+ {
1781+ m_g1.Next();
1782+ m_g2.Begin();
1783+ }
1784+ else
1785+ {
1786+ m_g2.Next();
1787+ }
1788+ }
1789+ virtual bool IsEnd(void) const
1790+ {
1791+ return m_g1.IsEnd() && m_g2.IsEnd();
1792+ }
1793+
1794+private:
1795+ const Generator1 m_g1;
1796+ const Generator2 m_g2;
1797+};
1798+
1799+#endif
1800+
1801+
17471802 } // end of namespace detail
17481803 } // end of namespace iutest
17491804
17501805 #endif
1806+
1807+#endif
--- trunk/framework/testsuite/iutest/include/internal/iutest_params_util.h (revision 252)
+++ trunk/framework/testsuite/iutest/include/internal/iutest_params_util.h (revision 253)
@@ -22,6 +22,8 @@
2222 #include "iutest_genparams.h"
2323 #include <string>
2424
25+#if IUTEST_HAS_PARAM_TEST
26+
2527 namespace iutest
2628 {
2729
@@ -120,11 +122,10 @@
120122 , Tester::TearDownTestCase);
121123
122124 int i=0;
123- p->Begin();
124- while( !p->IsEnd() )
125+ for( p->Begin(); !p->IsEnd(); p->Next() )
125126 {
126127 // パラメータがなくなるまでテストを作る
127- (*it)->RegisterTest(testcase, p->Next(), i);
128+ (*it)->RegisterTest(testcase, p->GetCurrent(), i);
128129 ++i;
129130 }
130131 }
@@ -190,3 +191,5 @@
190191 } // end of namespace iutest
191192
192193 #endif
194+
195+#endif
--- trunk/framework/testsuite/iutest/samples/main.cpp (revision 252)
+++ trunk/framework/testsuite/iutest/samples/main.cpp (revision 253)
@@ -104,6 +104,7 @@
104104 IUTEST_ASSERT_EQ(2, x);
105105 }
106106
107+#if IUTEST_HAS_PARAM_TEST
107108 /**
108109 * パラメータテスト
109110 */
@@ -201,6 +202,8 @@
201202 IUTEST_ASSERT_EQ(a++, GetParam());
202203 }
203204
205+#endif
206+
204207 /**
205208 * 各種テストマクロ
206209 */
--- trunk/framework/testsuite/iutest/samples/sub.cpp (revision 252)
+++ trunk/framework/testsuite/iutest/samples/sub.cpp (revision 253)
@@ -68,6 +68,9 @@
6868 IUTEST_ASSERT_EQ(2, x);
6969 }
7070
71+#if IUTEST_HAS_PARAM_TEST
72+// パラメータテスト
73+
7174 class SubTestP : public iutest::TestWithParam<int>
7275 {
7376 protected:
@@ -97,6 +100,8 @@
97100 b+=2;
98101 }
99102
103+#endif
104+
100105 struct Obj
101106 {
102107 Obj operator ++ (int v)
Show on old repository browser