0008-asn1_test-rename-the-main-functions-to-the-test-name.patch 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. From c0f39b9eae745a36c44fc0dfa106675405ea154f Mon Sep 17 00:00:00 2001
  2. From: Gary Lin <glin@suse.com>
  3. Date: Fri, 16 Aug 2024 14:18:44 +0800
  4. Subject: [PATCH 08/13] asn1_test: rename the main functions to the test names
  5. This commit changes the main functions in the testcases to the test
  6. names so that the real 'main' test function can invokes them.
  7. Signed-off-by: Daniel Axtens <dja@axtens.net>
  8. Signed-off-by: Gary Lin <glin@suse.com>
  9. Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
  10. ---
  11. grub-core/tests/asn1/tests/CVE-2018-1000654.c | 2 +-
  12. grub-core/tests/asn1/tests/Test_overflow.c | 2 +-
  13. grub-core/tests/asn1/tests/Test_simple.c | 2 +-
  14. grub-core/tests/asn1/tests/Test_strings.c | 2 +-
  15. grub-core/tests/asn1/tests/object-id-decoding.c | 2 +-
  16. grub-core/tests/asn1/tests/object-id-encoding.c | 2 +-
  17. grub-core/tests/asn1/tests/octet-string.c | 2 +-
  18. grub-core/tests/asn1/tests/reproducers.c | 2 +-
  19. 8 files changed, 8 insertions(+), 8 deletions(-)
  20. diff --git a/grub-core/tests/asn1/tests/CVE-2018-1000654.c b/grub-core/tests/asn1/tests/CVE-2018-1000654.c
  21. index 98c2a8b8c..a935ab541 100644
  22. --- a/grub-core/tests/asn1/tests/CVE-2018-1000654.c
  23. +++ b/grub-core/tests/asn1/tests/CVE-2018-1000654.c
  24. @@ -27,7 +27,7 @@
  25. #include "CVE-2018-1000654-2_asn1_tab.h"
  26. int
  27. -main (int argc, char *argv[])
  28. +test_CVE_2018_1000654 (void)
  29. {
  30. int result, verbose = 0;
  31. asn1_node definitions = NULL;
  32. diff --git a/grub-core/tests/asn1/tests/Test_overflow.c b/grub-core/tests/asn1/tests/Test_overflow.c
  33. index 73e9d8c68..bc28d0826 100644
  34. --- a/grub-core/tests/asn1/tests/Test_overflow.c
  35. +++ b/grub-core/tests/asn1/tests/Test_overflow.c
  36. @@ -23,7 +23,7 @@
  37. #include "asn1_test.h"
  38. int
  39. -main (int argc, char **argv)
  40. +test_overflow (void)
  41. {
  42. /* Test that values larger than long are rejected. This has worked
  43. fine with all versions of libtasn1. */
  44. diff --git a/grub-core/tests/asn1/tests/Test_simple.c b/grub-core/tests/asn1/tests/Test_simple.c
  45. index 3aa8ce21b..12993bfba 100644
  46. --- a/grub-core/tests/asn1/tests/Test_simple.c
  47. +++ b/grub-core/tests/asn1/tests/Test_simple.c
  48. @@ -73,7 +73,7 @@ static const struct tv tv[] = {
  49. };
  50. int
  51. -main (int argc, char *argv[])
  52. +test_simple (void)
  53. {
  54. int result;
  55. unsigned char der[100];
  56. diff --git a/grub-core/tests/asn1/tests/Test_strings.c b/grub-core/tests/asn1/tests/Test_strings.c
  57. index c49229af9..2538f2558 100644
  58. --- a/grub-core/tests/asn1/tests/Test_strings.c
  59. +++ b/grub-core/tests/asn1/tests/Test_strings.c
  60. @@ -70,7 +70,7 @@ static const struct tv ber[] = {
  61. };
  62. int
  63. -main (int argc, char *argv[])
  64. +test_strings (void)
  65. {
  66. int ret;
  67. unsigned char tl[ASN1_MAX_TL_SIZE];
  68. diff --git a/grub-core/tests/asn1/tests/object-id-decoding.c b/grub-core/tests/asn1/tests/object-id-decoding.c
  69. index 0a77db752..fdbb8ea21 100644
  70. --- a/grub-core/tests/asn1/tests/object-id-decoding.c
  71. +++ b/grub-core/tests/asn1/tests/object-id-decoding.c
  72. @@ -70,7 +70,7 @@ static const struct tv tv[] = {
  73. };
  74. int
  75. -main (int argc, char *argv[])
  76. +test_object_id_decoding (void)
  77. {
  78. char str[128];
  79. int ret, ret_len;
  80. diff --git a/grub-core/tests/asn1/tests/object-id-encoding.c b/grub-core/tests/asn1/tests/object-id-encoding.c
  81. index e32835830..a497015e3 100644
  82. --- a/grub-core/tests/asn1/tests/object-id-encoding.c
  83. +++ b/grub-core/tests/asn1/tests/object-id-encoding.c
  84. @@ -80,7 +80,7 @@ static const struct tv tv[] = {
  85. };
  86. int
  87. -main (int argc, char *argv[])
  88. +test_object_id_encoding (void)
  89. {
  90. unsigned char der[128];
  91. int ret, der_len, i, j;
  92. diff --git a/grub-core/tests/asn1/tests/octet-string.c b/grub-core/tests/asn1/tests/octet-string.c
  93. index 8e803af41..8c49c6e0c 100644
  94. --- a/grub-core/tests/asn1/tests/octet-string.c
  95. +++ b/grub-core/tests/asn1/tests/octet-string.c
  96. @@ -108,7 +108,7 @@ static const struct tv tv[] = {
  97. };
  98. int
  99. -main (int argc, char *argv[])
  100. +test_octet_string (void)
  101. {
  102. unsigned char str[100];
  103. unsigned char der[100];
  104. diff --git a/grub-core/tests/asn1/tests/reproducers.c b/grub-core/tests/asn1/tests/reproducers.c
  105. index ce24e0991..e843b74b9 100644
  106. --- a/grub-core/tests/asn1/tests/reproducers.c
  107. +++ b/grub-core/tests/asn1/tests/reproducers.c
  108. @@ -49,7 +49,7 @@ const asn1_static_node tab[] = {
  109. };
  110. int
  111. -main (int argc, char *argv[])
  112. +test_reproducers (void)
  113. {
  114. int result, verbose = 0;
  115. asn1_node definitions = NULL;
  116. --
  117. 2.43.0