Просмотр исходного кода

[test] Avoid using "static const" for test declarations

gcc will not warn about unused constant static variables.  An unused
test declaration is almost certainly a bug, so ensure that warnings
are generated.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 лет назад
Родитель
Сommit
8ad1e7ac12
3 измененных файлов: 6 добавлений и 6 удалений
  1. 1
    1
      src/tests/aes_cbc_test.c
  2. 1
    1
      src/tests/hash_df_test.c
  3. 4
    4
      src/tests/hmac_drbg_test.c

+ 1
- 1
src/tests/aes_cbc_test.c Просмотреть файл

@@ -86,7 +86,7 @@ struct aes_cbc_test {
86 86
 	static const uint8_t name ## _iv [] = iv_array;			\
87 87
 	static const uint8_t name ## _plaintext [] = plaintext_array;	\
88 88
 	static const uint8_t name ## _ciphertext [] = ciphertext_array;	\
89
-	static const struct aes_cbc_test name = {			\
89
+	static struct aes_cbc_test name = {				\
90 90
 		.key = name ## _key,					\
91 91
 		.key_len = sizeof ( name ## _key ),			\
92 92
 		.iv = name ## _iv,					\

+ 1
- 1
src/tests/hash_df_test.c Просмотреть файл

@@ -71,7 +71,7 @@ struct hash_df_test {
71 71
 #define HASH_DF_TEST( name, hash_algorithm, input_array, expected_array ) \
72 72
 	static const uint8_t name ## _input [] = input_array;		  \
73 73
 	static const uint8_t name ## _expected [] = expected_array;	  \
74
-	static const struct hash_df_test name = {			  \
74
+	static struct hash_df_test name = {				  \
75 75
 		.hash = &(hash_algorithm),				  \
76 76
 		.input = name ## _input,				  \
77 77
 		.input_len = sizeof ( name ## _input ),			  \

+ 4
- 4
src/tests/hmac_drbg_test.c Просмотреть файл

@@ -87,7 +87,7 @@ struct hmac_drbg_test_instantiate {
87 87
 				    key, value )			\
88 88
 	static const uint8_t name ## _key [] = key;			\
89 89
 	static const uint8_t name ## _value [] = value;			\
90
-	static const struct hmac_drbg_test_instantiate name = {		\
90
+	static struct hmac_drbg_test_instantiate name = {		\
91 91
 		.hash = HMAC_DRBG_HASH ( hmac_drbg ),			\
92 92
 		.out_len = HMAC_DRBG_OUTLEN_BYTES ( hmac_drbg ),	\
93 93
 		.entropy = entropy_array,				\
@@ -169,7 +169,7 @@ struct hmac_drbg_test_reseed {
169 169
 			       additional_array, key, value )		\
170 170
 	static const uint8_t name ## _key [] = key;			\
171 171
 	static const uint8_t name ## _value [] = value;			\
172
-	static const struct hmac_drbg_test_reseed name = {		\
172
+	static struct hmac_drbg_test_reseed name = {			\
173 173
 		.hash = HMAC_DRBG_HASH ( hmac_drbg ),			\
174 174
 		.out_len = HMAC_DRBG_OUTLEN_BYTES ( hmac_drbg ),	\
175 175
 		.entropy = entropy_array,				\
@@ -240,7 +240,7 @@ struct hmac_drbg_test_generate {
240 240
 	static const uint8_t name ## _key [] = key;			\
241 241
 	static const uint8_t name ## _value [] = value;			\
242 242
 	static const uint8_t name ## _data [] = data;			\
243
-	static const struct hmac_drbg_test_generate name = {		\
243
+	static struct hmac_drbg_test_generate name = {			\
244 244
 		.hash = HMAC_DRBG_HASH ( hmac_drbg ),			\
245 245
 		.out_len = HMAC_DRBG_OUTLEN_BYTES ( hmac_drbg ),	\
246 246
 		.additional = additional_array,				\
@@ -300,7 +300,7 @@ struct hmac_drbg_test_generate_fail {
300 300
  */
301 301
 #define HMAC_DRBG_TEST_GENERATE_FAIL( name, hmac_drbg,			\
302 302
 				      additional_array, len )		\
303
-	static const struct hmac_drbg_test_generate_fail name = {	\
303
+	static struct hmac_drbg_test_generate_fail name = {		\
304 304
 		.hash = HMAC_DRBG_HASH ( hmac_drbg ),			\
305 305
 		.additional = additional_array,				\
306 306
 		.additional_len = sizeof ( additional_array ),		\

Загрузка…
Отмена
Сохранить