diff --git a/ChaosTests/Cipher/Arc4CryptTests.cpp b/ChaosTests/Cipher/Arc4CryptTests.cpp index 6edee4c..9375c38 100644 --- a/ChaosTests/Cipher/Arc4CryptTests.cpp +++ b/ChaosTests/Cipher/Arc4CryptTests.cpp @@ -58,11 +58,8 @@ TEST(Arc4CryptTests, UninitializedArc4CryptTest) Arc4Crypt arc4; { - std::array in; - in.fill(0); - - std::array out; - out.fill(0); + std::array in = {}; + std::array out = {}; ASSERT_THROW(arc4.Encrypt(out.begin(), in.begin(), in.size()), Chaos::Service::ChaosException); ASSERT_THROW(arc4.Decrypt(out.begin(), in.begin(), in.size()), Chaos::Service::ChaosException); @@ -117,8 +114,7 @@ TEST(Arc4CryptTests, EncryptOutIteratorUsageTest) Arc4Crypt crypt(key.begin(), key.end()); - std::array out; - out.fill(0); + std::array out = {}; std::array expected = { @@ -139,8 +135,7 @@ TEST(Arc4CryptTests, EncryptOutIteratorUsageTest) Arc4Crypt crypt(key.begin(), key.end()); - std::array out; - out.fill(0); + std::array out = {}; std::array expected = { @@ -161,11 +156,8 @@ TEST(Arc4CryptTests, EncryptOutIteratorUsageTest) Arc4Crypt crypt(key.begin(), key.end()); - std::array out; - out.fill(0); - - std::array expected; - expected.fill(0); + std::array out = {}; + std::array expected = {}; crypt.Encrypt(out.begin() + 3, data.begin(), 0); @@ -182,8 +174,7 @@ TEST(Arc4CryptTests, DecryptOutIteratorUsageTest) { Arc4Crypt crypt(key.begin(), key.end()); - std::array out; - out.fill(0); + std::array out = {}; std::array expected = { @@ -200,8 +191,7 @@ TEST(Arc4CryptTests, DecryptOutIteratorUsageTest) { Arc4Crypt crypt(key.begin(), key.end()); - std::array out; - out.fill(0); + std::array out = {}; std::array expected = { @@ -218,11 +208,8 @@ TEST(Arc4CryptTests, DecryptOutIteratorUsageTest) { Arc4Crypt crypt(key.begin(), key.end()); - std::array out; - out.fill(0); - - std::array expected; - expected.fill(0); + std::array out = {}; + std::array expected = {}; crypt.Decrypt(out.begin() + 3, data.begin(), 0); diff --git a/ChaosTests/Cipher/Arc4GenTests.cpp b/ChaosTests/Cipher/Arc4GenTests.cpp index 29ba990..988d694 100644 --- a/ChaosTests/Cipher/Arc4GenTests.cpp +++ b/ChaosTests/Cipher/Arc4GenTests.cpp @@ -360,8 +360,7 @@ TEST(Arc4GenTests, GenerateOutIteratorUsageTest) uint8_t key[] = { 0x01, 0x02, 0x03, 0x04, 0x05 }; Arc4Gen gen(key, key + std::size(key)); - std::array out; - out.fill(0); + std::array out = {}; std::array expected = { @@ -380,8 +379,7 @@ TEST(Arc4GenTests, GenerateOutIteratorUsageTest) uint8_t key[] = { 0x01, 0x02, 0x03, 0x04, 0x05 }; Arc4Gen gen(key, key + std::size(key)); - std::array out; - out.fill(0); + std::array out = {}; std::array expected = { @@ -400,11 +398,8 @@ TEST(Arc4GenTests, GenerateOutIteratorUsageTest) uint8_t key[] = { 0x01, 0x02, 0x03, 0x04, 0x05 }; Arc4Gen gen(key, key + std::size(key)); - std::array out; - out.fill(0); - - std::array expected; - expected.fill(0); + std::array out = {}; + std::array expected = {}; gen.Generate(out.begin() + 3, 0); diff --git a/ChaosTests/Cipher/DesCryptTests.cpp b/ChaosTests/Cipher/DesCryptTests.cpp index 94c06e7..1bf9ddd 100644 --- a/ChaosTests/Cipher/DesCryptTests.cpp +++ b/ChaosTests/Cipher/DesCryptTests.cpp @@ -46,8 +46,7 @@ TEST(DesCryptTests, EncryptTest) std::array operator()(const std::array & data, const std::array & key) const { - std::array result; - result.fill(0); + std::array result = {}; DesCrypt::Key desKey(key.begin(), key.end()); DesCrypt::DesEncryptor enc(desKey); @@ -206,8 +205,7 @@ TEST(DesCryptTests, DecryptTest) std::array operator()(const std::array & data, const std::array & key) const { - std::array result; - result.fill(0); + std::array result = {}; DesCrypt::Key desKey(key.begin(), key.end()); DesCrypt::DesDecryptor dec(desKey); diff --git a/ChaosTests/Mac/HmacTests.cpp b/ChaosTests/Mac/HmacTests.cpp index c26317b..a782bd6 100644 --- a/ChaosTests/Mac/HmacTests.cpp +++ b/ChaosTests/Mac/HmacTests.cpp @@ -99,8 +99,7 @@ TEST(HmacTests, LongKeyTest) TEST(HmacTests, UninitializedHmacTest) { - std::array in; - in.fill(0); + std::array in = {}; { Hmac hmac;