Fix clang-tidy warnings 62/320062/2
authorKrzysztof Malysa <k.malysa@samsung.com>
Fri, 21 Feb 2025 10:20:45 +0000 (11:20 +0100)
committerKrzysztof Małysa <k.malysa@samsung.com>
Fri, 21 Feb 2025 10:44:19 +0000 (10:44 +0000)
Change-Id: Ifd55bcfa1c2722d344ef82c216514fb8386a47ce

tests/encrypted_tunnel_tests.cpp

index ba7bd9796bc2d30a3456fb9ff15a372797012829..dca98ee4cba7c5d275e361806dce2cfa44080c60 100644 (file)
@@ -73,7 +73,7 @@ TEST(EncryptedTunnel, works_Positive)
         EncryptedTunnel(std::move(tunnelUPtr), std::move(reader), std::move(writer));
 
     // Test writing
-    for (int i = 0; i < 0x123; ++i) {
+    for (unsigned i = 0; i < 0x123; ++i) {
         auto msg = CryptoBuffer{static_cast<uint8_t>(i & 0xff)};
         auto paddedMsg = msg;
         paddedMsg.resize(32, 0);
@@ -92,8 +92,8 @@ TEST(EncryptedTunnel, works_Positive)
                       0x09, 0x95, 0x93, 0x04, 0xae, 0x0e, 0x91, 0x75, 0x82, 0xc0, 0xd5, 0x39}));
 
     // Test reading and reading padding.
-    for (int blocks = 0; blocks < 10; ++blocks) {
-        for (int i = blocks * 32; i < (blocks + 1) * 32; ++i) {
+    for (size_t blocks = 0; blocks < 10; ++blocks) {
+        for (size_t i = blocks * 32; i < (blocks + 1) * 32; ++i) {
             auto msg = Crypto::RandomBytes(i);
             auto paddedMsg = msg;
             paddedMsg.resize((blocks + 1) * 32);
@@ -104,8 +104,8 @@ TEST(EncryptedTunnel, works_Positive)
     }
 
     // Test writing and writing padding.
-    for (int blocks = 0; blocks < 10; ++blocks) {
-        for (int i = blocks * 32; i < (blocks + 1) * 32; ++i) {
+    for (size_t blocks = 0; blocks < 10; ++blocks) {
+        for (size_t i = blocks * 32; i < (blocks + 1) * 32; ++i) {
             auto msg = Crypto::RandomBytes(i);
             auto paddedMsg = msg;
             paddedMsg.resize((blocks + 1) * 32);