From 93365a7f450d5bab3ee5176fd36e11d5a23330fe Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 6 Aug 2021 16:54:22 +0200 Subject: [PATCH] Rename variable to avoid a name clash digits is also a local variable in host_test.function, leading to compilers complaining about that shadowing the global variable in test_suite_base64.function. Signed-off-by: Gilles Peskine --- tests/suites/test_suite_base64.function | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/suites/test_suite_base64.function b/tests/suites/test_suite_base64.function index 8775c8dfbc..67fbb67505 100644 --- a/tests/suites/test_suite_base64.function +++ b/tests/suites/test_suite_base64.function @@ -4,7 +4,7 @@ #include #if defined(MBEDTLS_TEST_HOOKS) -static const char digits[] = +static const char base64_digits[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; #endif /* MBEDTLS_TEST_HOOKS */ @@ -45,7 +45,7 @@ void enc_chars( ) unsigned char digit = mbedtls_base64_enc_char( value ); TEST_CF_PUBLIC( &value, sizeof( value ) ); TEST_CF_PUBLIC( &digit, sizeof( digit ) ); - TEST_EQUAL( digit, digits[value] ); + TEST_EQUAL( digit, base64_digits[value] ); } } /* END_CASE */ @@ -59,12 +59,12 @@ void dec_chars( ) for( unsigned c = 0; c <= 0xff; c++ ) { mbedtls_test_set_step( c ); - /* digits is 0-terminated. sizeof()-1 excludes the trailing 0. */ - p = memchr( digits, c, sizeof( digits ) - 1 ); + /* base64_digits is 0-terminated. sizeof()-1 excludes the trailing 0. */ + p = memchr( base64_digits, c, sizeof( base64_digits ) - 1 ); if( p == NULL ) expected = -1; else - expected = p - digits; + expected = p - base64_digits; TEST_CF_SECRET( &c, sizeof( c ) ); signed char actual = mbedtls_base64_dec_value( c ); TEST_CF_PUBLIC( &c, sizeof( c ) );