summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2012-03-19 10:14:19 +0100
committerSimon Josefsson <simon@josefsson.org>2012-03-19 10:14:19 +0100
commite4c605d4c575d9f56f44970fdf3bee567b8fac18 (patch)
tree8f2e4e80663f25be739760c5b15efb382ea34d66 /tests
parent8ab3a5231ef83834a17818edf2f2b1911b02bb05 (diff)
downloadlibtasn1-e4c605d4c575d9f56f44970fdf3bee567b8fac18.tar.gz
libtasn1-e4c605d4c575d9f56f44970fdf3bee567b8fac18.tar.bz2
libtasn1-e4c605d4c575d9f56f44970fdf3bee567b8fac18.zip
Indent code.
Diffstat (limited to 'tests')
-rw-r--r--tests/Test_overflow.c6
-rw-r--r--tests/Test_simple.c83
2 files changed, 45 insertions, 44 deletions
diff --git a/tests/Test_overflow.c b/tests/Test_overflow.c
index 2136899..747507f 100644
--- a/tests/Test_overflow.c
+++ b/tests/Test_overflow.c
@@ -66,7 +66,8 @@ main (void)
puts ("OK: asn1_get_length_der intnum");
else
{
- printf ("ERROR: asn1_get_length_der intnum (l %ld len %d)\n", l, len);
+ printf ("ERROR: asn1_get_length_der intnum (l %ld len %d)\n", l,
+ len);
return 1;
}
}
@@ -84,7 +85,8 @@ main (void)
puts ("OK: asn1_get_length_der overflow");
else
{
- printf ("ERROR: asn1_get_length_der overflow (l %ld len %d)\n", l, len);
+ printf ("ERROR: asn1_get_length_der overflow (l %ld len %d)\n", l,
+ len);
return 1;
}
}
diff --git a/tests/Test_simple.c b/tests/Test_simple.c
index 73d5178..9224036 100644
--- a/tests/Test_simple.c
+++ b/tests/Test_simple.c
@@ -35,45 +35,45 @@ struct tv
};
static const struct tv tv[] = {
- { 0, "", 2, "\x01\x00" },
- { 1, "\x00", 3, "\x02\x07\x00" },
- { 2, "\x00", 3, "\x02\x06\x00" },
- { 3, "\x00", 3, "\x02\x05\x00" },
- { 4, "\x00", 3, "\x02\x04\x00" },
- { 5, "\x00", 3, "\x02\x03\x00" },
- { 6, "\x00", 3, "\x02\x02\x00" },
- { 7, "\x00", 3, "\x02\x01\x00" },
- { 8, "\x00\x00", 3, "\x02\x00\x00" },
- { 9, "\x00\x00", 4, "\x03\x07\x00\x00" },
- { 10, "\x00\x00", 4, "\x03\x06\x00\x00" },
- { 11, "\x00\x00", 4, "\x03\x05\x00\x00" },
- { 12, "\x00\x00", 4, "\x03\x04\x00\x00" },
- { 13, "\x00\x00", 4, "\x03\x03\x00\x00" },
- { 14, "\x00\x00", 4, "\x03\x02\x00\x00" },
- { 15, "\x00\x00", 4, "\x03\x01\x00\x00" },
- { 16, "\x00\x00", 4, "\x03\x00\x00\x00" },
- { 17, "\x00\x00\x00", 5, "\x04\x07\x00\x00\x00" },
- { 18, "\x00\x00\x00", 5, "\x04\x06\x00\x00\x00" },
- { 19, "\x00\x00\x00", 5, "\x04\x05\x00\x00\x00" },
- { 1, "\xFF", 3, "\x02\x07\x80" },
- { 2, "\xFF", 3, "\x02\x06\xc0" },
- { 3, "\xFF", 3, "\x02\x05\xe0" },
- { 4, "\xFF", 3, "\x02\x04\xf0" },
- { 5, "\xFF", 3, "\x02\x03\xf8" },
- { 6, "\xFF", 3, "\x02\x02\xfc" },
- { 7, "\xFF", 3, "\x02\x01\xfe" },
- { 8, "\xFF\xFF", 3, "\x02\x00\xff" },
- { 9, "\xFF\xFF", 4, "\x03\x07\xff\x80" },
- { 10, "\xFF\xFF", 4, "\x03\x06\xff\xc0" },
- { 11, "\xFF\xFF", 4, "\x03\x05\xff\xe0" },
- { 12, "\xFF\xFF", 4, "\x03\x04\xff\xf0" },
- { 13, "\xFF\xFF", 4, "\x03\x03\xff\xf8" },
- { 14, "\xFF\xFF", 4, "\x03\x02\xff\xfc" },
- { 15, "\xFF\xFF", 4, "\x03\x01\xff\xfe" },
- { 16, "\xFF\xFF", 4, "\x03\x00\xff\xff" },
- { 17, "\xFF\xFF\xFF", 5, "\x04\x07\xff\xff\x80" },
- { 18, "\xFF\xFF\xFF", 5, "\x04\x06\xff\xff\xc0" },
- { 19, "\xFF\xFF\xFF", 5, "\x04\x05\xff\xff\xe0" },
+ {0, "", 2, "\x01\x00"},
+ {1, "\x00", 3, "\x02\x07\x00"},
+ {2, "\x00", 3, "\x02\x06\x00"},
+ {3, "\x00", 3, "\x02\x05\x00"},
+ {4, "\x00", 3, "\x02\x04\x00"},
+ {5, "\x00", 3, "\x02\x03\x00"},
+ {6, "\x00", 3, "\x02\x02\x00"},
+ {7, "\x00", 3, "\x02\x01\x00"},
+ {8, "\x00\x00", 3, "\x02\x00\x00"},
+ {9, "\x00\x00", 4, "\x03\x07\x00\x00"},
+ {10, "\x00\x00", 4, "\x03\x06\x00\x00"},
+ {11, "\x00\x00", 4, "\x03\x05\x00\x00"},
+ {12, "\x00\x00", 4, "\x03\x04\x00\x00"},
+ {13, "\x00\x00", 4, "\x03\x03\x00\x00"},
+ {14, "\x00\x00", 4, "\x03\x02\x00\x00"},
+ {15, "\x00\x00", 4, "\x03\x01\x00\x00"},
+ {16, "\x00\x00", 4, "\x03\x00\x00\x00"},
+ {17, "\x00\x00\x00", 5, "\x04\x07\x00\x00\x00"},
+ {18, "\x00\x00\x00", 5, "\x04\x06\x00\x00\x00"},
+ {19, "\x00\x00\x00", 5, "\x04\x05\x00\x00\x00"},
+ {1, "\xFF", 3, "\x02\x07\x80"},
+ {2, "\xFF", 3, "\x02\x06\xc0"},
+ {3, "\xFF", 3, "\x02\x05\xe0"},
+ {4, "\xFF", 3, "\x02\x04\xf0"},
+ {5, "\xFF", 3, "\x02\x03\xf8"},
+ {6, "\xFF", 3, "\x02\x02\xfc"},
+ {7, "\xFF", 3, "\x02\x01\xfe"},
+ {8, "\xFF\xFF", 3, "\x02\x00\xff"},
+ {9, "\xFF\xFF", 4, "\x03\x07\xff\x80"},
+ {10, "\xFF\xFF", 4, "\x03\x06\xff\xc0"},
+ {11, "\xFF\xFF", 4, "\x03\x05\xff\xe0"},
+ {12, "\xFF\xFF", 4, "\x03\x04\xff\xf0"},
+ {13, "\xFF\xFF", 4, "\x03\x03\xff\xf8"},
+ {14, "\xFF\xFF", 4, "\x03\x02\xff\xfc"},
+ {15, "\xFF\xFF", 4, "\x03\x01\xff\xfe"},
+ {16, "\xFF\xFF", 4, "\x03\x00\xff\xff"},
+ {17, "\xFF\xFF\xFF", 5, "\x04\x07\xff\xff\x80"},
+ {18, "\xFF\xFF\xFF", 5, "\x04\x06\xff\xff\xc0"},
+ {19, "\xFF\xFF\xFF", 5, "\x04\x05\xff\xff\xe0"},
};
int
@@ -115,8 +115,7 @@ main (int argc, char *argv[])
}
#endif
- if (der_len != tv[i].derlen
- || memcmp (der, tv[i].der, der_len) != 0)
+ if (der_len != tv[i].derlen || memcmp (der, tv[i].der, der_len) != 0)
{
fprintf (stderr, "asn1_bit_der iter %ld\n", i);
return 1;
@@ -140,7 +139,7 @@ main (int argc, char *argv[])
STRING value "011011100101110111" can be any of the following,
among others, depending on the choice of padding bits, the form
of length octets [...]".
- */
+ */
/* 03 04 06 6e 5d c0 DER encoding */