Skip to content

Commit

Permalink
fix: 覆盖所有tag值
Browse files Browse the repository at this point in the history
  • Loading branch information
dihambo committed Sep 27, 2024
1 parent c96c10e commit c0b0dfc
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tests/asn1test.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,18 @@ static void print_octets(const uint8_t *o, size_t olen)

static int test_asn1_tag(void)
{
int i;
format_print(stderr, 0, 0, "Tags:\n");
for (i = 1; i <= 13; i++) {
format_print(stderr, 0, 4, "%s (0x%02x)\n", asn1_tag_name(i), i);
}
for (i = 18; i <= 30; i++) {
format_print(stderr, 0, 4, "%s (0x%02x)\n", asn1_tag_name(i), i);
}
printf("%s() ok\n", __FUNCTION__);
return 1;
int tag;
format_print(stderr, 0, 0, "Testing all tag values from 0 to 255:\n");
for (tag = 0; tag <= 255; tag++) {
const char *name = asn1_tag_name(tag);
if (name) {
format_print(stderr, 0, 4, "%s (0x%02x)\n", name, tag);
} else {
format_print(stderr, 0, 4, "Unknown Tag (0x%02x)\n", tag);
}
}
printf("%s() ok\n", __FUNCTION__);
return 1;
}

static int test_asn1_length(void)
Expand Down

0 comments on commit c0b0dfc

Please sign in to comment.