• R/O
  • SSH
  • HTTPS

iutest: Commit


Commit MetaInfo

Revision1360 (tree)
Time2019-01-04 09:43:03
Authorsrz_zumix

Log Message

Merge remote-tracking branch 'origin/develop'

git@254ebca81eef06862f3f4ff2a87e99215177f575
https://github.com/srz-zumix/iutest/commit/254ebca81eef06862f3f4ff2a87e99215177f575


Merge remote-tracking branch 'origin/develop'

git@4f45ac420533dfd068da2fb705e4ac3b1cc32813


update dockerfile [ci skip]

git@ad15d36368b207910b97f7cee0d05eca2f7ad15b


update version

git@5e05e3328ba4686604e01646d92db84d7c995a17


Merge pull request #147 from srz-zumix/azure-pipelines/disable_variadic_template_test_fail

fix -DIUTEST_HAS_VARIADIC_TEMPLATES=0 failed test #131
git@1254260899d431efd5492938b48a117fc4aed623


vscprintf

git@9e3a94112bcc7211f6c403c78441ca6288e436bb


update clang version

git@6ccfd3c5a2dafb7e4ad271385d10e2847124331d


split testcase

git@ba22e8836848aa194b9dd9d90bbe3bb4ced10773


add spec config output

git@994c29029d4ee593e4885587b52176f188730a88


fix prev condition

git@4114268880ff58207debba72536d25a854699c8a


fix error

git@225dcd49313f5aaa428e951dd201dfc1450d050b


add warning

git@4f3c5064184731c7d08411a8b448de8428532525


fix crash

git@ba4bf5e40bc1e3b04ee40716c6f5c94124301264


update dockerfile

git@83d491a749f5a2dd197f82ba6435d5cf6258ca00


Update template-make-test-steps.yml
git@6b95603fd6ac279c528ab20975f3a4035e836615


Update template-make-test-steps.yml
git@0fff01d5ee973dfe8934f951bf053174687329e2


Update template-make-test-steps.yml
git@51e8bf0aaf62f6ac6ad007700829e3d00957d842


change directory name

git@5a361c738324a26c1130cb118bf48c74f82d4313


apport unpack output directory change

git@0f2e233071504e19b3876880d3d2889e8465f056


Update template-make-test-steps.yml
git@b24f7215393bbe2ac54a43d8d18d673cf64e2631


Update template-make-test-steps.yml
git@0a610c1177c1e220e2e3575247cdbbad6ccc485d


Update template-make-test-steps.yml
git@ea7db608c1cb1a05261c3c0027ea26e2da35b3f3


Update template-make-test-steps.yml
git@6fee9e2b8402b190c1265a29d8623655b053faca


Update template-make-test-steps.yml
git@78d26b1167a7b4805d6398248b99d09355bed65a


Update template-make-test-steps.yml
git@1edc5ba6e533e52cb1cbaf6388c99ffac29a57ae


Update template-make-test-steps.yml
git@f85b98bd89ba25629d151f977175f4878db75880


change config

git@7cf7a06cee466909ff67a2bc3d280dbde004769f


change config

git@ed4d97bea2842d50fe8d5a975d95889e7bbd034d


change config

git@179bd2fc139cc1e1e0a8ae2f5e54b03b38cea37a


change config

git@099fcb089446b365294d8598162be41fee97be88


Update template-make-test-steps.yml
git@10d6f788fc865d5ca211f6802886a0214d94279c


Update template-make-test-steps.yml
git@60e0e6880a51f63b4101aa7031ad0ade59859262


sudo

git@c8f74bc32c95c26bfeb8bdc9622a9a5c2f91c375


Merge pull request #144 from srz-zumix/feature/travis_ci_xenial

travis environment xenial #135
git@ec833084f0f260833e834e229b012d94734d0601


core dump output setting

git@072910634fa14fb3115c90bff24755cf91142635


update setup

git@a2ce8967587dc432094ec3f0d9fcabbe2ab516ca


add ulimit -c unlimited

git@f2d7607e86a0d5215eccbd93672ee4c3946b28b1


fix ln command

git@17b87615ec0c8cce8d62d5c4e4157172e281a9f6


add symbolic link

git@47f4070a84aa6835489249be80976ef7518707aa


update publish folder

git@984c2754e02c265c0c9fe930928df12d88f0ad86


publish airtifact

git@6c86a8adc803567cabf2d51451c5d7281cebaf24


revert

git@1096f3b01f41c0f41eaaae1795edd09a600cfc1d


corresponding to googletest specification...

git@d0636e273a37fc0e33a4926cc77d410f4705fb66


source

git@b752713cb01e0b1c956b2f037be7cc54c8b77938


namespace test run move to last

git@87f91313d6b74bc0a5b91bba00e6ced224d07d0f


all test run move to last

git@5aa811569af199a9845c28e43da2aa925f7c4298


chmod +x

git@8eff2f66670070a90101d4fe5584bc55dd9d2779


Update .travis.yml
git@c81483241612575f8fb78aeefc81116343cd3c8f


Update template-make-test-steps.yml
git@0bf370bf2f4b39fd061d495527545c1bcc4b9334


update failed pipeline

git@00705325fd46af6056074283a1446c27e745d925


update gtest/gmock setup on travis ci

git@b2a7953e8429de1d29fa4d1ef8718d685ec6b4c7


disable no variadic template test

git@86280a87ead0e9827e75315cf87bbfe2e3fdf8c4


add failed check step
git@47390134ad61c36438fca8175a5b0221af0c41f4


update .travis.yml #135
git@c3dfd305eefd85a5151b3fe121d4dbc5839aba08


update year

git@b39550fa5fc9b88fa28d2d1d036466baca6bc16e


travis environment xenial

git@df6bff3023044e19be722dd93314398826ce9ec6


azure pipelines show cxx version step

git@5093e70d198f3d94158cf13a3bddb0f19860fa14


Merge pull request #142 from srz-zumix/fix/disable_adl_test_fail

add PrintTo int (no adl)
git@2feb3a109304eed1f5ac3ad3de20506de2ba7a66


Merge pull request #136 from srz-zumix/feature/update_benchmark_tests

Feature/update benchmark tests
git@2b7f1af77f8a8144968ed5e6186cb47da9c33f42


add PrintTo int (no adl)

git@b1619e407cd9a28588ac045d8870f956cf8a3b3d


Merge pull request #138 from srz-zumix/fix/disable_has_fopen_test_fail

fix disable has fopen #133
git@09db396a0a25d39f74374ed777eae0e4e2fcbb76


Merge pull request #137 from srz-zumix/azure-pipelines/trigger-config

Azure pipelines/trigger config
git@3d923e81b7cfb51eeed698af6956da5488c2d60b


add exclude path

git@682772cbba1cfebd383dc42cc33003c0b5a7c879


update README.md

git@b774408da2043bd9a2389bf69f82b9929e311c9b


exclude other ci yml

git@9f2556087d30f04ef523c24fb02b577543851fe5


fix disable has fopen #133

git@f8909527915800eb02b05dab89a486a3bb06ab8a


codefresh benchmark build and test

git@5c71fa66468e4e4fcdedf8d147b2deabb8529d6c


update clean-all

git@a01454e5791d2028c3c04f1bd5fceb3d34a04cb5


Update GNUmakefile
git@f8a72e6dce0e0bb851a7d44d9c4de89151af8c58


Update GNUmakefile
git@137f0dbe4b8a2fc510b29cda5a702bc42df81f44


Update azure-pipelines.yml
git@4e793919717b8baf8a0a33624c87b4064fe8930b


Update azure-pipelines.yml
git@68b71f67767f6a83c0894388b3e7515f82ab8a76


Update azure-pipelines.yml
git@ba38e063aaa4d52d166cb4de28f7b109e740b31b


Update azure-pipelines.yml
git@fbc92a280d1cf81f9b747e8246bb64b84b265a16


Update azure-pipelines.yml
git@ea5034453d1d61bb7974e99c0778d3437528ac85


change anchor

git@19316e9aca02869e75b7eace6eb8e976bc48f16a


change path exclude and remove branch exclude

git@c411026d1186fcfd7b2546d26e4006b51839fbd9


trigger include branch specific

git@018ecf64f692a6a2d310116c26da71cc4f72b54b


escape anchor

git@c0cf61fbda5f3f92dfde8b880861cef31c63640e


azure pipelines trigger config

git@8d7e2d082fe10027dc2fa2ff0462d71eb933d3eb


fix command miss

git@4dceea6f94799ce8f8f5e5a1d6c9863fbed6a131


add clean commands

git@64f9a2ecb347051cd2ba233664900a3e56bbe261


azure pipelines test run 1 job

git@2a8bc91c0d07b01402b01f758cef7eaf7ac87767


Merge pull request #130 from srz-zumix/feature/csvparam_invalid_file

add csvparam invalid file
git@45144227b72a630e3d720da91c8e7d6d2b1c4956


udpate CHANGELOG [ci skip]

git@0f708d9e7adb02547e9c6a0cd8398f7b185426fe


update benchmark tests makefile

git@06c9badf9c548afc0353e0de1ca7f402aa29822f


update .gitignore [ci skip]

git@ef219a047e51de82a284a34504361f9cd750956f


add csvparam invalid file

git@cae1ae5446da73afe66e34c61f381662345f1da2


Merge pull request #129 from srz-zumix/fix/no_stringstream_compile_error

fix no stringstream build and test error
git@90ac97b302cd9b2db6391bdea3974274a2e40fc7


fix no stringstream build and test error

git@37fb5d3bce4b430ea4d0d96951f03f0bced6f37c


update buddy.yml [ci skip]

git@a97dba1085584db6e24381376571b03fb4a13aa3


fix pool

git@dbf09bddd9249c45ea00a216f7e0606e30c376f0


fix job name

git@6cb090477fdc853d8d7380c516b6536bd541fcda


split syntax test

git@0a38abf8d99ef1ab7e71d1f0441afe4d5001fd21


move dockerfile

git@b309811a29c021f3730dad1532357c1ce55e88ed


Revert "azure pipelines dependsOn"

This reverts commit e45ca1ffafdb614306d95cd2f35933e7d1fcbc80.

git@5f871b046e4e9ed034520f33e4919e49108d1c96


azure pipelines dependsOn

git@e45ca1ffafdb614306d95cd2f35933e7d1fcbc80


update buddy.yml

git@bec764f19fab2b80892f39a6f31d3259d0daa811


fix file get size #128

git@30a76570c2a7cba127830629c17af61f7101a6c0


fix cpplint #128

git@17791fdccc1ac157fda2f0262ee8be672521c14b


fix IUTEST_HAS_FILE_STAT=0 build error #128

git@03a2b750a02b98bf58f4f64c5eaf92cb34782078


add azure pipelines matrix

git@ab7f9e3cce22f1c0991ad8ec3ceb3abef150f10d


Update template-make-disabled-test.yml
git@e0ff43695f3de29d5195a609f23eb55d0a4eb8df


add config matrixs for azure pipelines

git@796a7a59cc6f009348c4edfb836f2c0082bb83f0


buddy auto cache clear

git@b0c72c4213cb2a4e726980d76d6d9dedf56f8cc9


buddy --clear-cache

git@439e3316fbe59460c3b2f7fa404876f5b63e5287

Change Summary

Incremental Difference

--- trunk/.travis.yml (revision 1359)
+++ trunk/.travis.yml (revision 1360)
@@ -1,5 +1,4 @@
1-dist: trusty
2-sudo: false
1+dist: xenial
32
43 language: cpp
54
@@ -11,8 +10,8 @@
1110 apt: &apt-global
1211 sources: &apt-common-sources
1312 - ubuntu-toolchain-r-test
14- - llvm-toolchain-trusty-6.0
15- - llvm-toolchain-trusty
13+ - llvm-toolchain-xenial-6.0
14+ - llvm-toolchain-xenial
1615 packages: &apt-common-packages
1716 - clang-6.0
1817 - g++-8
@@ -55,42 +54,9 @@
5554 if [ "${USE_COVERAGE}" = 'lcov' ]; then gem install lcoveralls; fi
5655 fi
5756 # gtest/gmock
58- - |
59- if [ "${USE_GTEST}" = '1' ] || [ "${USE_GMOCK}" = '1' ]; then
60- if [ "${USE_GTEST_HEAD}" = '1' ]; then
61- git clone https://github.com/google/googletest.git googletest
62- else
63- mkdir googletest
64- if [ -e /usr/src/gtest ]; then
65- cp -r /usr/src/gtest googletest
66- elif [ -e /usr/src/gmock/gtest ]; then
67- cp -r /usr/src/gmock/gtest googletest
68- else
69- exit 1
70- fi
71- mv googletest/gtest googletest/googletest
72- fi
73- cd googletest/googletest
74- cmake . && cmake --build .
75- export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$PWD/include
76- export LIBRARY_PATH=$LIBRARY_PATH:$PWD
77- cd -
78- fi
57+ - if [ "${USE_GTEST}" = '1' ] || [ "${USE_GMOCK}" = '1' ]; then . .ci/travisci/install-gtest.sh; fi
7958 # gmock
80- - |
81- if [ "${USE_GMOCK}" = '1' ]; then
82- if [ -e /usr/src/gmock ]; then
83- cp -r /usr/src/gmock googletest
84- mv googletest/gmock googletest/googlemock
85- fi
86- if [ -e googletest/googlemock ]; then
87- cd googletest/googlemock
88- cmake . && cmake --build .
89- export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$PWD/include
90- export LIBRARY_PATH=$LIBRARY_PATH:$PWD
91- cd -
92- fi
93- fi
59+ - if [ "${USE_GMOCK}" = '1' ]; then . .ci/travisci/install-gmock.sh; fi
9460
9561 script:
9662 - if [ "${USE_LIB}" = '1' ]; then cd projects/make && make && cd -; fi
--- trunk/CHANGES.md (revision 1359)
+++ trunk/CHANGES.md (revision 1360)
@@ -7,6 +7,8 @@
77 * Improved
88
99 * Changes
10+ * CSV パラメータ生成でファイルオープン失敗した場合の警告レベルを FATAL から WARNING に変更
11+ * CSV パラメータ生成で要素がなかった場合に WARNING 出力
1012 * deprecated: IUTEST_USE_OWN_LIST
1113
1214 * Bug fixes
--- trunk/README.md (revision 1359)
+++ trunk/README.md (revision 1360)
@@ -52,7 +52,7 @@
5252 + CSV parameter.
5353 + Any parameter.
5454 + Random parameter.
55- + Multiple parameters can be concatenated.
55+ + Multiple parameters can be concatenated.
5656 * Test packages (grouping).
5757 * Skip test.
5858 * Private member test.
@@ -95,10 +95,10 @@
9595
9696 * fused
9797 make fused-src.
98-* twilio
99- notifies the test results using twilio
100-* wandbox
101- tools to make use of the iutest in [wandbox](https://wandbox.org/)
98+* Twilio
99+ notifies the test results using Twilio
100+* Wandbox
101+ tools to make use of the iutest in [Wandbox](https://wandbox.org/)
102102
103103 Tests
104104 --------------------------------------------------
--- trunk/azure-pipelines.yml (revision 1359)
+++ trunk/azure-pipelines.yml (revision 1360)
@@ -1,5 +1,35 @@
1+trigger:
2+# batch: true
3+ branches:
4+ include:
5+ - master
6+ - develop
7+ - azure-pipelines/*
8+ paths:
9+ exclude:
10+ - "*.md"
11+ - docs/*
12+ - .circleci/*
13+ - .cirrus.yml
14+ - .travis.yml
15+ - appveyor.yml
16+ - bitrise.yml
17+ - buddy.yml
18+ - codecov.yml
19+ - codefresh.yml
20+ - rocro.yml
21+ - shippable.yml
22+ - wercker.yml
23+ - Jenkinsfile
24+ - .editorconfig
125
226 jobs:
27+ - job: syntax_test
28+ pool:
29+ vmImage: ubuntu-16.04
30+ steps:
31+ - script: make -C test -j4 syntax_tests_run
32+ displayName: 'syntax test'
333 - template: .ci/azure_pipelines/template-make-test.yml
434 parameters:
535 name: default
@@ -6,3 +36,6 @@
636 - template: .ci/azure_pipelines/template-make-disabled-test.yml
737 parameters:
838 name: disabled
39+ - template: .ci/azure_pipelines/template-make-nofeature-test.yml
40+ parameters:
41+ name: nofeature
--- trunk/buddy.yml (revision 1359)
+++ trunk/buddy.yml (revision 1360)
@@ -2,17 +2,16 @@
22 trigger_mode: "ON_EVERY_PUSH"
33 ref_name: "(^(master|develop)*$)"
44 ref_type: "WILDCARD"
5+ # always_from_scratch: true
6+ auto_clear_cache: true
57 actions:
68 - action: "Build Docker image"
79 type: "DOCKERFILE"
810 login: "srzzumix"
9- password: "zumix_dockerhub"
11+ password: "${zumix_dockerhub}"
1012 docker_image_tag: "latest"
11- dockerfile_path: ".ci/Dockerfile.arm"
13+ dockerfile_path: ".ci/docker/arm-none-eabi/Dockerfile"
1214 repository: "srzzumix/arm-none-eabi-gcc-with-python"
13- trigger_condition_paths:
14- - ".ci/Dockerfile.arm"
15- trigger_condition: "ON_CHANGE_AT_PATH"
1615 - action: "Execute: arm-none-eabi-gcc --version"
1716 type: "BUILD"
1817 working_directory: "/buddy/iutest"
--- trunk/codefresh.yml (revision 1359)
+++ trunk/codefresh.yml (revision 1360)
@@ -1,41 +1,34 @@
1-# https://github.com/srz-zumix/iutest-test/blob/master/codefresh.yml
2-
3-#version: '1.0'
4-#steps:
5-# BuildingDockerImage:
6-# title: Building Docker Image
7-# type: build
8-# image_name: srzzumix/iutest
9-# dockerfile: .ci/Dockerfile.codefresh
10-#
11-# RunningUnitTests:
12-# title: Running Unit Tests
13-# image: '${{BuildingDockerImage}}'
14-# working_directory: IMAGE_WORK_DIR
15-# entry_point:
16-# - /bin/sh
17-# - /codefresh/volume/cf-generated/unit_test_script
18-# create_file:
19-# path: /codefresh/volume/cf-generated
20-# name: unit_test_script
21-# content: >-
22-# cat /proc/cpuinfo
23-#
24-# g++ --version
25-#
26-# # echo | gcc -E -Wp,-v -
27-#
28-# cd test
29-#
30-# make -j 4 ${MAKE_OPTION} && make test
31-# on_success:
32-# metadata:
33-# set:
34-# - '${{BuildingDockerImage.imageId}}':
35-# - CF_QUALITY: true
36-# on_fail:
37-# metadata:
38-# set:
39-# - '${{BuildingDockerImage.imageId}}':
40-# - CF_QUALITY: false
41-#
1+version: '1.0'
2+steps:
3+ BuildingDockerImage:
4+ title: Building Docker Image
5+ type: build
6+ image_name: srz-zumix/iutest
7+ working_directory: ./
8+ tag: '${{CF_BRANCH_TAG_NORMALIZED}}'
9+ dockerfile: tools/docker/Dockerfile
10+ RunningUnitTests:
11+ title: Running Unit Tests
12+ image: '${{BuildingDockerImage}}'
13+ working_directory: IMAGE_WORK_DIR
14+ entry_point:
15+ - /bin/sh
16+ - /codefresh/volume/cf-generated/unit_test_script
17+ create_file:
18+ path: /codefresh/volume/cf-generated
19+ name: unit_test_script
20+ content: |-
21+ cd /codefresh/volume/iutest
22+ cd test
23+ make -C benchmark
24+ make bench
25+ on_success:
26+ metadata:
27+ set:
28+ - '${{BuildingDockerImage.imageId}}':
29+ - CF_QUALITY: true
30+ on_fail:
31+ metadata:
32+ set:
33+ - '${{BuildingDockerImage.imageId}}':
34+ - CF_QUALITY: false
--- trunk/include/internal/iutest_file.hpp (revision 1359)
+++ trunk/include/internal/iutest_file.hpp (revision 1360)
@@ -227,34 +227,47 @@
227227 //! サイズ取得
228228 virtual size_t GetSize() IUTEST_CXX_OVERRIDE
229229 {
230- if( m_fp == NULL )
231- {
232- return 0;
233- }
234- const long pre = ftell(m_fp);
235- if( pre == -1 )
236- {
237- return GetSize(m_fp);
238- }
239- if( fseek(m_fp, 0, SEEK_END) != 0 )
240- {
241- return GetSize(m_fp);
242- }
243- const size_t size = static_cast<size_t>(ftell(m_fp));
244- IUTEST_UNUSED_RETURN(fseek(m_fp, pre, SEEK_SET));
245- return size;
230+#if IUTEST_HAS_FILE_STAT
231+ return GetSize(m_fp);
232+#else
233+ return GetSizeBySeekSet(m_fp);
234+#endif
246235 }
247236
248237 public:
249238 static size_t GetSize(FILE* fp)
250239 {
240+ if( fp == NULL )
241+ {
242+ return 0;
243+ }
244+#if IUTEST_HAS_FILE_STAT
251245 internal::posix::StatStruct st;
252246 if (internal::posix::Stat(fp, &st) != 0)
253247 {
254- return 0;
248+ return GetSizeBySeekSet(fp);
255249 }
256250 return st.st_size;
251+#else
252+ IUTEST_UNUSED_VAR(fp);
253+ return 0;
254+#endif
257255 }
256+ static size_t GetSizeBySeekSet(FILE* fp)
257+ {
258+ if( fp == NULL )
259+ {
260+ return 0;
261+ }
262+ const long pre = ftell(fp);
263+ if( (pre != -1) && (fseek(fp, 0, SEEK_END) == 0) )
264+ {
265+ const size_t size = static_cast<size_t>(ftell(fp));
266+ IUTEST_UNUSED_RETURN(fseek(fp, pre, SEEK_SET));
267+ return size;
268+ }
269+ return 0;
270+ }
258271 };
259272
260273 class StdErrorFile : public StdioFile
--- trunk/include/internal/iutest_genparams_from_file.hpp (revision 1359)
+++ trunk/include/internal/iutest_genparams_from_file.hpp (revision 1360)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2015-2017, Takazumi Shirayanagi\n
9+ * Copyright (C) 2015-2018, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -69,30 +69,30 @@
6969 {
7070 params_t params;
7171 IFile* fp = detail::IFileSystem::New();
72- if( fp != NULL )
72+ if( (fp != NULL) && fp->Open(path.c_str(), IFile::OpenRead) )
7373 {
74- if( fp->Open(path.c_str(), IFile::OpenRead) )
74+ const ::std::string dataset = fp->ReadAll();
75+ ::std::string::size_type prev = 0;
76+ ::std::string::size_type pos = 0;
77+ while( static_cast<void>(pos = dataset.find(delimiter, prev)), pos != ::std::string::npos )
7578 {
76- const ::std::string dataset = fp->ReadAll();
77- ::std::string::size_type prev = 0;
78- ::std::string::size_type pos = 0;
79- while( static_cast<void>(pos = dataset.find(delimiter, prev)), pos != ::std::string::npos )
80- {
81- const ::std::string data = dataset.substr(prev, pos - prev);
82- AppendParams(params, data);
83- ++pos;
84- prev = pos;
85- }
86- AppendParams(params, dataset.substr(prev));
79+ const ::std::string data = dataset.substr(prev, pos - prev);
80+ AppendParams(params, data);
81+ ++pos;
82+ prev = pos;
8783 }
88- else
84+ AppendParams(params, dataset.substr(prev));
85+
86+ if( params.empty() )
8987 {
90- fprintf(stderr, "Unable to open file \"%s\".\n", path.c_str());
91- fflush(stderr);
88+ IUTEST_LOG_(WARNING) << "Empty params file \"" << path << "\".";
9289 }
93- detail::IFileSystem::Free(fp);
9490 }
95- IUTEST_CHECK_(!params.empty());
91+ else
92+ {
93+ IUTEST_LOG_(WARNING) << "Unable to open file \"" << path << "\".";
94+ }
95+ detail::IFileSystem::Free(fp);
9696 return params;
9797 }
9898 };
--- trunk/include/internal/iutest_log_stream.hpp (revision 1359)
+++ trunk/include/internal/iutest_log_stream.hpp (revision 1360)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2014-2016, Takazumi Shirayanagi\n
9+ * Copyright (C) 2014-2018, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -49,12 +49,13 @@
4949 }
5050 return true;
5151 }
52- virtual void Printf(const char* fmt, ...) IUTEST_CXX_OVERRIDE
52+ virtual int Printf(const char* fmt, ...) IUTEST_CXX_OVERRIDE
5353 {
5454 va_list va;
5555 va_start(va, fmt);
5656 iuConsole::voutput(fmt, va);
5757 va_end(va);
58+ return 0;
5859 }
5960 };
6061
--- trunk/include/internal/iutest_option_message.hpp (revision 1359)
+++ trunk/include/internal/iutest_option_message.hpp (revision 1360)
@@ -226,6 +226,7 @@
226226 IIUT_SHOW_MACRO(IUTEST_HAS_TUPLE);
227227 IIUT_SHOW_MACRO(IUTEST_HAS_VARIADIC_TEMPLATES);
228228 IIUT_SHOW_MACRO(IUTEST_HAS_VARIADIC_TEMPLATE_TEMPLATES);
229+ IIUT_SHOW_MACRO(IUTEST_HAS_WANT_SECURE_LIB);
229230 IIUT_SHOW_MACRO(IUTEST_USE_THROW_ON_ASSERTION_FAILURE);
230231
231232 #ifdef IUTEST_LIBSTDCXX_VERSION
--- trunk/include/internal/iutest_stream.hpp (revision 1359)
+++ trunk/include/internal/iutest_stream.hpp (revision 1360)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2012-2016, Takazumi Shirayanagi\n
9+ * Copyright (C) 2012-2018, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -32,7 +32,7 @@
3232 //! 書き込み
3333 virtual bool Write(const void* buf, size_t size, size_t cnt) = 0;
3434 public:
35- virtual void Printf(const char* fmt, ...)
35+ virtual int Printf(const char* fmt, ...)
3636 {
3737 IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_BEGIN()
3838
@@ -40,19 +40,7 @@
4040 char buf[1024] = {0};
4141 va_list va;
4242 va_start(va, fmt);
43-#if defined(_MSC_VER)
44-# if IUTEST_HAS_WANT_SECURE_LIB
45- const int len = _vsnprintf_s(buf, _TRUNCATE, fmt, va);
46-# else
47- const int len = _vsnprintf(buf, sizeof(buf)-1, fmt, va);
48-# endif
49-#else
50-#if defined(__STRICT_ANSI__)
51- const int len = vsprintf(buf, fmt, va);
52-#else
53- const int len = vsnprintf(buf, sizeof(buf), fmt, va);
54-#endif
55-#endif
43+ const int len = iu_vsnprintf(buf, sizeof(buf)-1, fmt, va);
5644 va_end(va);
5745
5846 if( len > 0 )
@@ -59,6 +47,11 @@
5947 {
6048 Write(buf, static_cast<size_t>(len), 1);
6149 }
50+ else
51+ {
52+ IUTEST_LOG_(WARNING) << "stream output trancated: " << fmt;
53+ }
54+ return len;
6255
6356 IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_END()
6457 }
--- trunk/include/internal/iutest_string.hpp (revision 1359)
+++ trunk/include/internal/iutest_string.hpp (revision 1360)
@@ -155,16 +155,26 @@
155155 */
156156 inline int iu_vsnprintf(char* dst, size_t size, const char* format, va_list va)
157157 {
158-#if defined(__CYGWIN__) \
158+ if( dst == NULL && size > 0 )
159+ {
160+ return -1;
161+ }
162+#if defined(_MSC_VER)
163+ if( dst == NULL || size <= 0 )
164+ {
165+ return _vscprintf(format, va);
166+ }
167+# if IUTEST_HAS_WANT_SECURE_LIB
168+ return _vsnprintf_s(dst, size, _TRUNCATE, format, va);
169+# else
170+ return _vsnprintf(dst, size, format, va);
171+# endif
172+#elif defined(__CYGWIN__) \
159173 && (defined(__STRICT_ANSI__) && (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) && (__cplusplus >= 201103L))
160174 return wrapper::iu_vsnprintf(dst, size, format, va);
161175 #elif (defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)) && defined(__STRICT_ANSI__)
162176 return wrapper::iu_vsnprintf(dst, size, format, va);
163177 #else
164- if( dst == NULL && size > 0 )
165- {
166- return -1;
167- }
168178 return vsnprintf(dst, size, format, va);
169179 #endif
170180 }
@@ -398,7 +408,7 @@
398408
399409 inline ::std::string StringFormat(const char* format, ...)
400410 {
401- size_t n = strlen(format) * 2;
411+ size_t n = strlen(format) * 2 + 1;
402412 {
403413 va_list va;
404414 va_start(va, format);
@@ -406,7 +416,7 @@
406416 va_end(va);
407417 if( ret > 0 )
408418 {
409- n = ret;
419+ n = ret + 1;
410420 }
411421 }
412422 for( ;; )
--- trunk/include/iutest_any.hpp (revision 1359)
+++ trunk/include/iutest_any.hpp (revision 1360)
@@ -239,13 +239,12 @@
239239
240240 #if IUTEST_HAS_STRINGSTREAM || IUTEST_HAS_STRSTREAM
241241 template<typename Elem, typename Traits>
242-::std::basic_ostream<Elem, Traits>& operator << (::std::basic_ostream<Elem, Traits>& os, const any& value)
242+inline ::std::basic_ostream<Elem, Traits>& operator << (::std::basic_ostream<Elem, Traits>& os, const any& value)
243243 {
244244 return os << value.to_string();
245245 }
246246 #else
247-template<typename T>
248-iu_ostream& operator << (iu_ostream& os, const T& value)
247+inline iu_ostream& operator << (iu_ostream& os, const any& value)
249248 {
250249 return os << value.to_string();
251250 }
--- trunk/include/iutest_printers.hpp (revision 1359)
+++ trunk/include/iutest_printers.hpp (revision 1360)
@@ -249,6 +249,9 @@
249249 }
250250 inline void PrintTo(bool b, iu_ostream* os) { *os << (b ? "true" : "false"); }
251251 inline void PrintTo(const char* c, iu_ostream* os) { *os << c; }
252+#if defined(IUTEST_NO_ARGUMENT_DEPENDENT_LOOKUP)
253+inline void PrintTo(int v, iu_ostream* os) { *os << v; }
254+#endif
252255 template<typename CharT, typename Traits, typename Alloc>
253256 inline void PrintTo(const ::std::basic_string<CharT, Traits, Alloc>& str, iu_ostream* os) { *os << str.c_str(); }
254257 #if !defined(IUTEST_NO_FUNCTION_TEMPLATE_ORDERING)
--- trunk/include/iutest_ver.hpp (revision 1359)
+++ trunk/include/iutest_ver.hpp (revision 1360)
@@ -17,11 +17,11 @@
1717
1818 //======================================================================
1919 // define
20-#define IUTEST_VER 0x01169908u //!< iutest version 1.16.99.8
20+#define IUTEST_VER 0x01169910u //!< iutest version 1.16.99.10
2121 #define IUTEST_MAJORVER 0x01u //!< Major Version
2222 #define IUTEST_MINORVER 0x16u //!< Minor Version
2323 #define IUTEST_MICROVER 0x99u //!< Micro Version
24-#define IUTEST_REVISION 0x08u //!< Revision
24+#define IUTEST_REVISION 0x10u //!< Revision
2525
2626 #define IUTEST_BUILD IUTEST_MICROVER //!< @deprecated
2727
@@ -123,6 +123,9 @@
123123 <li>v1.17.0.0
124124 <ul>
125125 <li></li>
126+ <li><CSV パラメータ生成でファイルオープン失敗した場合の警告レベルを FATAL から WARNING に変更/li>
127+ <li>CSV パラメータ生成で要素がなかった場合に WARNING 出力</li>
128+ <li>deprecated: IUTEST_USE_OWN_LIST</li>
126129 </ul>
127130 </li>
128131 <li>v1.16.7.0
--- trunk/test/.gitignore (revision 1359)
+++ trunk/test/.gitignore (revision 1360)
@@ -1,15 +1,25 @@
1-*.html
2-*.png
3-*.css
4-benchmark/benchmark_n*.cpp
5-cpplint/cpplint.py
1+# ignore all
2+*
63
7-# execute files
8-*
4+# includes
95 !*.cpp
106 !*.hpp
117 !*.in
128 !Makefile
139 !GNUMakefile
10+!**/
11+# !benchmark/**/*
12+!configcheck/**/*
13+!cppcheck/**/*
14+!cpplint/**/*
15+!docs/**/*
16+!testdata/**/*
17+
18+# excludes
1419 *.ns.cpp
15-!**/
20+*.html
21+*.png
22+*.css
23+benchmark/benchmark_n*.cpp
24+cpplint/cpplint.py
25+
--- trunk/test/CommonMakefile.in (revision 1359)
+++ trunk/test/CommonMakefile.in (revision 1360)
@@ -70,6 +70,14 @@
7070
7171 EXTENSIONTESTS_TARGET=extension_tests
7272
73+SYNTAXTESTS_TEST_SRCS= \
74+ syntax_tests.cpp \
75+
76+SYNTAXTESTS_SRCS= main.cpp \
77+ $(SYNTAXTESTS_TEST_SRCS)
78+
79+SYNTAXTESTS_TARGET=syntax_tests
80+
7381 NAMESPACETESTS_TARGET=namespace_tests
7482
7583 TARGETS1= \
@@ -79,6 +87,7 @@
7987 catch_exceptions_tests \
8088 charcode_tests \
8189 commandline_tests \
90+ csvparams_invalid_file_tests \
8291 csvparams_tests \
8392 cxx_feature_tests \
8493 disabled_tests \
--- trunk/test/benchmark/benchmark_base.cpp (revision 1359)
+++ trunk/test/benchmark/benchmark_base.cpp (revision 1360)
@@ -49,6 +49,8 @@
4949 IUTEST_INSTANTIATE_TEST_CASE_P(B, ParamTest, ::iutest::Values(IUTEST_PP_ENUM_PARAMS(IUTEST_PP_LIMIT_ENUM, IUTEST_PP_EMPTY())));
5050 IUTEST_INSTANTIATE_TEST_CASE_P(C, ParamTest, ::iutest::ValuesIn(make_param(1000, 0)));
5151
52+#if IUTEST_HAS_COMBINE
53+
5254 class CombineTest : public ::iutest::TestWithParam< ::iutest::tuples::tuple<bool, int, int> > {};
5355 static const int kCombineTestTable[] = {0, 1};
5456
@@ -69,6 +71,8 @@
6971 + ::iutest::Combine(::iutest::Values(true), ::iutest::Values(1, 10), ::iutest::ValuesIn(kCombineTestTable))
7072 );
7173
74+#endif
75+
7276 template<typename T>
7377 class TypedTest : public ::iutest::Test {};
7478
--- trunk/test/csvparams_invalid_file_tests.cpp (nonexistent)
+++ trunk/test/csvparams_invalid_file_tests.cpp (revision 1360)
@@ -0,0 +1,83 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file csvparams_invalid_file_tests.cpp
5+ * @brief CSV param invalid files test
6+ *
7+ * @author t.shirayanagi
8+ * @par copyright
9+ * Copyright (C) 2018, Takazumi Shirayanagi\n
10+ * This software is released under the new BSD License,
11+ * see LICENSE
12+*/
13+//-----------------------------------------------------------------------
14+//======================================================================
15+
16+//======================================================================
17+// include
18+#include "iutest.hpp"
19+
20+#if IUTEST_HAS_PARAM_TEST && IUTEST_HAS_CSVPARAMS
21+# define CAN_CSVPARAMS_INVALID_FILE_TEST 1
22+#else
23+# define CAN_CSVPARAMS_INVALID_FILE_TEST 0
24+#endif
25+
26+#if CAN_CSVPARAMS_INVALID_FILE_TEST
27+
28+class CsvParamsIntTest : public ::iutest::TestWithParam< int >
29+{
30+};
31+
32+IUTEST_P(CsvParamsIntTest, DoNothing)
33+{
34+}
35+
36+IUTEST_INSTANTIATE_TEST_CASE_P(NotExist, CsvParamsIntTest, ::iutest::CSV<int>("testdata/not-exist?.csv") );
37+IUTEST_INSTANTIATE_TEST_CASE_P(EmptyCsv, CsvParamsIntTest, ::iutest::CSV<int>("testdata/empty.csv") );
38+
39+#endif
40+
41+#ifdef UNICODE
42+int wmain(int argc, wchar_t* argv[])
43+#else
44+int main(int argc, char* argv[])
45+#endif
46+{
47+#if CAN_CSVPARAMS_INVALID_FILE_TEST
48+
49+#if IUTEST_HAS_STREAM_BUFFER
50+ ::iutest::detail::IUStreamBuffer<> stderr_capture(stderr);
51+#endif
52+
53+ IUTEST_INIT(&argc, argv);
54+#if defined(OUTPUTXML)
55+ // 失敗テストを含むので xml 出力しない
56+ ::iutest::IUTEST_FLAG(output) = NULL;
57+#endif
58+
59+ const int ret = IUTEST_RUN_ALL_TESTS();
60+ if( ret != 0 ) return 1;
61+#if IUTEST_HAS_STREAM_BUFFER && IUTEST_HAS_ASSERTION_RETURN
62+ IUTEST_ASSERT_STRIN("Unable to open file \"testdata/not-exist?.csv\".", stderr_capture.GetStreamString())
63+ << ::iutest::AssertionReturn<int>(1);
64+ IUTEST_ASSERT_STRIN(
65+#if IUTEST_HAS_FOPEN
66+ "Empty params file "
67+#else
68+ "Unable to open file "
69+#endif
70+ "\"testdata/empty.csv\".", stderr_capture.GetStreamString()
71+ ) << ::iutest::AssertionReturn<int>(1);
72+#endif
73+ printf("*** Successful ***\n");
74+#else
75+ (void)argc;
76+ (void)argv;
77+ printf("*** CAN_CSVPARAMS_INVALID_FILE_TEST=0 ***\n");
78+#endif
79+ return 0;
80+}
81+
82+
83+
--- trunk/test/cxx_feature_tests.cpp (revision 1359)
+++ trunk/test/cxx_feature_tests.cpp (revision 1360)
@@ -73,7 +73,7 @@
7373
7474 IUTEST(StringView, PrintTo)
7575 {
76- LogChecker ck("Hello");
76+ PrintToLogChecker ck("Hello");
7777 ::std::string_view view = "Hello";
7878 IUTEST_SUCCEED() << ::iutest::PrintToString(view);
7979 }
@@ -103,12 +103,12 @@
103103 IUTEST(Optional, PrintTo)
104104 {
105105 {
106- LogChecker ck("1234");
106+ PrintToLogChecker ck("1234");
107107 ::std::optional<int> opt = 1234;
108108 IUTEST_SUCCEED() << ::iutest::PrintToString(opt);
109109 }
110110 {
111- LogChecker ck("nullopt");
111+ PrintToLogChecker ck("nullopt");
112112 ::std::optional<int> opt = ::std::nullopt;
113113 IUTEST_SUCCEED() << ::iutest::PrintToString(opt);
114114 }
@@ -130,22 +130,22 @@
130130 IUTEST(Variant, PrintTo)
131131 {
132132 {
133- LogChecker ck("1234");
133+ PrintToLogChecker ck("1234");
134134 ::std::variant<int, float, ::std::string> v = 1234;
135135 IUTEST_SUCCEED() << ::iutest::PrintToString(v);
136136 }
137137 {
138- LogChecker ck("test");
138+ PrintToLogChecker ck("test");
139139 ::std::variant<int, float, ::std::string> v("test");
140140 IUTEST_SUCCEED() << ::iutest::PrintToString(v);
141141 }
142142 {
143- LogChecker ck("monostate");
143+ PrintToLogChecker ck("monostate");
144144 ::std::variant<std::monostate, int, float, std::string> v;
145145 IUTEST_SUCCEED() << ::iutest::PrintToString(v);
146146 }
147147 {
148- LogChecker ck("valueless_by_exception");
148+ PrintToLogChecker ck("valueless_by_exception");
149149 ::std::variant<int, float, ::std::string> v = 0.2f;
150150 try
151151 {
@@ -165,7 +165,7 @@
165165
166166 IUTEST(StdArray, PrintTo)
167167 {
168- LogChecker ck("3, 1, 4");
168+ PrintToLogChecker ck("3, 1, 4");
169169 ::std::array<int, 3> ar = { { 3, 1, 4 } };
170170 IUTEST_SUCCEED() << ::iutest::PrintToString(ar);
171171 }
@@ -186,7 +186,7 @@
186186 IUTEST(Any, PrintTo)
187187 {
188188 {
189- //LogChecker ck("1234");
189+ //PrintToLogChecker ck("1234");
190190 ::std::any v = 1234;
191191 IUTEST_SUCCEED() << ::iutest::PrintToString(v);
192192 }
@@ -208,7 +208,7 @@
208208 IUTEST(FileSystem, PathPrintTo)
209209 {
210210 {
211- LogChecker ck("/cxx_feature_tests.cpp");
211+ PrintToLogChecker ck("/cxx_feature_tests.cpp");
212212 ::std::filesystem::path v = __FILE__;
213213 IUTEST_SUCCEED() << ::iutest::PrintToString(v);
214214 }
@@ -226,7 +226,7 @@
226226 IUTEST(FileSystem, StatusPrintTo)
227227 {
228228 {
229- LogChecker ck("regular: 0");
229+ PrintToLogChecker ck("regular: 0");
230230 ::std::filesystem::file_status v = ::std::filesystem::status(__FILE__);
231231 IUTEST_SUCCEED() << ::iutest::PrintToString(v);
232232 }
@@ -235,19 +235,19 @@
235235 IUTEST(FileSystem, SpaceInfoPrintTo)
236236 {
237237 {
238- LogChecker ck("cpacity");
238+ PrintToLogChecker ck("cpacity");
239239 ::std::filesystem::path path = __FILE__;
240240 ::std::filesystem::space_info v = ::std::filesystem::space(path.remove_filename());
241241 IUTEST_SUCCEED() << ::iutest::PrintToString(v);
242242 }
243243 {
244- LogChecker ck("free");
244+ PrintToLogChecker ck("free");
245245 ::std::filesystem::path path = __FILE__;
246246 ::std::filesystem::space_info v = ::std::filesystem::space(path.remove_filename());
247247 IUTEST_SUCCEED() << ::iutest::PrintToString(v);
248248 }
249249 {
250- LogChecker ck("available");
250+ PrintToLogChecker ck("available");
251251 ::std::filesystem::path path = __FILE__;
252252 ::std::filesystem::space_info v = ::std::filesystem::space(path.remove_filename());
253253 IUTEST_SUCCEED() << ::iutest::PrintToString(v);
@@ -270,7 +270,7 @@
270270 {
271271 ::std::filesystem::path path = __FILE__;
272272 ::std::filesystem::path directory = path.remove_filename().append("testdata");
273- LogChecker ck(directory.generic_string());
273+ PrintToLogChecker ck(directory.generic_string());
274274 ::std::filesystem::directory_entry x = *::std::filesystem::directory_iterator(directory);
275275 IUTEST_SUCCEED() << ::iutest::PrintToString(x);
276276 }
@@ -281,7 +281,7 @@
281281 {
282282 ::std::filesystem::path path = __FILE__;
283283 ::std::filesystem::path directory = path.remove_filename().append("testdata");
284- LogChecker ck(directory.generic_string());
284+ PrintToLogChecker ck(directory.generic_string());
285285 ::std::filesystem::directory_iterator x = ::std::filesystem::directory_iterator(directory);
286286 IUTEST_SUCCEED() << ::iutest::PrintToString(x);
287287 }
--- trunk/test/list_test_tests.cpp (revision 1359)
+++ trunk/test/list_test_tests.cpp (revision 1360)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2013-2016, Takazumi Shirayanagi\n
9+ * Copyright (C) 2013-2018, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -81,14 +81,9 @@
8181 " A\n"
8282 #endif
8383 #if IUTEST_HAS_PARAM_TEST
84-#if !defined(IUTEST_NO_ARGUMENT_DEPENDENT_LOOKUP)
8584 "Test/ParamTest\n"
8685 " A/0, where GetParam() = 42\n"
87-#else
88-"Test/ParamTest\n"
89-" A/0, where GetParam() = 4-Byte object < 2A 00 00 00 >\n"
9086 #endif
91-#endif
9287 "";
9388
9489 #ifdef UNICODE
--- trunk/test/logger_tests.hpp (revision 1359)
+++ trunk/test/logger_tests.hpp (revision 1360)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2014-2016, Takazumi Shirayanagi\n
9+ * Copyright (C) 2014-2018, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -52,7 +52,6 @@
5252 #endif
5353
5454 #if !defined(IUTEST_USE_GTEST)
55-
5655 class LogChecker
5756 {
5857 TestLogger printer_logger;
@@ -81,4 +80,33 @@
8180 };
8281 #endif
8382
83+#if !defined(IUTEST_USE_GTEST) && !defined(IUTEST_NO_ARGUMENT_DEPENDENT_LOOKUP)
84+class PrintToLogChecker
85+{
86+ TestLogger printer_logger;
87+ ::std::string m_str;
88+public:
89+ explicit PrintToLogChecker(const char* str) : m_str(str)
90+ {
91+ ::iutest::detail::iuConsole::SetLogger(&printer_logger);
92+ }
93+ explicit PrintToLogChecker(const std::string& str) : m_str(str)
94+ {
95+ ::iutest::detail::iuConsole::SetLogger(&printer_logger);
96+ }
97+ ~PrintToLogChecker(void)
98+ {
99+ ::iutest::detail::iuConsole::SetLogger(NULL);
100+ IUTEST_EXPECT_STRIN(m_str.c_str(), printer_logger.c_str());
101+ printer_logger.clear();
102+ }
103+};
104+#else
105+class PrintToLogChecker
106+{
107+public:
108+ explicit PrintToLogChecker(const char*) {}
109+};
84110 #endif
111+
112+#endif
--- trunk/test/matcher_tests.cpp (revision 1359)
+++ trunk/test/matcher_tests.cpp (revision 1360)
@@ -602,17 +602,9 @@
602602
603603 IUTEST(MatcherFailure, ContainerEq)
604604 {
605-#if !defined(IUTEST_NO_ARGUMENT_DEPENDENT_LOOKUP)
606605 CHECK_FAILURE( IUTEST_ASSERT_THAT(gb, ContainerEq(gc)), "ContainerEq: {1, 1, 1}" );
607606 CHECK_FAILURE( IUTEST_ASSERT_THAT(gb, ContainerEq(gc)), "Mismatch in a position 1: 1 vs 2" );
608607 CHECK_FAILURE( IUTEST_ASSERT_THAT(gb, ContainerEq(gc)), "Mismatch in a position 2: 1 vs 3" );
609-#else
610- CHECK_FAILURE( IUTEST_ASSERT_THAT(gb, ContainerEq(gc)), "ContainerEq: {4-Byte" );
611- CHECK_FAILURE( IUTEST_ASSERT_THAT(gb, ContainerEq(gc))
612- , "Mismatch in a position 1: 4-Byte object < 01 00 00 00 > vs 4-Byte object < 02 00 00 00 >" );
613- CHECK_FAILURE( IUTEST_ASSERT_THAT(gb, ContainerEq(gc))
614- , "Mismatch in a position 2: 4-Byte object < 01 00 00 00 > vs 4-Byte object < 03 00 00 00 >" );
615-#endif
616608 CHECK_FAILURE( IUTEST_ASSERT_THAT(ga, ContainerEq(gc)), "Mismatch element : 3 vs 10" );
617609 CHECK_FAILURE( IUTEST_ASSERT_THAT(gc, ContainerEq(ga)), "Mismatch element : 10 vs 3" );
618610 }
@@ -619,11 +611,7 @@
619611
620612 IUTEST(MatcherFailure, Pointwise)
621613 {
622-#if !defined(IUTEST_NO_ARGUMENT_DEPENDENT_LOOKUP)
623614 CHECK_FAILURE( IUTEST_ASSERT_THAT(gb, Pointwise(Eq(), gc)), "Pointwise: Eq: {1, 1, 1}" );
624-#else
625- CHECK_FAILURE( IUTEST_ASSERT_THAT(gb, Pointwise(Eq(), gc)), "Pointwise: Eq: {4-Byte" );
626-#endif
627615 CHECK_FAILURE( IUTEST_ASSERT_THAT(ga, Pointwise(Eq(), gc)), "Mismatch element : 3 vs 10" );
628616 CHECK_FAILURE( IUTEST_ASSERT_THAT(gc, Pointwise(Eq(), ga)), "Mismatch element : 10 vs 3" );
629617 }
--- trunk/test/printers_tests.cpp (revision 1359)
+++ trunk/test/printers_tests.cpp (revision 1360)
@@ -61,14 +61,22 @@
6161 IUTEST(PrintToTest, IutestAnyNotInitialized)
6262 {
6363 ::iutest::any a;
64+#if !defined(IUTEST_NO_ARGUMENT_DEPENDENT_LOOKUP)
6465 LogChecker ck("empty");
66+#else
67+ LogChecker ck("8-Byte object < 00 00 00 00 00 00 00 00 >");
68+#endif
6569 IUTEST_SUCCEED() << ::iutest::PrintToString(a);
6670 }
6771
6872 IUTEST(PrintToTest, IutestAnyString)
6973 {
70- ::iutest::any a = "test";
71- LogChecker ck("test");
74+ ::iutest::any a = "any-test";
75+#if !defined(IUTEST_NO_ARGUMENT_DEPENDENT_LOOKUP)
76+ LogChecker ck("any-test");
77+#else
78+ LogChecker ck("8-Byte object");
79+#endif
7280 IUTEST_SUCCEED() << ::iutest::PrintToString(a);
7381 }
7482
@@ -149,19 +157,11 @@
149157 ::std::vector<int> v(a, a+(sizeof(a)/sizeof(a[0])));
150158
151159 {
152-#if !defined(IUTEST_NO_ARGUMENT_DEPENDENT_LOOKUP)
153160 LogChecker ck("0, 1");
154-#else
155- LogChecker ck("4-Byte object < 00 00 00 00 >, 4-Byte object < 01 00 00 00 >");
156-#endif
157161 IUTEST_SUCCEED() << ::iutest::PrintToString(p);
158162 }
159163 {
160-#if !defined(IUTEST_NO_ARGUMENT_DEPENDENT_LOOKUP)
161164 LogChecker ck("{ 0, 1, 2 }");
162-#else
163- LogChecker ck("{ 4-Byte object < 00 00 00 00 >, 4-Byte object < 01 00 00 00 >, 4-Byte object < 02 00 00 00 > }");
164-#endif
165165 IUTEST_SUCCEED() << ::iutest::PrintToString(v);
166166 }
167167 }
--- trunk/test/set_up_testcase_failure_tests.cpp (revision 1359)
+++ trunk/test/set_up_testcase_failure_tests.cpp (revision 1360)
@@ -62,7 +62,13 @@
6262 #endif
6363 const int ret = IUTEST_RUN_ALL_TESTS();
6464
65+#if defined(IUTEST_USE_GTEST)
66+ // "Google Test" fails to set up a test case,
67+ // it does not report a failure, and the test is also continued
68+ if( ret == 1 ) return 1;
69+#else
6570 if( ret == 0 ) return 1;
71+#endif
6672
6773 IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->failed_test_count() != 2 );
6874 #if !defined(IUTEST_USE_GTEST)
--- trunk/test/unit_tests.cpp (revision 1359)
+++ trunk/test/unit_tests.cpp (revision 1360)
@@ -203,11 +203,27 @@
203203 {
204204 IUTEST_EXPECT_STREQ("0B", ::iutest::detail::FormatSizeByte(0));
205205 IUTEST_EXPECT_STREQ("2B", ::iutest::detail::FormatSizeByte(2));
206+}
207+
208+IUTEST(UnitTest, FormatSizeKByte)
209+{
206210 IUTEST_EXPECT_STREQ("1KB", ::iutest::detail::FormatSizeByte(1024));
207211 IUTEST_EXPECT_STREQ("1.0KB", ::iutest::detail::FormatSizeByte(1025));
212+}
213+
214+IUTEST(UnitTest, FormatSizeMByte)
215+{
208216 IUTEST_EXPECT_STREQ("1MB", ::iutest::detail::FormatSizeByte(1024 * 1024));
209217 IUTEST_EXPECT_STREQ("1.9MB", ::iutest::detail::FormatSizeByte(2 * 1024 * 1024 - 1));
218+}
219+
220+IUTEST(UnitTest, FormatSizeGByte)
221+{
210222 IUTEST_EXPECT_STREQ("1GB", ::iutest::detail::FormatSizeByte(1024 * 1024 * 1024));
223+}
224+
225+IUTEST(UnitTest, FormatSizeTByte)
226+{
211227 IUTEST_EXPECT_STREQ("1TB", ::iutest::detail::FormatSizeByte(1024ull * 1024 * 1024 * 1024));
212228 IUTEST_EXPECT_STREQ("1024TB", ::iutest::detail::FormatSizeByte(1024ull * 1024 * 1024 * 1024 * 1024));
213229 }
Show on old repository browser