fr_pair_list_init(&list);
TEST_CASE("Creating 'vp' using fr_pair_make()");
- TEST_CHECK((vp = fr_pair_make(ctx, test_dict, &list, "Test-String", test_string, T_DOUBLE_QUOTED_STRING)) != NULL);
+ TEST_CHECK((vp = fr_pair_make(ctx, test_dict, &list, "Test-String-0", test_string, T_DOUBLE_QUOTED_STRING)) != NULL);
TEST_CASE("Validating VP_VERIFY()");
VP_VERIFY(vp);
{
fr_pair_t *vp;
- TEST_CASE("Find 'Test-String'");
+ TEST_CASE("Find 'Test-String-0'");
TEST_CHECK((vp = fr_pair_find_by_da(&test_pairs, fr_dict_attr_test_string, 0)) != NULL);
TEST_CASE("Validating VP_VERIFY()");
VP_VERIFY(vp);
TEST_CASE("Marking 'vp' using fr_pair_mark_xlat()");
- TEST_CHECK(fr_pair_mark_xlat(vp, "Hello %{Test-Uint32}") == 0);
+ TEST_CHECK(fr_pair_mark_xlat(vp, "Hello %{Test-Uint32-0}") == 0);
TEST_CASE("Validating VP_VERIFY()");
VP_VERIFY(vp);
- TEST_CASE("Check (vp->xlat == 'Hello %{Test-Uint32}')");
- TEST_CHECK(vp && strcmp(vp->xlat, "Hello %{Test-Uint32}") == 0);
+ TEST_CASE("Check (vp->xlat == 'Hello %{Test-Uint32-0}')");
+ TEST_CHECK(vp && strcmp(vp->xlat, "Hello %{Test-Uint32-0}") == 0);
TEST_CHECK(vp && vp->type == VT_XLAT);
talloc_free(vp);
{
fr_pair_t *vp;
fr_pair_list_t list;
- char const *buffer = "Test-Uint32 = 123, Test-String = \"Testing123\"";
+ char const *buffer = "Test-Uint32-0 = 123, Test-String-0 = \"Testing123\"";
fr_pair_list_init(&list);
TEST_CASE("Create 'vp' using fr_pair_list_afrom_str()");
TEST_CHECK(fr_pair_list_afrom_str(autofree, test_dict, buffer, strlen(buffer), &list) == T_EOL);
- TEST_CASE("Looking for Test-Uint32");
+ TEST_CASE("Looking for Test-Uint32-0");
TEST_CHECK((vp = fr_pair_find_by_da(&list, fr_dict_attr_test_uint32, 0)) != NULL);
TEST_CASE("Validating VP_VERIFY()");
VP_VERIFY(vp);
- TEST_CASE("Checking if (Test-Uint32 == 123)");
+ TEST_CASE("Checking if (Test-Uint32-0 == 123)");
TEST_CHECK(vp && vp->vp_uint32 == 123);
- TEST_CASE("Looking for Test-String");
+ TEST_CASE("Looking for Test-String-0");
TEST_CHECK((vp = fr_pair_find_by_da(&list, fr_dict_attr_test_string, 0)) != NULL);
TEST_CASE("Validating VP_VERIFY()");
VP_VERIFY(vp);
- TEST_CASE("Checking if (Test-String == 'Testing123')");
+ TEST_CASE("Checking if (Test-String-0 == 'Testing123')");
TEST_CHECK(vp && strcmp(vp->vp_strvalue, "Testing123") == 0);
fr_pair_list_free(&list);
{
fr_pair_t *vp;
fr_pair_list_t list;
- char const *buffer = "Test-Uint32 = 123\nTest-String = \"Testing123\"\n";
+ char const *buffer = "Test-Uint32-0 = 123\nTest-String-0 = \"Testing123\"\n";
FILE *fp = open_buffer_as_file(buffer, strlen(buffer));
bool pfiledone;
TEST_CASE("Create 'vp' using fr_pair_list_afrom_file()");
TEST_CHECK(fr_pair_list_afrom_file(autofree, test_dict, &list, fp, &pfiledone) == 0);
- TEST_CASE("Looking for Test-Uint32");
+ TEST_CASE("Looking for Test-Uint32-0");
TEST_CHECK((vp = fr_pair_find_by_da(&list, fr_dict_attr_test_uint32, 0)) != NULL);
TEST_CASE("Validating VP_VERIFY()");
VP_VERIFY(vp);
- TEST_CASE("Checking if (Test-Uint32 == 123)");
+ TEST_CASE("Checking if (Test-Uint32-0 == 123)");
TEST_CHECK(vp && vp->vp_uint32 == 123);
- TEST_CASE("Looking for Test-String");
+ TEST_CASE("Looking for Test-String-0");
TEST_CHECK((vp = fr_pair_find_by_da(&list, fr_dict_attr_test_string, 0)) != NULL);
TEST_CASE("Validating VP_VERIFY()");
VP_VERIFY(vp);
- TEST_CASE("Checking if (Test-String == 'Testing123')");
+ TEST_CASE("Checking if (Test-String-0 == 'Testing123')");
TEST_CHECK(vp && strcmp(vp->vp_strvalue, "Testing123") == 0);
fr_pair_list_free(&list);
fr_pair_t *vp;
fr_pair_list_t old_list, new_list;
bool pfiledone;
- char const *fake_file = "Test-Uint32 = 123\nTest-String = \"Testing123\"\n";
+ char const *fake_file = "Test-Uint32-0 = 123\nTest-String-0 = \"Testing123\"\n";
FILE *fp = open_buffer_as_file(fake_file, strlen(fake_file));
fr_pair_list_init(&old_list);
TEST_CASE("Move pair from 'old_list' to 'old_list' using fr_pair_list_move()");
fr_pair_list_move(&new_list, &old_list);
- TEST_CASE("Looking for Test-Uint32");
+ TEST_CASE("Looking for Test-Uint32-0");
TEST_CHECK((vp = fr_pair_find_by_da(&new_list, fr_dict_attr_test_uint32, 0)) != NULL);
TEST_CASE("Validating VP_VERIFY()");
TEST_CHECK(vp != NULL);
- TEST_CASE("Checking if (Test-Uint32 == 123)");
+ TEST_CASE("Checking if (Test-Uint32-0 == 123)");
TEST_CHECK(vp && vp->vp_uint32 == 123);
- TEST_CASE("Looking for Test-String");
+ TEST_CASE("Looking for Test-String-0");
TEST_CHECK((vp = fr_pair_find_by_da(&new_list, fr_dict_attr_test_string, 0)) != NULL);
TEST_CASE("Validating VP_VERIFY()");
TEST_CHECK(vp != NULL);
- TEST_CASE("Checking if (Test-String == 'Testing123')");
+ TEST_CASE("Checking if (Test-String-0 == 'Testing123')");
TEST_CHECK(vp && strcmp(vp->vp_strvalue, "Testing123") == 0);
fr_pair_list_free(&old_list);
static TALLOC_CTX *autofree;
static char const *test_attrs_0 = \
- "Test-String = \"hello\"," /* 1 */
- "Test-Octets = 0x0102030405060708," /* 2 */
- "Test-IPv4-Addr = 192.168.1.1," /* 3 */
- "Test-IPv4-Prefix = 192.168/16," /* 4 */
- "Test-IPv6-Addr = fd12:3456:789a:1::1," /* 5 */
- "Test-IPv6-Prefix = fd12:3456:789a:1::/64," /* 6 */
- "Test-Ethernet = 11:22:33:44:55:66," /* 7 */
- "Test-Uint8 = 255," /* 8 */
- "Test-Uint16 = 65535," /* 9 */
- "Test-Uint32 = 4294967295," /* 10 */
- "Test-Uint64 = 18446744073709551615," /* 11 */
- "Test-Int8 = -120," /* 12 */
- "Test-Int16 = -4573," /* 13 */
- "Test-Int32 = 45645," /* 14 */
- "Test-Int64 = 85645," /* 15 */
- "Test-Float32 = 1.134," /* 16 */
- "Test-Float64 = 1.1345," /* 17 */
- "Test-Date += \"Jan 1 2020 00:00:00 UTC\"," /* 18 */
- "Test-TLV.String = \"nested\"," /* 19 */
- "Test-Struct.uint32 = 1234"; /* 20 */
+ "Test-String-0 = \"hello\"," /* 1 */
+ "Test-Octets-0 = 0x0102030405060708," /* 2 */
+ "Test-IPv4-Addr-0 = 192.168.1.1," /* 3 */
+ "Test-IPv4-Prefix-0 = 192.168/16," /* 4 */
+ "Test-IPv6-Addr-0 = fd12:3456:789a:1::1," /* 5 */
+ "Test-IPv6-Prefix-0 = fd12:3456:789a:1::/64," /* 6 */
+ "Test-Ethernet-0 = 11:22:33:44:55:66," /* 7 */
+ "Test-Uint8-0 = 255," /* 8 */
+ "Test-Uint16-0 = 65535," /* 9 */
+ "Test-Uint32-0 = 4294967295," /* 10 */
+ "Test-Uint64-0 = 18446744073709551615," /* 11 */
+ "Test-Int8-0 = -120," /* 12 */
+ "Test-Int16-0 = -4573," /* 13 */
+ "Test-Int32-0 = 45645," /* 14 */
+ "Test-Int64-0 = 85645," /* 15 */
+ "Test-Float32-0 = 1.134," /* 16 */
+ "Test-Float64-0 = 1.1345," /* 17 */
+ "Test-Date-0 += \"Jan 1 2020 00:00:00 UTC\"," /* 18 */
+ "Test-TLV-0.String = \"nested\"," /* 19 */
+ "Test-Struct-0.uint32 = 1234"; /* 20 */
static char const *test_attrs_25 = \
- "Test-String += \"hello\"," /* 1 */
- "Test-String += \"goodbye\"," /* 2 */
- "Test-String += \"hola\"," /* 3 */
- "Test-String += \"hasta pronto\"," /* 4 */
- "Test-String += \"bonjour\"," /* 5 */
- "Test-Octets += 0x0102030405060708," /* 6 */
- "Test-IPv4-Addr = 192.168.1.1," /* 7 */
- "Test-IPv4-Prefix = 192.168/16," /* 8 */
- "Test-IPv6-Addr = fd12:3456:789a:1::1," /* 9 */
- "Test-IPv6-Prefix = fd12:3456:789a:1::/64," /* 10 */
- "Test-Ethernet = 11:22:33:44:55:66," /* 11 */
- "Test-Uint8 = 255," /* 12 */
- "Test-Uint16 = 65535," /* 13 */
- "Test-Uint32 = 4294967295," /* 14 */
- "Test-Uint64 = 18446744073709551615," /* 15 */
- "Test-Int64 = 85645," /* 16 */
- "Test-Float32 = 1.134," /* 17 */
- "Test-Date += \"Jan 1 2020 00:00:00 UTC\"," /* 18 */
- "Test-TLV.String = \"nested\"," /* 19 */
- "Test-Struct.uint32 = 1234"; /* 20 */
+ "Test-String-0 += \"hello\"," /* 1 */
+ "Test-String-0 += \"goodbye\"," /* 2 */
+ "Test-String-0 += \"hola\"," /* 3 */
+ "Test-String-0 += \"hasta pronto\"," /* 4 */
+ "Test-String-0 += \"bonjour\"," /* 5 */
+ "Test-Octets-0 += 0x0102030405060708," /* 6 */
+ "Test-IPv4-Addr-0 = 192.168.1.1," /* 7 */
+ "Test-IPv4-Prefix-0 = 192.168/16," /* 8 */
+ "Test-IPv6-Addr-0 = fd12:3456:789a:1::1," /* 9 */
+ "Test-IPv6-Prefix-0 = fd12:3456:789a:1::/64," /* 10 */
+ "Test-Ethernet-0 = 11:22:33:44:55:66," /* 11 */
+ "Test-Uint8-0 = 255," /* 12 */
+ "Test-Uint16-0 = 65535," /* 13 */
+ "Test-Uint32-0 = 4294967295," /* 14 */
+ "Test-Uint64-0 = 18446744073709551615," /* 15 */
+ "Test-Int64-0 = 85645," /* 16 */
+ "Test-Float32-0 = 1.134," /* 17 */
+ "Test-Date-0 += \"Jan 1 2020 00:00:00 UTC\"," /* 18 */
+ "Test-TLV-0.String = \"nested\"," /* 19 */
+ "Test-Struct-0.uint32 = 1234"; /* 20 */
static char const *test_attrs_50 = \
- "Test-String += \"hello\"," /* 1 */
- "Test-String += \"goodbye\"," /* 2 */
- "Test-String += \"hola\"," /* 3 */
- "Test-String += \"hasta pronto\"," /* 4 */
- "Test-String += \"bonjour\"," /* 5 */
- "Test-String += \"au revoir\"," /* 6 */
- "Test-String += \"halo\"," /* 7 */
- "Test-String += \"kwaheri\"," /* 8 */
- "Test-String += \"ciao\"," /* 9 */
- "Test-String += \"arrivederci\"," /* 10 */
- "Test-IPv4-Addr = 192.168.1.1," /* 11 */
- "Test-IPv4-Prefix = 192.168/16," /* 12 */
- "Test-IPv6-Addr = fd12:3456:789a:1::1," /* 13 */
- "Test-IPv6-Prefix = fd12:3456:789a:1::/64," /* 14 */
- "Test-Ethernet = 11:22:33:44:55:66," /* 15 */
- "Test-Uint8 = 255," /* 16 */
- "Test-Int64 = 85645," /* 17 */
- "Test-Date += \"Jan 1 2020 00:00:00 UTC\"," /* 18 */
- "Test-TLV.String = \"nested\"," /* 19 */
- "Test-Struct.uint32 = 1234"; /* 20 */
+ "Test-String-0 += \"hello\"," /* 1 */
+ "Test-String-0 += \"goodbye\"," /* 2 */
+ "Test-String-0 += \"hola\"," /* 3 */
+ "Test-String-0 += \"hasta pronto\"," /* 4 */
+ "Test-String-0 += \"bonjour\"," /* 5 */
+ "Test-String-0 += \"au revoir\"," /* 6 */
+ "Test-String-0 += \"halo\"," /* 7 */
+ "Test-String-0 += \"kwaheri\"," /* 8 */
+ "Test-String-0 += \"ciao\"," /* 9 */
+ "Test-String-0 += \"arrivederci\"," /* 10 */
+ "Test-IPv4-Addr-0 = 192.168.1.1," /* 11 */
+ "Test-IPv4-Prefix-0 = 192.168/16," /* 12 */
+ "Test-IPv6-Addr-0 = fd12:3456:789a:1::1," /* 13 */
+ "Test-IPv6-Prefix-0 = fd12:3456:789a:1::/64," /* 14 */
+ "Test-Ethernet-0 = 11:22:33:44:55:66," /* 15 */
+ "Test-Uint8-0 = 255," /* 16 */
+ "Test-Int64-0 = 85645," /* 17 */
+ "Test-Date-0 += \"Jan 1 2020 00:00:00 UTC\"," /* 18 */
+ "Test-TLV-0.String = \"nested\"," /* 19 */
+ "Test-Struct-0.uint32 = 1234"; /* 20 */
static char const *test_attrs_75 = \
- "Test-String += \"hello\"," /* 1 */
- "Test-String += \"goodbye\"," /* 2 */
- "Test-String += \"hola\"," /* 3 */
- "Test-String += \"hasta pronto\"," /* 4 */
- "Test-String += \"bonjour\"," /* 5 */
- "Test-String += \"au revoir\"," /* 6 */
- "Test-String += \"halo\"," /* 7 */
- "Test-String += \"kwaheri\"," /* 8 */
- "Test-String += \"ciao\"," /* 9 */
- "Test-String += \"arrivederci\"," /* 10 */
- "Test-String += \"halo\"," /* 11 */
- "Test-String += \"selamat tinggal\"," /* 12 */
- "Test-String += \"你好\"," /* 13 */
- "Test-String += \"再见\"," /* 14 */
- "Test-String += \"Привет\"," /* 15 */
- "Test-Uint8 = 255," /* 16 */
- "Test-Int64 = 85645," /* 17 */
- "Test-Date += \"Jan 1 2020 00:00:00 UTC\"," /* 18 */
- "Test-TLV.String = \"nested\"," /* 19 */
- "Test-Struct.uint32 = 1234"; /* 20 */
+ "Test-String-0 += \"hello\"," /* 1 */
+ "Test-String-0 += \"goodbye\"," /* 2 */
+ "Test-String-0 += \"hola\"," /* 3 */
+ "Test-String-0 += \"hasta pronto\"," /* 4 */
+ "Test-String-0 += \"bonjour\"," /* 5 */
+ "Test-String-0 += \"au revoir\"," /* 6 */
+ "Test-String-0 += \"halo\"," /* 7 */
+ "Test-String-0 += \"kwaheri\"," /* 8 */
+ "Test-String-0 += \"ciao\"," /* 9 */
+ "Test-String-0 += \"arrivederci\"," /* 10 */
+ "Test-String-0 += \"halo\"," /* 11 */
+ "Test-String-0 += \"selamat tinggal\"," /* 12 */
+ "Test-String-0 += \"你好\"," /* 13 */
+ "Test-String-0 += \"再见\"," /* 14 */
+ "Test-String-0 += \"Привет\"," /* 15 */
+ "Test-Uint8-0 = 255," /* 16 */
+ "Test-Int64-0 = 85645," /* 17 */
+ "Test-Date-0 += \"Jan 1 2020 00:00:00 UTC\"," /* 18 */
+ "Test-TLV-0.String = \"nested\"," /* 19 */
+ "Test-Struct-0.uint32 = 1234"; /* 20 */
static char const *test_attrs_100 = \
- "Test-String += \"hello\"," /* 1 */
- "Test-String += \"goodbye\"," /* 2 */
- "Test-String += \"hola\"," /* 3 */
- "Test-String += \"hasta pronto\"," /* 4 */
- "Test-String += \"bonjour\"," /* 5 */
- "Test-String += \"au revoir\"," /* 6 */
- "Test-String += \"halo\"," /* 7 */
- "Test-String += \"kwaheri\"," /* 8 */
- "Test-String += \"ciao\"," /* 9 */
- "Test-String += \"arrivederci\"," /* 10 */
- "Test-String += \"halo\"," /* 11 */
- "Test-String += \"selamat tinggal\"," /* 12 */
- "Test-String += \"你好\"," /* 13 */
- "Test-String += \"再见\"," /* 14 */
- "Test-String += \"Привет\"," /* 15 */
- "Test-String += \"до свидания\"," /* 16 */
- "Test-String += \"вся слава советской россии\","/* 17 */
- "Test-String += \"у нас есть видео с мочой\"," /* 18 */
- "Test-String += \"Байден заплатит за\"," /* 19 */
- "Test-String += \"приставание к бурундукам\""; /* 20 */
+ "Test-String-0 += \"hello\"," /* 1 */
+ "Test-String-0 += \"goodbye\"," /* 2 */
+ "Test-String-0 += \"hola\"," /* 3 */
+ "Test-String-0 += \"hasta pronto\"," /* 4 */
+ "Test-String-0 += \"bonjour\"," /* 5 */
+ "Test-String-0 += \"au revoir\"," /* 6 */
+ "Test-String-0 += \"halo\"," /* 7 */
+ "Test-String-0 += \"kwaheri\"," /* 8 */
+ "Test-String-0 += \"ciao\"," /* 9 */
+ "Test-String-0 += \"arrivederci\"," /* 10 */
+ "Test-String-0 += \"halo\"," /* 11 */
+ "Test-String-0 += \"selamat tinggal\"," /* 12 */
+ "Test-String-0 += \"你好\"," /* 13 */
+ "Test-String-0 += \"再见\"," /* 14 */
+ "Test-String-0 += \"Привет\"," /* 15 */
+ "Test-String-0 += \"до свидания\"," /* 16 */
+ "Test-String-0 += \"вся слава советской россии\"," /* 17 */
+ "Test-String-0 += \"у нас есть видео с мочой\"," /* 18 */
+ "Test-String-0 += \"Байден заплатит за\"," /* 19 */
+ "Test-String-0 += \"приставание к бурундукам\""; /* 20 */
static fr_pair_t **source_vps_0; //!< List with zero duplicate attributes.
static fr_pair_t **source_vps_25; //!< List with 25% duplicate attributes.
pair_list_init(autofree, &source_vps_50, test_dict, test_attrs_50);
pair_list_init(autofree, &source_vps_75, test_dict, test_attrs_75);
pair_list_init(autofree, &source_vps_100, test_dict, test_attrs_100);
+
+ if (fr_dict_test_attrs_init(test_dict, fr_dict_test_attrs, 100, 1) < 0) goto error;
+ if (fr_dict_test_attrs_init(test_dict, fr_dict_test_attrs, 200, 2) < 0) goto error;
+ if (fr_dict_test_attrs_init(test_dict, fr_dict_test_attrs, 300, 3) < 0) goto error;
+ if (fr_dict_test_attrs_init(test_dict, fr_dict_test_attrs, 400, 4) < 0) goto error;
+
fr_time_start();
}