Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cpp Core Check #627

Open
wants to merge 192 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
168f96d
Cpp Core Check
srz-zumix Nov 9, 2021
df5cfa0
vs2019
srz-zumix Nov 9, 2021
3167124
up
srz-zumix Nov 10, 2021
a0e9540
fix
srz-zumix Nov 11, 2021
7539aa5
oops
srz-zumix Nov 11, 2021
bb5f397
up
srz-zumix Nov 12, 2021
cb3e92e
up
srz-zumix Nov 12, 2021
0fd47ba
NULL to IUTEST_NULLPTR
srz-zumix Nov 13, 2021
efeda46
inherit
srz-zumix Nov 14, 2021
c89a653
ForceImportBeforeCppTargets
srz-zumix Nov 14, 2021
c415873
add options
srz-zumix Nov 15, 2021
764faeb
fix path
srz-zumix Nov 15, 2021
e23d7d6
up
srz-zumix Nov 17, 2021
e4a9c8d
up
srz-zumix Nov 17, 2021
9e43d56
Merge remote-tracking branch 'origin/develop' into appveyor/cppcorecheck
srz-zumix Nov 17, 2021
2ef1ee8
fix
srz-zumix Nov 18, 2021
1d369bc
up
srz-zumix Nov 18, 2021
8b486ed
fix
srz-zumix Nov 19, 2021
86e8fd8
fix
srz-zumix Nov 19, 2021
7548744
fix
srz-zumix Nov 19, 2021
83214c3
fix c++14 constexpr
srz-zumix Nov 20, 2021
1d8c4a5
fix
srz-zumix Nov 20, 2021
d2f01a9
fix
srz-zumix Nov 21, 2021
c90662a
fix
srz-zumix Nov 21, 2021
4559f91
fix
srz-zumix Nov 22, 2021
98fb734
fix
srz-zumix Nov 23, 2021
2c3324d
fix
srz-zumix Nov 24, 2021
ee7f11e
fix
srz-zumix Nov 24, 2021
cf8c867
fix
srz-zumix Nov 25, 2021
1780209
fix
srz-zumix Nov 25, 2021
2bf875e
fix
srz-zumix Nov 26, 2021
b804493
fix
srz-zumix Nov 26, 2021
83ddf4c
vs2022
srz-zumix Nov 27, 2021
5499e78
up
srz-zumix Nov 29, 2021
d788cb3
fix
srz-zumix Dec 1, 2021
dcc8195
fix
srz-zumix Dec 1, 2021
c06d2b6
fix
srz-zumix Dec 2, 2021
90f7317
fix
srz-zumix Dec 2, 2021
69a3ed4
fix
srz-zumix Dec 2, 2021
e86d2ef
fix
srz-zumix Dec 4, 2021
a9897fc
up
srz-zumix Dec 4, 2021
1da52c3
rev
srz-zumix Dec 4, 2021
6f01a0a
rev param tests
srz-zumix Dec 5, 2021
fcda4a6
rev pinters
srz-zumix Dec 5, 2021
277d344
rev genparams
srz-zumix Dec 5, 2021
a23a48e
rev assertion
srz-zumix Dec 5, 2021
ce8feec
rev params_util
srz-zumix Dec 5, 2021
ac43a55
Revert "fix"
srz-zumix Dec 5, 2021
d78fb41
Revert "Revert "fix""
srz-zumix Dec 5, 2021
44dbe7f
rev simple
srz-zumix Dec 5, 2021
cf39da9
rev samples
srz-zumix Dec 5, 2021
6dd6fef
up
srz-zumix Dec 5, 2021
7aa888b
printto
srz-zumix Dec 5, 2021
81c1868
parameterized
srz-zumix Dec 6, 2021
ee59755
matcher
srz-zumix Dec 6, 2021
cb9f025
Revert "matcher"
srz-zumix Dec 6, 2021
49666f0
const
srz-zumix Dec 7, 2021
bd1ec4f
fix retry
srz-zumix Dec 7, 2021
d5ce33e
fix retry 2
srz-zumix Dec 7, 2021
88f7f72
fix genparams/samples
srz-zumix Dec 8, 2021
27c5e41
fix
srz-zumix Dec 9, 2021
3b4237c
Merge remote-tracking branch 'origin/develop' into appveyor/cppcorecheck
srz-zumix Dec 9, 2021
48744e7
rm .inferconfig
srz-zumix Dec 9, 2021
98afa04
fix
srz-zumix Dec 9, 2021
e36eeca
fix
srz-zumix Dec 10, 2021
c33e471
fix
srz-zumix Dec 10, 2021
35da422
fix
srz-zumix Dec 11, 2021
a82a71a
fix
srz-zumix Dec 11, 2021
a1b8067
fix
srz-zumix Dec 12, 2021
d93cba2
fix
srz-zumix Dec 13, 2021
542f4e5
fix
srz-zumix Dec 14, 2021
fb8ebbc
fix
srz-zumix Dec 14, 2021
1c74773
fix
srz-zumix Dec 14, 2021
b1c123b
fix
srz-zumix Dec 15, 2021
87d5b67
fix
srz-zumix Dec 16, 2021
b2797c2
fix
srz-zumix Dec 17, 2021
931a77a
fix
srz-zumix Dec 17, 2021
234caf9
- C26466
srz-zumix Dec 18, 2021
a8bd80a
suppress C26466
srz-zumix Dec 19, 2021
305e965
suppress C26466
srz-zumix Dec 19, 2021
4b1c401
suppress C26466
srz-zumix Dec 19, 2021
636d07b
- C26432
srz-zumix Dec 20, 2021
058f131
disable C26432, - C26485
srz-zumix Dec 20, 2021
7369c6c
disable C26485, - C26472/C26481
srz-zumix Dec 20, 2021
43f9894
disable C26481, fix C26472
srz-zumix Dec 21, 2021
53f12a1
disable C26472, - C26435
srz-zumix Dec 22, 2021
3475fd2
disable C26435, - C26401
srz-zumix Dec 23, 2021
c86648a
- C26429
srz-zumix Dec 23, 2021
2dd7fa0
disable C26429, - C26492
srz-zumix Dec 23, 2021
ef35825
fix C26492, - C26400
srz-zumix Dec 24, 2021
d23896f
fix C26400,C26492
srz-zumix Dec 25, 2021
600412d
fix
srz-zumix Dec 25, 2021
4250272
fix
srz-zumix Dec 25, 2021
43cc57e
fix
srz-zumix Dec 26, 2021
2a0c63f
fix
srz-zumix Dec 26, 2021
da9f69c
fix
srz-zumix Dec 27, 2021
84243fb
fix owner_t
srz-zumix Dec 28, 2021
afa9f38
fix owner_t
srz-zumix Dec 28, 2021
8913d07
fix C24600,C24603,C24605
srz-zumix Dec 29, 2021
f84ce5c
fix C24600
srz-zumix Dec 30, 2021
a1f964b
- C26401
srz-zumix Dec 31, 2021
27df437
fix C26401
srz-zumix Dec 31, 2021
94c6716
fix C26401
srz-zumix Jan 1, 2022
553d105
- C26440
srz-zumix Jan 2, 2022
c44c51d
- C26409
srz-zumix Jan 2, 2022
2cc37ed
disable C26409, - C26440
srz-zumix Jan 3, 2022
d8049f6
disable C26440, - C26426
srz-zumix Jan 4, 2022
6392d16
suppress i.22
srz-zumix Jan 5, 2022
388a52f
suppress i.22
srz-zumix Jan 5, 2022
78c3d78
suppress i.22
srz-zumix Jan 6, 2022
5844bfa
warn disable C26426
srz-zumix Jan 6, 2022
ba921f6
- C26447
srz-zumix Jan 7, 2022
9033733
fix C26447
srz-zumix Jan 8, 2022
776df57
- C26446
srz-zumix Jan 9, 2022
44dcf0a
fix C26446
srz-zumix Jan 9, 2022
b36e921
fix error
srz-zumix Jan 9, 2022
5747764
gsl::at test
srz-zumix Jan 10, 2022
c3ae5a3
gsl::at test
srz-zumix Jan 11, 2022
9ec3469
gsl::at test
srz-zumix Jan 11, 2022
2f528e0
gsl::at test
srz-zumix Jan 12, 2022
18d37ea
fix gsl
srz-zumix Jan 13, 2022
f834ca0
fix gsl::at
srz-zumix Jan 13, 2022
acf5f23
log fused error
srz-zumix Jan 14, 2022
d7c3512
fix C26447
srz-zumix Jan 14, 2022
65fd697
fix fused
srz-zumix Jan 15, 2022
39cebb1
fix try/catch
srz-zumix Jan 15, 2022
8053bec
- C26440
srz-zumix Jan 16, 2022
40a3e7f
fix C26440
srz-zumix Jan 16, 2022
e5bcf00
fix C26440
srz-zumix Jan 17, 2022
6f4ede8
fix C26440
srz-zumix Jan 17, 2022
98714da
fix C26440
srz-zumix Jan 18, 2022
e875e08
fix C26440
srz-zumix Jan 19, 2022
533e377
fix C26440
srz-zumix Jan 19, 2022
3e3a2f2
fix C26440
srz-zumix Jan 20, 2022
3eb3584
fix C26440
srz-zumix Jan 20, 2022
5bf9cfa
fix
srz-zumix Jan 21, 2022
26f9ed2
fix C26440
srz-zumix Jan 22, 2022
483da4c
fix C26440
srz-zumix Jan 22, 2022
079266a
fix C26440
srz-zumix Jan 23, 2022
e65985f
fix C26440
srz-zumix Jan 23, 2022
76ece8d
fix C26440
srz-zumix Jan 24, 2022
dcb2079
fix C26440
srz-zumix Jan 24, 2022
48de0bb
fix C26440
srz-zumix Jan 25, 2022
2ce141b
fix C26440
srz-zumix Jan 25, 2022
6602930
fix C26440
srz-zumix Jan 26, 2022
20d8b01
fix C26440
srz-zumix Jan 27, 2022
36cb39d
Merge remote-tracking branch 'origin/develop' into appveyor/cppcorecheck
srz-zumix Jan 27, 2022
11c13d3
fix C26440
srz-zumix Jan 27, 2022
b008bef
fix C26440
srz-zumix Jan 28, 2022
2a173f9
fix C26440
srz-zumix Jan 29, 2022
b03ee58
fix C26440
srz-zumix Jan 29, 2022
cde5817
fix
srz-zumix Jan 30, 2022
94df030
fix C26440
srz-zumix Jan 30, 2022
138af70
fix C26440
srz-zumix Jan 31, 2022
df52171
fix C26440
srz-zumix Feb 1, 2022
5b5cc37
fix C26440
srz-zumix Feb 1, 2022
64d5d80
fix C26440
srz-zumix Feb 2, 2022
e80777e
fix
srz-zumix Feb 2, 2022
8ef47c3
fix C26440
srz-zumix Feb 3, 2022
6e49213
fix
srz-zumix Feb 3, 2022
4fcac21
fix C26440
srz-zumix Feb 3, 2022
368eea8
fix
srz-zumix Feb 4, 2022
638be87
fix
srz-zumix Feb 4, 2022
b550599
fix C26440
srz-zumix Feb 5, 2022
0cbb4a7
fix C26440
srz-zumix Feb 6, 2022
52bdeef
fix C26440
srz-zumix Feb 6, 2022
588350c
fix C26440
srz-zumix Feb 7, 2022
90ecd90
fix C26440
srz-zumix Feb 7, 2022
8e9b80e
fix C26440
srz-zumix Feb 8, 2022
4942da7
fix C26440
srz-zumix Feb 8, 2022
15c1d0f
fix C26440
srz-zumix Feb 9, 2022
dae217e
fix C26440
srz-zumix Feb 10, 2022
f3d7a77
fix
srz-zumix Feb 10, 2022
4257fec
fix C26440
srz-zumix Feb 11, 2022
8b175a9
fix C26440
srz-zumix Feb 14, 2022
93d088d
fix C26440
srz-zumix Feb 15, 2022
2321845
fix C26440
srz-zumix Feb 16, 2022
25210ce
fix C26440
srz-zumix Feb 16, 2022
a5e5abe
fix C26440
srz-zumix Feb 17, 2022
1fd1714
fix
srz-zumix Mar 2, 2022
065f8a9
Merge remote-tracking branch 'origin/develop' into appveyor/cppcorecheck
srz-zumix Mar 11, 2022
fd0b7b6
ignore C26826
srz-zumix Mar 13, 2022
28b9d8b
fix fused
srz-zumix Mar 13, 2022
ac17bdb
fix
srz-zumix Mar 13, 2022
3d4e800
fix
srz-zumix Mar 14, 2022
040a078
fix
srz-zumix Mar 14, 2022
fa06eb6
fix
srz-zumix Mar 14, 2022
b18bed4
fix
srz-zumix Mar 15, 2022
6ca5cc2
fix
srz-zumix Mar 15, 2022
aeca0fb
fix
srz-zumix Mar 16, 2022
83e99ad
Merge remote-tracking branch 'origin/develop' into appveyor/cppcorecheck
srz-zumix Mar 30, 2023
bebe474
fix
srz-zumix Apr 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ environment:
OUTPUTXML_TYPE: xml
# Prefast
- job_group: VisualStudio
job_depends_on: VS2015
job_depends_on: VS2022
BUILD_PREFAST: yes
PROJECT_DIR: vs2015
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
PROJECT_DIR: vs2022
# Menu
- job_group: VisualStudio
BUILD_MENU: yes
Expand Down Expand Up @@ -285,9 +286,10 @@ for:
environment:
MSBUILD_LOGGER_OPTION: /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
MSBUILD_PREFAST_OPTION: /p:RunCodeAnalysis=true /p:EnablePREfast=true /p:CodeAnalysisTreatWarningsAsErrors=true
CPPCORE_CHECK_OPTION: /p:CodeAnalysisRuleSet=CppCoreCheckRules.ruleset
before_build: *noop
build_script:
cmd: msbuild "projects\%PROJECT_DIR%\iutest_sample.vcxproj" /m %MSBUILD_LOGGER_OPTION% %MSBUILD_PREFAST_OPTION%
cmd: msbuild "projects\%PROJECT_DIR%\iutest_sample.vcxproj" /m %MSBUILD_LOGGER_OPTION% %MSBUILD_PREFAST_OPTION% %CPPCORE_CHECK_OPTION% /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%/utils/props/CppCoreCheckDisableSpecificWarnings.props
test: off
on_finish: *noop
# Menu
Expand Down
6 changes: 3 additions & 3 deletions include/impl/iutest_body.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @author t.shirayanagi
* @par copyright
* Copyright (C) 2011-2019, Takazumi Shirayanagi\n
* Copyright (C) 2011-2021, Takazumi Shirayanagi\n
* This software is released under the new BSD License,
* see LICENSE
*/
Expand Down Expand Up @@ -59,8 +59,8 @@ IUTEST_IPP_INLINE void Test::Run(detail::iuITestInfoMediator* test_info)

TearDown();

test_info_ = NULL;
m_test_info = NULL;
test_info_ = IUTEST_NULLPTR;
m_test_info = IUTEST_NULLPTR;
}

} // end of namespace iutest
Expand Down
60 changes: 24 additions & 36 deletions include/impl/iutest_charcode.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @author t.shirayanagi
* @par copyright
* Copyright (C) 2011-2020, Takazumi Shirayanagi\n
* Copyright (C) 2011-2022, Takazumi Shirayanagi\n
* This software is released under the new BSD License,
* see LICENSE
*/
Expand All @@ -30,10 +30,10 @@ namespace detail

//======================================================================
// variable
const UInt32 kMaxCodePoint1 = (static_cast<UInt32>(1) << 7) - 1;
const UInt32 kMaxCodePoint2 = (static_cast<UInt32>(1) << (5+6)) - 1;
const UInt32 kMaxCodePoint3 = (static_cast<UInt32>(1) << (4+2*6)) - 1;
const UInt32 kMaxCodePoint4 = (static_cast<UInt32>(1) << (3+3*6)) - 1;
IUTEST_CXX_CONSTEXPR_OR_CONST UInt32 kMaxCodePoint1 = (static_cast<UInt32>(1) << 7) - 1;
IUTEST_CXX_CONSTEXPR_OR_CONST UInt32 kMaxCodePoint2 = (static_cast<UInt32>(1) << (5+6)) - 1;
IUTEST_CXX_CONSTEXPR_OR_CONST UInt32 kMaxCodePoint3 = (static_cast<UInt32>(1) << (4+2*6)) - 1;
IUTEST_CXX_CONSTEXPR_OR_CONST UInt32 kMaxCodePoint4 = (static_cast<UInt32>(1) << (3+3*6)) - 1;

//======================================================================
// function
Expand Down Expand Up @@ -66,7 +66,7 @@ IUTEST_IPP_INLINE IUTEST_CXX_CONSTEXPR UInt32 CreateCodePointFromUtf16SurrogateP
/**
* @brief 下位から指定ビット数のビットを取得してシフトする
*/
IUTEST_IPP_INLINE UInt32 ChopLowBits(UInt32* bits, int n)
IUTEST_IPP_INLINE UInt32 ChopLowBits(UInt32* bits, int n) IUTEST_CXX_NOEXCEPT_SPEC
{
const UInt32 lowbits = *bits & ((static_cast<UInt32>(1) << n) - 1);
*bits >>= n;
Expand Down Expand Up @@ -119,28 +119,25 @@ IUTEST_IPP_INLINE char* CodePointToUtf8(UInt32 code_point, char* buf, size_t siz
IUTEST_IPP_INLINE ::std::string IUTEST_ATTRIBUTE_UNUSED_ UTF8ToSJIS(const ::std::string& str)
{
const int src_length = static_cast<int>(str.length() + 1);
const int lengthWideChar = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), src_length, NULL, 0);
const int lengthWideChar = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), src_length, IUTEST_NULLPTR, 0);
if( lengthWideChar <= 0 )
{
return "(convert error)";
}

wchar_t* wbuf = new wchar_t[lengthWideChar];
type_array<wchar_t> wbuf(lengthWideChar);
MultiByteToWideChar(CP_UTF8, 0, str.c_str(), src_length, wbuf, lengthWideChar);

const int lengthSJIS = WideCharToMultiByte(CP_THREAD_ACP, 0, wbuf, -1, NULL, 0, NULL, NULL);
const int lengthSJIS = WideCharToMultiByte(CP_THREAD_ACP, 0, wbuf, -1, IUTEST_NULLPTR, 0, IUTEST_NULLPTR, IUTEST_NULLPTR);
if( lengthSJIS <= 0 )
{
delete[] wbuf;
return "(convert error)";
}

char* buf = new char[lengthSJIS];
WideCharToMultiByte(CP_THREAD_ACP, 0, wbuf, -1, buf, lengthSJIS, NULL, NULL);
type_array<char> buf(lengthSJIS);
WideCharToMultiByte(CP_THREAD_ACP, 0, wbuf, -1, buf, lengthSJIS, IUTEST_NULLPTR, IUTEST_NULLPTR);

::std::string ret(buf);
delete[] wbuf;
delete[] buf;
return ret;
}
#endif
Expand Down Expand Up @@ -186,18 +183,16 @@ IUTEST_IPP_INLINE ::std::string IUTEST_ATTRIBUTE_UNUSED_ AnyStringToMultiByteStr
return win::WideStringToMultiByteString(str);
#else
const size_t length = wcslen(str) * static_cast<size_t>(MB_CUR_MAX) + 1;
char* mbs = new char [length];
type_array<char> mbs(length);
IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_BEGIN()
const size_t written = wcstombs(mbs, str, length - 1);
if( written == static_cast<size_t>(-1))
{
delete [] mbs;
return ToHexString(str, num);
}
IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_END()
mbs[written] = '\0';
::std::string ret = mbs;
delete [] mbs;
::std::string ret(mbs);
return ret;
#endif
}
Expand All @@ -209,32 +204,27 @@ IUTEST_IPP_INLINE::std::string IUTEST_ATTRIBUTE_UNUSED_ AnyStringToUTF8(const ch
#if IUTEST_HAS_CXX_HDR_CUCHAR
IUTEST_UNUSED_VAR(num);
const size_t length = ::std::char_traits<char16_t>::length(str);
char16_t lead = 0, trail = 0;
char32_t cp;
char mbs[6];
char mbs[6] = {};
mbstate_t state = {};
IUTEST_CHECK_(mbsinit(&state) != 0);
::std::string ret;

IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_BEGIN()
for( size_t i = 0; i < length; ++i )
{
lead = str[i];
const char16_t lead = str[i];
char32_t cp = lead;

if( lead > 0xD800 && lead < 0xDC00 )
{
++i;
trail = str[i];
const char16_t trail = str[i];
cp = (lead << 10) + trail + 0x10000 - (0xD800 << 10) - 0xDC00;
}
else
{
cp = lead;
}
const size_t len = ::std::c32rtomb(mbs, cp, &state);
if( len != static_cast<size_t>(-1) )
{
mbs[len] = '\0';
gsl::at(mbs, len) = '\0';
ret += mbs;
}
}
Expand Down Expand Up @@ -283,7 +273,7 @@ IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_BEGIN()
const size_t len = ::std::c32rtomb(mbs, cp, &state);
if( len != static_cast<size_t>(-1) )
{
mbs[len] = '\0';
gsl::at(mbs, len) = '\0';
ret += mbs;
}
}
Expand All @@ -302,18 +292,18 @@ IUTEST_IPP_INLINE::std::string IUTEST_ATTRIBUTE_UNUSED_ AnyStringToUTF8(const ch
{
#if IUTEST_HAS_CXX_HDR_CUCHAR
const size_t length = num < 0 ? ::std::char_traits<char32_t>::length(str) : num;
char mbs[6];
mbstate_t state = {};
IUTEST_CHECK_(mbsinit(&state) != 0);
::std::string ret;

IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_BEGIN()
for( size_t i = 0; i < length; ++i )
{
char mbs[6] = {};
const size_t len = ::std::c32rtomb(mbs, str[i], &state);
if( len != static_cast<size_t>(-1) )
{
mbs[len] = '\0';
gsl::at(mbs, len) = '\0';
ret += mbs;
}
}
Expand All @@ -340,21 +330,19 @@ IUTEST_IPP_INLINE::std::string IUTEST_ATTRIBUTE_UNUSED_ AnyStringToMultiByteStri

IUTEST_IPP_INLINE ::std::wstring IUTEST_ATTRIBUTE_UNUSED_ MultiByteStringToWideString(const char* str)
{
if(str == NULL)
if(str == IUTEST_NULLPTR)
{
return L"";
}
const size_t length = strlen(str) + 1;
wchar_t* wcs = new wchar_t[length];
type_array<wchar_t> wcs(length);
IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_BEGIN()
if(mbstowcs(wcs, str, length) == static_cast<size_t>(-1))
{
delete[] wcs;
return L"(convert error)";
}
IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_END()
::std::wstring ret = wcs;
delete[] wcs;
::std::wstring ret(wcs);
return ret;
}

Expand Down
39 changes: 20 additions & 19 deletions include/impl/iutest_core.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @author t.shirayanagi
* @par copyright
* Copyright (C) 2011-2020, Takazumi Shirayanagi\n
* Copyright (C) 2011-2022, Takazumi Shirayanagi\n
* This software is released under the new BSD License,
* see LICENSE
*/
Expand All @@ -22,62 +22,62 @@
namespace iutest
{

IUTEST_IPP_INLINE int UnitTest::reportable_test_count() const
IUTEST_IPP_INLINE int UnitTest::reportable_test_count() const IUTEST_CXX_NOEXCEPT_SPEC
{
return detail::SumOverList(m_testsuites, &TestSuite::reportable_test_count);
}

IUTEST_IPP_INLINE int UnitTest::failed_test_count() const
IUTEST_IPP_INLINE int UnitTest::failed_test_count() const IUTEST_CXX_NOEXCEPT_SPEC
{
return detail::SumOverList(m_testsuites, &TestSuite::failed_test_count);
}

IUTEST_IPP_INLINE int UnitTest::reportable_disabled_test_count() const
IUTEST_IPP_INLINE int UnitTest::reportable_disabled_test_count() const IUTEST_CXX_NOEXCEPT_SPEC
{
return detail::SumOverList(m_testsuites, &TestSuite::reportable_disabled_test_count);
}

IUTEST_IPP_INLINE int UnitTest::successful_test_count() const
IUTEST_IPP_INLINE int UnitTest::successful_test_count() const IUTEST_CXX_NOEXCEPT_SPEC
{
return detail::SumOverList(m_testsuites, &TestSuite::successful_test_count);
}

IUTEST_IPP_INLINE int UnitTest::skip_test_count() const
IUTEST_IPP_INLINE int UnitTest::skip_test_count() const IUTEST_CXX_NOEXCEPT_SPEC
{
return detail::SumOverList(m_testsuites, &TestSuite::skip_test_count);
}

IUTEST_IPP_INLINE int UnitTest::reportable_skip_test_count() const
IUTEST_IPP_INLINE int UnitTest::reportable_skip_test_count() const IUTEST_CXX_NOEXCEPT_SPEC
{
return detail::SumOverList(m_testsuites, &TestSuite::reportable_skip_test_count);
}

IUTEST_IPP_INLINE int UnitTest::test_run_skipped_count() const
IUTEST_IPP_INLINE int UnitTest::test_run_skipped_count() const IUTEST_CXX_NOEXCEPT_SPEC
{
return detail::SumOverList(m_testsuites, &TestSuite::test_run_skipped_count);
}

IUTEST_IPP_INLINE int UnitTest::reportable_test_run_skipped_count() const
IUTEST_IPP_INLINE int UnitTest::reportable_test_run_skipped_count() const IUTEST_CXX_NOEXCEPT_SPEC
{
return detail::SumOverList(m_testsuites, &TestSuite::reportable_test_run_skipped_count);
}

IUTEST_IPP_INLINE int UnitTest::test_suite_to_run_count() const
IUTEST_IPP_INLINE int UnitTest::test_suite_to_run_count() const IUTEST_CXX_NOEXCEPT_SPEC
{
return detail::CountIfOverList(m_testsuites, &TestSuite::should_run);
}

IUTEST_IPP_INLINE int UnitTest::successful_test_suite_count() const
IUTEST_IPP_INLINE int UnitTest::successful_test_suite_count() const IUTEST_CXX_NOEXCEPT_SPEC
{
return detail::CountIfOverList(m_testsuites, &TestSuite::Passed);
}

IUTEST_IPP_INLINE int UnitTest::failed_test_suite_count() const
IUTEST_IPP_INLINE int UnitTest::failed_test_suite_count() const IUTEST_CXX_NOEXCEPT_SPEC
{
return detail::CountIfOverList(m_testsuites, &TestSuite::Failed);
}

IUTEST_IPP_INLINE bool UnitTest::Passed() const
IUTEST_IPP_INLINE bool UnitTest::Passed() const IUTEST_CXX_NOEXCEPT_SPEC
{
if( m_ad_hoc_testresult.Failed() )
{
Expand Down Expand Up @@ -127,7 +127,8 @@ IUTEST_IPP_INLINE int UnitTest::Run()
}
//catch( ::std::exception& e )
//{
// iutest::AssertionHelper(NULL, -1, detail::FormatCxxException(e.what()), TestPartResult::kFatalFailure) = AssertionHelper::Fixed();
// iutest::AssertionHelper(IUTEST_NULLPTR, -1, detail::FormatCxxException(e.what()), TestPartResult::kFatalFailure)
// = AssertionHelper::Fixed();
//}
catch( ... )
{
Expand All @@ -141,7 +142,7 @@ IUTEST_IPP_INLINE int UnitTest::Run()
#if IUTEST_HAS_SEH && IUTEST_HAS_EXCEPTIONS
IUTEST_IPP_INLINE int UnitTest::RunOnMSC()
{
_EXCEPTION_POINTERS* ep = NULL;
_EXCEPTION_POINTERS* ep = IUTEST_NULLPTR;
int ret = 1;
__try
{
Expand Down Expand Up @@ -241,7 +242,7 @@ IUTEST_IPP_INLINE bool UnitTest::RunOnce()
{
m_current_testsuite = *it;
m_current_testsuite->Run();
m_current_testsuite = NULL;
m_current_testsuite = IUTEST_NULLPTR;
}
m_elapsedmsec = sw.stop();
}
Expand Down Expand Up @@ -284,7 +285,7 @@ IUTEST_IPP_INLINE void UnitTest::TestProgramStart()
listeners().OnTestProgramStart(*this);
}

IUTEST_IPP_INLINE void UnitTest::SetUpTestIteration()
IUTEST_IPP_INLINE void UnitTest::SetUpTestIteration() IUTEST_CXX_NOEXCEPT_SPEC
{
TestEnv::SetUp();
}
Expand Down Expand Up @@ -315,7 +316,7 @@ IUTEST_IPP_INLINE void UnitTest::TestProgramEnd()
{
return;
}
if( current_test_info() != NULL )
if( current_test_info() != IUTEST_NULLPTR )
{
IUTEST_EXPECT_FAILURE("program exit.");
}
Expand All @@ -330,7 +331,7 @@ IUTEST_IPP_INLINE void UnitTest::Initialize()
ClearAdHocTestResult();

// ファイルシステムの初期化
if( detail::IFileSystem::GetInstance() == NULL )
if( detail::IFileSystem::GetInstance() == IUTEST_NULLPTR )
{
#if defined(IUTEST_FILE)
static FileSystem<IUTEST_FILE> filesystem;
Expand Down
Loading