From: Arran Cudbard-Bell Date: Thu, 22 Apr 2021 15:47:35 +0000 (-0500) Subject: Add test attribute instances X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f3e964f2113091764f262b660ffa46fffebf0d0c;p=thirdparty%2Ffreeradius-server.git Add test attribute instances Makes it easy to duplicate a set of test attributes, giving each one a unique name and identifier --- diff --git a/src/lib/util/dict_test.c b/src/lib/util/dict_test.c index c9fef1ae1a3..54918f165a7 100644 --- a/src/lib/util/dict_test.c +++ b/src/lib/util/dict_test.c @@ -148,11 +148,17 @@ fr_dict_test_attr_t const fr_dict_test_attrs[] = { * * @param[in] dict Test dictionary to add. * @param[in] test_defs Test attribute definitions to add. + * @param[in] base to add to all attribute numbers. + * @param[in] inst number to add to test attribute. + * i.e. if the attribute name is "Foo" + * the instance number will be appended + * to create "Foo-" * @return * - 0 on success. * - -1 on failure. */ -static int dict_test_attrs_init(fr_dict_t *dict, fr_dict_test_attr_t const *test_defs) +int fr_dict_test_attrs_init(fr_dict_t *dict, fr_dict_test_attr_t const *test_defs, + unsigned int base, int inst) { fr_dict_test_attr_t const *p; fr_dict_attr_flags_t dict_flags = {}; @@ -161,12 +167,40 @@ static int dict_test_attrs_init(fr_dict_t *dict, fr_dict_test_attr_t const *test fr_dict_attr_t const *parent = p->parent ? *p->parent : fr_dict_root(dict); fr_dict_attr_t const *attr; - if (fr_dict_attr_add(dict, parent, p->name, p->attr, p->type, &dict_flags) < 0) return -1; - - attr = fr_dict_attr_by_name(NULL, parent, p->name); - if (!attr) { - fr_strerror_printf("Failed adding test attribute \"%s\"", p->name); - return -1; + /* + * We only mangle top level attributes + */ + if (!p->parent) { + char const *name; + char *buff = NULL; + + if (inst >= 0) { + name = buff = talloc_asprintf(NULL, "%s-%u", p->name, (unsigned int)inst); + } else { + name = p->name; + } + + if (fr_dict_attr_add(dict, parent, name, p->attr + base, p->type, &dict_flags) < 0) { + talloc_free(buff); + return -1; + } + + attr = fr_dict_attr_by_name(NULL, parent, name); + if (!attr) { + fr_strerror_printf("Failed adding test attribute \"%s\"", name); + talloc_free(buff); + return -1; + } + + talloc_free(buff); + } else { + if (fr_dict_attr_add(dict, parent, p->name, p->attr, p->type, &dict_flags) < 0) return -1; + + attr = fr_dict_attr_by_name(NULL, parent, p->name); + if (!attr) { + fr_strerror_printf("Failed adding test attribute \"%s\"", p->name); + return -1; + } } /* Add the enumeration values */ @@ -215,7 +249,7 @@ int fr_dict_test_init(TALLOC_CTX *ctx, fr_dict_t **dict_p, fr_dict_test_attr_t c return -1; } - if (dict_test_attrs_init(dict, test_defs) < 0) goto error; + if (fr_dict_test_attrs_init(dict, test_defs, 0, 0) < 0) goto error; fr_dict_test = dict; diff --git a/src/lib/util/dict_test.h b/src/lib/util/dict_test.h index 862ddf9c039..b94e2d0d1bb 100644 --- a/src/lib/util/dict_test.h +++ b/src/lib/util/dict_test.h @@ -148,6 +148,9 @@ extern fr_dict_attr_t const *fr_dict_attr_test_enum; extern fr_dict_test_attr_t const fr_dict_test_attrs[]; +int fr_dict_test_attrs_init(fr_dict_t *dict, fr_dict_test_attr_t const *test_defs, + unsigned int base, int inst); + int fr_dict_test_init(TALLOC_CTX *ctx, fr_dict_t **dict_p, fr_dict_test_attr_t const *test_defs); #ifdef __cplusplus diff --git a/src/lib/util/pair_legacy_tests.c b/src/lib/util/pair_legacy_tests.c index 1af5e9fe2e9..7264f360ecd 100644 --- a/src/lib/util/pair_legacy_tests.c +++ b/src/lib/util/pair_legacy_tests.c @@ -94,7 +94,7 @@ static void test_fr_pair_make(void) 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); @@ -109,20 +109,20 @@ static void test_fr_pair_mark_xlat(void) { 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); @@ -132,29 +132,29 @@ static void test_fr_pair_list_afrom_str(void) { 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); @@ -179,7 +179,7 @@ static void test_fr_pair_list_afrom_file(void) { 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; @@ -188,22 +188,22 @@ static void test_fr_pair_list_afrom_file(void) 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); @@ -216,7 +216,7 @@ static void test_fr_pair_list_move(void) 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); @@ -229,7 +229,7 @@ static void test_fr_pair_list_move(void) 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()"); @@ -237,10 +237,10 @@ static void test_fr_pair_list_move(void) 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()"); @@ -248,7 +248,7 @@ static void test_fr_pair_list_move(void) 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); diff --git a/src/lib/util/pair_list_perf_test.c b/src/lib/util/pair_list_perf_test.c index dabd0e7c55d..3cd343464ac 100644 --- a/src/lib/util/pair_list_perf_test.c +++ b/src/lib/util/pair_list_perf_test.c @@ -58,114 +58,114 @@ static fr_dict_t *test_dict; 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. @@ -224,6 +224,12 @@ void pair_list_perf_init(void) 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(); }