unit-tests: Re-align identification_create_from_string() unit test table data
authorMartin Willi <martin@revosec.ch>
Wed, 29 Oct 2014 10:12:38 +0000 (11:12 +0100)
committerMartin Willi <martin@revosec.ch>
Thu, 30 Oct 2014 10:03:48 +0000 (11:03 +0100)
src/libstrongswan/tests/suites/test_identification.c

index 5de7857..9b14b28 100644 (file)
@@ -122,58 +122,58 @@ static struct {
                } data;
        } result;
 } string_data[] = {
-       {NULL,      ID_ANY,  { .type = ENC_CHUNK }},
-       {"",        ID_ANY,  { .type = ENC_CHUNK }},
-       {"%any",    ID_ANY,  { .type = ENC_CHUNK }},
-       {"%any6",   ID_ANY,  { .type = ENC_CHUNK }},
-       {"0.0.0.0", ID_ANY,  { .type = ENC_CHUNK }},
-       {"0::0",    ID_ANY,  { .type = ENC_CHUNK }},
-       {"::",      ID_ANY,  { .type = ENC_CHUNK }},
-       {"*",       ID_ANY,  { .type = ENC_CHUNK }},
-       {"any",     ID_FQDN, { .type = ENC_SIMPLE }},
-       {"any6",    ID_FQDN, { .type = ENC_SIMPLE }},
-       {"0",       ID_FQDN, { .type = ENC_SIMPLE }},
-       {"**",      ID_FQDN, { .type = ENC_SIMPLE }},
-       {"192.168.1.1", ID_IPV4_ADDR, { .type = ENC_CHUNK,
-                                                                       .data.c = chunk_from_chars(0xc0, 0xa8, 0x01, 0x01) }},
-       {"192.168.",ID_FQDN, { .type = ENC_SIMPLE }},
-       {".",       ID_FQDN, { .type = ENC_SIMPLE }},
-       {"fec0::1", ID_IPV6_ADDR, { .type = ENC_CHUNK,
-                                                               .data.c = chunk_from_chars(0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                                                                                                                  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01) }},
-       {"fec0::",  ID_IPV6_ADDR, { .type = ENC_CHUNK,
-                                                               .data.c = chunk_from_chars(0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                                                                                                                  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) }},
-       {"fec0:",   ID_KEY_ID,    { .type = ENC_SIMPLE }},
-       {":",       ID_KEY_ID,    { .type = ENC_SIMPLE }},
-       {"alice@strongswan.org", ID_RFC822_ADDR, { .type = ENC_SIMPLE }},
-       {"alice@strongswan", ID_RFC822_ADDR, { .type = ENC_SIMPLE }},
-       {"alice@",  ID_RFC822_ADDR, { .type = ENC_SIMPLE }},
-       {"alice",   ID_FQDN, { .type = ENC_SIMPLE }},
-       {"@",       ID_FQDN, { .type = ENC_CHUNK }},
-       {" @",      ID_RFC822_ADDR, { .type = ENC_SIMPLE }},
-       {"@strongswan.org",  ID_FQDN, { .type = ENC_STRING,
-                                                                       .data.s = "strongswan.org" }},
-       {"@#deadbeef", ID_KEY_ID, { .type = ENC_CHUNK,
-                                                               .data.c = chunk_from_chars(0xde, 0xad, 0xbe, 0xef) }},
-       {"@#deadbee",  ID_KEY_ID, { .type = ENC_CHUNK,
-                                                               .data.c = chunk_from_chars(0x0d, 0xea, 0xdb, 0xee) }},
-       {"foo=bar",    ID_KEY_ID, { .type = ENC_SIMPLE }},
-       {"foo=",           ID_KEY_ID, { .type = ENC_SIMPLE }},
-       {"=bar",           ID_KEY_ID, { .type = ENC_SIMPLE }},
-       {"C=",             ID_DER_ASN1_DN, { .type = ENC_CHUNK,
-                                                                        .data.c = chunk_from_chars(0x30, 0x0b, 0x31, 0x09, 0x30, 0x07, 0x06,
-                                                                                                                               0x03, 0x55, 0x04, 0x06, 0x13, 0x00)}},
-       {"C=CH",           ID_DER_ASN1_DN, { .type = ENC_CHUNK,
-                                                                        .data.c = chunk_from_chars(0x30, 0x0d, 0x31, 0x0b, 0x30, 0x09, 0x06,
-                                                                                                                               0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x48)}},
-       {"C=CH,",          ID_DER_ASN1_DN, { .type = ENC_CHUNK,
-                                                                        .data.c = chunk_from_chars(0x30, 0x0d, 0x31, 0x0b, 0x30, 0x09, 0x06,
-                                                                                                                               0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x48)}},
-       {"C=CH, ",         ID_DER_ASN1_DN, { .type = ENC_CHUNK,
-                                                                        .data.c = chunk_from_chars(0x30, 0x0d, 0x31, 0x0b, 0x30, 0x09, 0x06,
-                                                                                                                               0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x48)}},
-       {"C=CH, O",        ID_KEY_ID, { .type = ENC_SIMPLE }},
+       {NULL,                                          ID_ANY,                 { .type = ENC_CHUNK }},
+       {"",                                            ID_ANY,                 { .type = ENC_CHUNK }},
+       {"%any",                                        ID_ANY,                 { .type = ENC_CHUNK }},
+       {"%any6",                                       ID_ANY,                 { .type = ENC_CHUNK }},
+       {"0.0.0.0",                                     ID_ANY,                 { .type = ENC_CHUNK }},
+       {"0::0",                                        ID_ANY,                 { .type = ENC_CHUNK }},
+       {"::",                                          ID_ANY,                 { .type = ENC_CHUNK }},
+       {"*",                                           ID_ANY,                 { .type = ENC_CHUNK }},
+       {"any",                                         ID_FQDN,                { .type = ENC_SIMPLE }},
+       {"any6",                                        ID_FQDN,                { .type = ENC_SIMPLE }},
+       {"0",                                           ID_FQDN,                { .type = ENC_SIMPLE }},
+       {"**",                                          ID_FQDN,                { .type = ENC_SIMPLE }},
+       {"192.168.1.1",                         ID_IPV4_ADDR,   { .type = ENC_CHUNK,
+               .data.c = chunk_from_chars(0xc0,0xa8,0x01,0x01) }},
+       {"192.168.",                            ID_FQDN,                { .type = ENC_SIMPLE }},
+       {".",                                           ID_FQDN,                { .type = ENC_SIMPLE }},
+       {"fec0::1",                                     ID_IPV6_ADDR,   { .type = ENC_CHUNK,
+               .data.c = chunk_from_chars(0xfe,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
+                                                                  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01) }},
+       {"fec0::",                                      ID_IPV6_ADDR,   { .type = ENC_CHUNK,
+               .data.c = chunk_from_chars(0xfe,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
+                                                                  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00) }},
+       {"fec0:",                                       ID_KEY_ID,              { .type = ENC_SIMPLE }},
+       {":",                                           ID_KEY_ID,              { .type = ENC_SIMPLE }},
+       {"alice@strongswan.org",        ID_RFC822_ADDR, { .type = ENC_SIMPLE }},
+       {"alice@strongswan",            ID_RFC822_ADDR, { .type = ENC_SIMPLE }},
+       {"alice@",                                      ID_RFC822_ADDR, { .type = ENC_SIMPLE }},
+       {"alice",                                       ID_FQDN,                { .type = ENC_SIMPLE }},
+       {"@",                                           ID_FQDN,                { .type = ENC_CHUNK }},
+       {" @",                                          ID_RFC822_ADDR, { .type = ENC_SIMPLE }},
+       {"@strongswan.org",                     ID_FQDN,                { .type = ENC_STRING,
+               .data.s = "strongswan.org" }},
+       {"@#deadbeef",                          ID_KEY_ID,              { .type = ENC_CHUNK,
+               .data.c = chunk_from_chars(0xde,0xad,0xbe,0xef) }},
+       {"@#deadbee",                           ID_KEY_ID,              { .type = ENC_CHUNK,
+               .data.c = chunk_from_chars(0x0d,0xea,0xdb,0xee) }},
+       {"foo=bar",                                     ID_KEY_ID,              { .type = ENC_SIMPLE }},
+       {"foo=",                                        ID_KEY_ID,              { .type = ENC_SIMPLE }},
+       {"=bar",                                        ID_KEY_ID,              { .type = ENC_SIMPLE }},
+       {"C=",                                          ID_DER_ASN1_DN, { .type = ENC_CHUNK,
+               .data.c = chunk_from_chars(0x30,0x0b,0x31,0x09,0x30,0x07,0x06,
+                                                                  0x03,0x55,0x04,0x06,0x13,0x00) }},
+       {"C=CH",                                        ID_DER_ASN1_DN, { .type = ENC_CHUNK,
+               .data.c = chunk_from_chars(0x30,0x0d,0x31,0x0b,0x30,0x09,0x06,
+                                                                  0x03,0x55,0x04,0x06,0x13,0x02,0x43,0x48) }},
+       {"C=CH,",                                       ID_DER_ASN1_DN, { .type = ENC_CHUNK,
+               .data.c = chunk_from_chars(0x30,0x0d,0x31,0x0b,0x30,0x09,0x06,
+                                                                  0x03,0x55,0x04,0x06,0x13,0x02,0x43,0x48) }},
+       {"C=CH, ",                                      ID_DER_ASN1_DN, { .type = ENC_CHUNK,
+               .data.c = chunk_from_chars(0x30,0x0d,0x31,0x0b,0x30,0x09,0x06,
+                                                                  0x03,0x55,0x04,0x06,0x13,0x02,0x43,0x48) }},
+       {"C=CH, O",                                     ID_KEY_ID,              { .type = ENC_SIMPLE }},
 };
 
 START_TEST(test_from_string)