mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Fix 'maybe-uninitialized' g++ error on macos (#600)
This commit is contained in:
parent
24ebe3efe8
commit
181a438287
@ -55,7 +55,7 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_copy_constructor)
|
||||
{
|
||||
int a;
|
||||
int a{};
|
||||
|
||||
etl::fixed_iterator<const int*> fi1(&a);
|
||||
etl::fixed_iterator<const int*> fi2(fi1);
|
||||
@ -66,7 +66,7 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_constructor)
|
||||
{
|
||||
int a;
|
||||
int a{};
|
||||
|
||||
etl::fixed_iterator<const int*> fi(&a);
|
||||
|
||||
@ -76,7 +76,7 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_make)
|
||||
{
|
||||
int a;
|
||||
int a{};
|
||||
|
||||
etl::fixed_iterator<const int*> fi = &a;
|
||||
|
||||
@ -121,7 +121,7 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_conversion_operator)
|
||||
{
|
||||
int a;
|
||||
int a{};
|
||||
|
||||
etl::fixed_iterator<const int*> fi(&a);
|
||||
|
||||
@ -202,8 +202,8 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_assignment)
|
||||
{
|
||||
int a;
|
||||
int b;
|
||||
int a{};
|
||||
int b{};
|
||||
|
||||
etl::fixed_iterator<int*> fi = &a;
|
||||
fi = &b;
|
||||
@ -218,8 +218,8 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_equality)
|
||||
{
|
||||
int a;
|
||||
int b;
|
||||
int a{};
|
||||
int b{};
|
||||
|
||||
etl::fixed_iterator<int*> fi1 = &a;
|
||||
etl::fixed_iterator<int*> fi2 = &a;
|
||||
|
||||
@ -202,7 +202,7 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_hash_pointer)
|
||||
{
|
||||
int i;
|
||||
int i{};
|
||||
size_t hash = etl::hash<int*>()(&i);
|
||||
|
||||
CHECK_EQUAL(size_t(&i), hash);
|
||||
@ -211,7 +211,7 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_hash_const_pointer)
|
||||
{
|
||||
int i;
|
||||
int i{};
|
||||
size_t hash = etl::hash<const int*>()(&i);
|
||||
|
||||
CHECK_EQUAL(size_t(&i), hash);
|
||||
@ -220,7 +220,7 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_hash_const_pointer_const)
|
||||
{
|
||||
int i;
|
||||
int i{};
|
||||
const int * const pi = &i;
|
||||
|
||||
size_t hash = etl::hash<const int *>()(pi);
|
||||
|
||||
@ -298,7 +298,7 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_empty)
|
||||
{
|
||||
Data data;
|
||||
Data data{};
|
||||
|
||||
CHECK(!data.empty());
|
||||
CHECK(!data[0].empty());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user