]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[test] Avoid using "static const" for test declarations
authorMichael Brown <mcb30@ipxe.org>
Wed, 7 Mar 2012 00:33:19 +0000 (00:33 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 7 Mar 2012 00:35:58 +0000 (00:35 +0000)
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>
src/tests/aes_cbc_test.c
src/tests/hash_df_test.c
src/tests/hmac_drbg_test.c

index 77622b253e4c3082c4b93b25661c42e4d2f06a98..371ec81b8b7f18d1531a38a2cb3aa0b47efacee3 100644 (file)
@@ -86,7 +86,7 @@ struct aes_cbc_test {
        static const uint8_t name ## _iv [] = iv_array;                 \
        static const uint8_t name ## _plaintext [] = plaintext_array;   \
        static const uint8_t name ## _ciphertext [] = ciphertext_array; \
-       static const struct aes_cbc_test name = {                       \
+       static struct aes_cbc_test name = {                             \
                .key = name ## _key,                                    \
                .key_len = sizeof ( name ## _key ),                     \
                .iv = name ## _iv,                                      \
index 0fb28492b7695c5c1f8ccb42e319056dd6e528dc..ccbc86ea07d9f6cf5fcb6441df94e1e928e1368a 100644 (file)
@@ -71,7 +71,7 @@ struct hash_df_test {
 #define HASH_DF_TEST( name, hash_algorithm, input_array, expected_array ) \
        static const uint8_t name ## _input [] = input_array;             \
        static const uint8_t name ## _expected [] = expected_array;       \
-       static const struct hash_df_test name = {                         \
+       static struct hash_df_test name = {                               \
                .hash = &(hash_algorithm),                                \
                .input = name ## _input,                                  \
                .input_len = sizeof ( name ## _input ),                   \
index 299d894987f63bcaca17fde92291f6807cec3beb..d03efef0357386e796fbb150bf7dbf478893bc5d 100644 (file)
@@ -87,7 +87,7 @@ struct hmac_drbg_test_instantiate {
                                    key, value )                        \
        static const uint8_t name ## _key [] = key;                     \
        static const uint8_t name ## _value [] = value;                 \
-       static const struct hmac_drbg_test_instantiate name = {         \
+       static struct hmac_drbg_test_instantiate name = {               \
                .hash = HMAC_DRBG_HASH ( hmac_drbg ),                   \
                .out_len = HMAC_DRBG_OUTLEN_BYTES ( hmac_drbg ),        \
                .entropy = entropy_array,                               \
@@ -169,7 +169,7 @@ struct hmac_drbg_test_reseed {
                               additional_array, key, value )           \
        static const uint8_t name ## _key [] = key;                     \
        static const uint8_t name ## _value [] = value;                 \
-       static const struct hmac_drbg_test_reseed name = {              \
+       static struct hmac_drbg_test_reseed name = {                    \
                .hash = HMAC_DRBG_HASH ( hmac_drbg ),                   \
                .out_len = HMAC_DRBG_OUTLEN_BYTES ( hmac_drbg ),        \
                .entropy = entropy_array,                               \
@@ -240,7 +240,7 @@ struct hmac_drbg_test_generate {
        static const uint8_t name ## _key [] = key;                     \
        static const uint8_t name ## _value [] = value;                 \
        static const uint8_t name ## _data [] = data;                   \
-       static const struct hmac_drbg_test_generate name = {            \
+       static struct hmac_drbg_test_generate name = {                  \
                .hash = HMAC_DRBG_HASH ( hmac_drbg ),                   \
                .out_len = HMAC_DRBG_OUTLEN_BYTES ( hmac_drbg ),        \
                .additional = additional_array,                         \
@@ -300,7 +300,7 @@ struct hmac_drbg_test_generate_fail {
  */
 #define HMAC_DRBG_TEST_GENERATE_FAIL( name, hmac_drbg,                 \
                                      additional_array, len )           \
-       static const struct hmac_drbg_test_generate_fail name = {       \
+       static struct hmac_drbg_test_generate_fail name = {             \
                .hash = HMAC_DRBG_HASH ( hmac_drbg ),                   \
                .additional = additional_array,                         \
                .additional_len = sizeof ( additional_array ),          \