From ae211a02dd2f602d442d907b9e5f021ecfcce897 Mon Sep 17 00:00:00 2001 From: Vicky Min Date: Wed, 15 Sep 2021 21:14:04 +0000 Subject: [PATCH] Add curly braces in oemcrypto_test.cpp On the gcc 9.3 compiler, oemcrypto/test/oemcrypto_test.cpp will not compile without curly braces in some places so we must add them to these 4 tests. Test: OEMCryptoLoadsCertificateAlternates tests and CheckUsageTableSizeAPI16 Bug: 200057124 Change-Id: Ia097ba992a024adfd3311b82b812de60985a0de1 --- libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp index d5e9e8d7..d9f5a4f4 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp @@ -466,7 +466,9 @@ TEST_F(OEMCryptoClientTest, CheckUsageTableSizeAPI16) { const size_t maximum = OEMCrypto_MaximumUsageTableHeaderSize(); printf(" Max Usage Table Size: %zu.\n", maximum); // A maximum of 0 means the table is constrained by dynamic memory allocation. - if (maximum > 0) ASSERT_GE(maximum, RequiredUsageSize()); + if (maximum > 0) { + ASSERT_GE(maximum, RequiredUsageSize()); + } } // @@ -5468,7 +5470,9 @@ TEST_F(OEMCryptoLoadsCertificateAlternates, OEMCryptoResult sts; LoadWithAllowedSchemes(kSign_PKCS1_Block1, false); // If the device is a cast receiver, then this scheme is required. - if (global_features.cast_receiver) ASSERT_TRUE(key_loaded_); + if (global_features.cast_receiver) { + ASSERT_TRUE(key_loaded_); + } if (key_loaded_) { Session s; ASSERT_NO_FATAL_FAILURE(s.open()); @@ -5502,7 +5506,9 @@ TEST_F(OEMCryptoLoadsCertificateAlternates, OEMCryptoResult sts; LoadWithAllowedSchemes(kSign_PKCS1_Block1, false); // If the device is a cast receiver, then this scheme is required. - if (global_features.cast_receiver) ASSERT_TRUE(key_loaded_); + if (global_features.cast_receiver) { + ASSERT_TRUE(key_loaded_); + } if (key_loaded_) { Session s; ASSERT_NO_FATAL_FAILURE(s.open()); @@ -5539,7 +5545,9 @@ TEST_F(OEMCryptoLoadsCertificateAlternates, TestSignaturePKCS1) { // scheme is used by cast receivers. LoadWithAllowedSchemes(kSign_PKCS1_Block1, false); // If the device is a cast receiver, then this scheme is required. - if (global_features.cast_receiver) ASSERT_TRUE(key_loaded_); + if (global_features.cast_receiver) { + ASSERT_TRUE(key_loaded_); + } // If the key loaded with no error, then we will verify that it is not used // for forbidden padding schemes. if (key_loaded_) {