elsid
2bbed8cc06
Fix gcc warning: array subscript 5 is outside array bounds of ‘const char [5]’
...
In function ‘bool ESM::operator==(const FixedString<capacity>&, const T* const&) [with long unsigned int capacity = 5; T = char; <template-parameter-1-3> = void]’,
inlined from ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = ESM::FixedString<5>; T2 = const char*]’ at /home/elsid/dev/googletest/build/gcc/release/install/include/gtest/gtest.h:1358:11,
inlined from ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&) [with T1 = ESM::FixedString<5>; T2 = const char*; typename std::enable_if<((! std::is_integral<_Tp>::value) || (! std::is_pointer<_Dp>::value))>::type* <anonymous> = 0]’ at /home/elsid/dev/googletest/build/gcc/release/install/include/gtest/gtest.h:1377:64,
inlined from ‘virtual void {anonymous}::EsmFixedString_equality_operator_for_not_convertible_to_uint32_with_const_char_pointer_Test::TestBody()’ at apps/openmw_test_suite/esm/test_fixed_string.cpp:165:9:
components/esm/esmcommon.hpp:134:19: warning: array subscript 5 is outside array bounds of ‘const char [5]’ [-Warray-bounds]
134 | return rhs[capacity] == '\0';
| ~~~^
apps/openmw_test_suite/esm/test_fixed_string.cpp: In member function ‘virtual void {anonymous}::EsmFixedString_equality_operator_for_not_convertible_to_uint32_with_const_char_pointer_Test::TestBody()’:
apps/openmw_test_suite/esm/test_fixed_string.cpp:164:20: note: at offset 5 into object ‘other’ of size 5
164 | const char other[5] = { 'a', 'b', 'c', 'd', '\0' };
| ^~~~~
2023-01-06 22:09:07 +01:00
elsid
c80ba92ab7
Add more tests for ESM::FixedString
2023-01-06 21:00:29 +01:00
elsid
7c60905266
Put ESM::FixedString tests into unnamed namespace
2023-01-06 21:00:29 +01:00
clang-format-bot
ddb0522bbf
Apply clang-format to code base
2022-09-22 21:35:26 +03:00
elsid
da0a1ac9ba
Do compile time checks in compile time instead of tests
2022-08-03 21:47:00 +02:00
elsid
c42c0dcbc9
Replace deprecated std::is_pod
...
apps/openmw_test_suite/esm/test_fixed_string.cpp:99:23: warning: ‘template<class _Tp> struct std::is_pod’ is deprecated: use is_standard_layout && is_trivial instead [-Wdeprecated-declarations]
99 | ASSERT_TRUE(std::is_pod<ESM::NAME>::value);
| ^~~~~~
2022-08-03 21:47:00 +02:00
elsid
3305b400dc
Use ESM::NAME instead of const char* and std::string as argument type
2022-02-14 23:40:40 +01:00
elsid
45db56b382
Rework fixed string
...
* Avoid inheritance.
* Define equality operators out of the class definition.
* Replace toString with toStringView where it doesn't make sense to create a string.
2022-01-28 18:39:09 +01:00
elsid
bf692a4bfa
Add more tests for fixed string
2022-01-28 03:39:28 +01:00
Andrei Kortunov
822764d0fa
Rework fixed strings handling
2020-10-05 21:52:22 +04:00
Azdul
7940317e42
Make sure that proper operator function is used for char[N] argument
2019-02-03 09:32:32 +01:00
Capostrophic
84a871cac7
Actually enable is_pod test
2018-07-28 23:56:42 +03:00
Capostrophic
85b7aa4f09
Uncomment is_pod test in fixed string tests
2018-05-03 19:47:39 +03:00
Roman Proskuryakov
5ae1864062
Add unit tests for ESM::FIXED_STRING
2016-05-07 23:27:33 +03:00