Browse Source

[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 years ago
parent
commit
8ad1e7ac12
3 changed files with 6 additions and 6 deletions
  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 View File

86
 	static const uint8_t name ## _iv [] = iv_array;			\
86
 	static const uint8_t name ## _iv [] = iv_array;			\
87
 	static const uint8_t name ## _plaintext [] = plaintext_array;	\
87
 	static const uint8_t name ## _plaintext [] = plaintext_array;	\
88
 	static const uint8_t name ## _ciphertext [] = ciphertext_array;	\
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
 		.key = name ## _key,					\
90
 		.key = name ## _key,					\
91
 		.key_len = sizeof ( name ## _key ),			\
91
 		.key_len = sizeof ( name ## _key ),			\
92
 		.iv = name ## _iv,					\
92
 		.iv = name ## _iv,					\

+ 1
- 1
src/tests/hash_df_test.c View File

71
 #define HASH_DF_TEST( name, hash_algorithm, input_array, expected_array ) \
71
 #define HASH_DF_TEST( name, hash_algorithm, input_array, expected_array ) \
72
 	static const uint8_t name ## _input [] = input_array;		  \
72
 	static const uint8_t name ## _input [] = input_array;		  \
73
 	static const uint8_t name ## _expected [] = expected_array;	  \
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
 		.hash = &(hash_algorithm),				  \
75
 		.hash = &(hash_algorithm),				  \
76
 		.input = name ## _input,				  \
76
 		.input = name ## _input,				  \
77
 		.input_len = sizeof ( name ## _input ),			  \
77
 		.input_len = sizeof ( name ## _input ),			  \

+ 4
- 4
src/tests/hmac_drbg_test.c View File

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

Loading…
Cancel
Save