Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

Location:
vendor/current/lib/util/tests
Files:
3 added
8 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/lib/util/tests/data_blob.c

    r414 r740  
    7979{
    8080        DATA_BLOB a = data_blob_string_const("\xC\xA\xF\xE");
    81         torture_assert_str_equal(tctx, data_blob_hex_string(tctx, &a), "0C0A0F0E", "hex string");
     81        torture_assert_str_equal(tctx, data_blob_hex_string_lower(tctx, &a), "0c0a0f0e", "hex string");
     82        torture_assert_str_equal(tctx, data_blob_hex_string_upper(tctx, &a), "0C0A0F0E", "hex string");
    8283        return true;
    8384}
     
    8586struct torture_suite *torture_local_util_data_blob(TALLOC_CTX *mem_ctx)
    8687{
    87         struct torture_suite *suite = torture_suite_create(mem_ctx, "DATABLOB");
     88        struct torture_suite *suite = torture_suite_create(mem_ctx, "datablob");
    8889
    8990        torture_suite_add_simple_test(suite, "string", test_string);
  • vendor/current/lib/util/tests/file.c

    r414 r740  
    9292struct torture_suite *torture_local_util_file(TALLOC_CTX *mem_ctx)
    9393{
    94         struct torture_suite *suite = torture_suite_create(mem_ctx, "FILE");
     94        struct torture_suite *suite = torture_suite_create(mem_ctx, "file");
    9595
    9696        torture_suite_add_simple_test(suite, "file_load_save",
    9797                                      test_file_load_save);
    9898
    99         torture_suite_add_simple_test(suite, "afdgets",
    100                                       test_afdgets);
     99        torture_suite_add_simple_test(suite, "afdgets", test_afdgets);
    101100
    102101        return suite;
  • vendor/current/lib/util/tests/genrand.c

    r414 r740  
    6060struct torture_suite *torture_local_genrand(TALLOC_CTX *mem_ctx)
    6161{
    62         struct torture_suite *suite = torture_suite_create(mem_ctx, "GENRAND");
     62        struct torture_suite *suite = torture_suite_create(mem_ctx, "genrand");
    6363        torture_suite_add_simple_test(suite, "reseed_callback", test_reseed_callback);
    6464        torture_suite_add_simple_test(suite, "check_password_quality", test_check_password_quality);
  • vendor/current/lib/util/tests/idtree.c

    r414 r740  
    116116struct torture_suite *torture_local_idtree(TALLOC_CTX *mem_ctx)
    117117{
    118         struct torture_suite *suite = torture_suite_create(mem_ctx, "IDTREE");
     118        struct torture_suite *suite = torture_suite_create(mem_ctx, "idtree");
    119119        torture_suite_add_simple_test(suite, "idtree", torture_local_idtree_simple);
    120120        return suite;
  • vendor/current/lib/util/tests/parmlist.c

    r414 r740  
    6060        torture_assert_str_equal(tctx, e->value, "mystring", "value");
    6161
    62         e = parmlist_get(pctx, "nonexistant");
    63         torture_assert(tctx, e == NULL, "nonexistant");
     62        e = parmlist_get(pctx, "non-existent");
     63        torture_assert(tctx, e == NULL, "non-existent");
    6464        return true;
    6565}
     
    8888        torture_assert_str_equal(tctx, "true", ret[0], "ret[0]");
    8989        torture_assert_str_equal(tctx, "false", ret[1], "ret[1]");
    90         torture_assert(tctx, NULL == parmlist_get_string_list(pctx, "nonexistant", NULL), "nonexistant");
     90        torture_assert(tctx, NULL == parmlist_get_string_list(pctx, "non-existent", NULL), "non-existent");
    9191
    9292        return true;
     
    9595struct torture_suite *torture_local_util_parmlist(TALLOC_CTX *mem_ctx)
    9696{
    97         struct torture_suite *suite = torture_suite_create(mem_ctx, "PARMLIST");
     97        struct torture_suite *suite = torture_suite_create(mem_ctx, "parmlist");
    9898
    9999        torture_suite_add_simple_test(suite, "get_int", test_get_int);
  • vendor/current/lib/util/tests/str.c

    r414 r740  
    9595struct torture_suite *torture_local_util_str(TALLOC_CTX *mem_ctx)
    9696{
    97         struct torture_suite *suite = torture_suite_create(mem_ctx, "STR");
     97        struct torture_suite *suite = torture_suite_create(mem_ctx, "str");
    9898
    9999        torture_suite_add_simple_test(suite, "string_sub_simple",
  • vendor/current/lib/util/tests/strlist.c

    r414 r740  
    2727struct test_list_element {
    2828        const char *list_as_string;
    29         const char *seperators;
     29        const char *separators;
    3030        const char *list[5];
    3131};
    3232
    33 struct test_list_element test_lists_strings[] = {
     33const struct test_list_element test_lists_strings[] = {
    3434        {
    3535                .list_as_string = "",
     
    4747                .list_as_string = "foo bar",
    4848                .list = { "foo bar", NULL },
    49                 .seperators = ";"
     49                .separators = ";"
    5050        },
    5151        {
     
    6060                .list_as_string = "\"foo bar\",comma;semicolon",
    6161                .list = { "\"foo bar\",comma", "semicolon", NULL },
    62                 .seperators = ";"
     62                .separators = ";"
    6363        }
    6464};
    6565
    66 struct test_list_element test_lists_shell_strings[] = {
     66const struct test_list_element test_lists_shell_strings[] = {
    6767        {
    6868                .list_as_string = "",
     
    8080                .list_as_string = "foo bar",
    8181                .list = { "foo bar", NULL },
    82                 .seperators = ";"
     82                .separators = ";"
    8383        },
    8484        {
     
    100100};
    101101
    102 static bool test_lists_shell(struct torture_context *tctx,
    103                              const void *data)
     102static bool test_lists_shell(struct torture_context *tctx, const void *data)
    104103{
    105104        const struct test_list_element *element = data;
    106         const char **ret1, **ret2, *tmp;
     105
     106        char **ret1, **ret2, *tmp;
    107107        bool match = true;
    108108        TALLOC_CTX *mem_ctx = tctx;
    109109
    110         ret1 = str_list_make_shell(mem_ctx, element->list_as_string, element->seperators);
     110        ret1 = str_list_make_shell(mem_ctx, element->list_as_string, element->separators);
    111111       
    112112        torture_assert(tctx, ret1, "str_list_make_shell() must not return NULL");
    113         tmp = str_list_join_shell(mem_ctx, ret1, element->seperators ? *element->seperators : ' ');
    114         ret2 = str_list_make_shell(mem_ctx, tmp, element->seperators);
     113        tmp = str_list_join_shell(mem_ctx, (const char **) ret1, element->separators ? *element->separators : ' ');
     114        ret2 = str_list_make_shell(mem_ctx, tmp, element->separators);
    115115
    116116        if ((ret1 == NULL || ret2 == NULL) && ret2 != ret1) {
     
    131131        torture_assert(tctx, match, talloc_asprintf(tctx,
    132132                "str_list_{make,join}_shell: Error double parsing, first run:\n%s\nSecond run: \n%s", element->list_as_string, tmp));
    133         torture_assert(tctx, str_list_equal(ret1, element->list),
     133        torture_assert(tctx, str_list_equal((const char * const *) ret1,
     134                                            element->list),
    134135                       talloc_asprintf(tctx,
    135136                                       "str_list_make_shell(%s) failed to create correct list",
     
    142143{
    143144        const struct test_list_element *element = data;
     145
    144146        char **result;
    145         result = str_list_make(tctx, element->list_as_string, element->seperators);
     147        result = str_list_make(tctx, element->list_as_string, element->separators);
    146148        torture_assert(tctx, result, "str_list_make() must not return NULL");
    147         torture_assert(tctx, str_list_equal((const char **)result, element->list),
     149        torture_assert(tctx, str_list_equal((const char * const *) result,
     150                                            element->list),
    148151                       talloc_asprintf(tctx,
    149152                                       "str_list_make(%s) failed to create correct list",
     
    251254static bool test_list_add(struct torture_context *tctx)
    252255{
    253         char **result, **result2;
     256        const char **result, **result2;
    254257        const char *list[] = {
    255258                "element_0",
     
    259262                NULL
    260263        };
    261         result = str_list_make(tctx, "element_0, element_1, element_2", NULL);
     264        result = (const char **) str_list_make(tctx, "element_0, element_1, element_2", NULL);
    262265        torture_assert(tctx, result, "str_list_make() must not return NULL");
    263         result2 = str_list_add(result, "element_3");
     266        result2 = str_list_add((const char **) result, "element_3");
    264267        torture_assert(tctx, result2, "str_list_add() must not return NULL");
    265268        torture_assert(tctx, str_list_equal(result2, list),
     
    271274static bool test_list_add_const(struct torture_context *tctx)
    272275{
    273         char **result, **result2;
     276        const char **result, **result2;
    274277        const char *list[] = {
    275278                "element_0",
     
    279282                NULL
    280283        };
    281         result = str_list_make(tctx, "element_0, element_1, element_2", NULL);
     284        result = (const char **) str_list_make(tctx, "element_0, element_1, element_2", NULL);
    282285        torture_assert(tctx, result, "str_list_make() must not return NULL");
    283286        result2 = str_list_add_const(result, "element_3");
     
    291294static bool test_list_remove(struct torture_context *tctx)
    292295{
    293         char **result;
     296        const char **result;
    294297        const char *list[] = {
    295298                "element_0",
     
    298301                NULL
    299302        };
    300         result = str_list_make(tctx, "element_0, element_1, element_2, element_3", NULL);
     303        result = (const char **) str_list_make(tctx, "element_0, element_1, element_2, element_3", NULL);
    301304        torture_assert(tctx, result, "str_list_make() must not return NULL");
    302305        str_list_remove(result, "element_2");
     
    337340static bool test_list_unique(struct torture_context *tctx)
    338341{
    339         char **result;
     342        const char **result;
    340343        const char *list[] = {
    341344                "element_0",
     
    355358                NULL
    356359        };
    357         result = str_list_copy(tctx, list_dup);
     360        result = (const char **) str_list_copy(tctx, list_dup);
    358361        /* We must copy the list, as str_list_unique does a talloc_realloc() on it's parameter */
    359362        result = str_list_unique(result);
     
    374377        const char **list_dup = (const char **)str_list_make_empty(tctx);
    375378
    376         count = lp_parm_int(tctx->lp_ctx, NULL, "list_unique", "count", 9);
    377         num_dups = lp_parm_int(tctx->lp_ctx, NULL, "list_unique", "dups", 7);
     379        count = lpcfg_parm_int(tctx->lp_ctx, NULL, "list_unique", "count", 9);
     380        num_dups = lpcfg_parm_int(tctx->lp_ctx, NULL, "list_unique", "dups", 7);
    378381        torture_comment(tctx, "test_list_unique_2() with %d elements and %d dups\n", count, num_dups);
    379382
     
    399402static bool test_list_append(struct torture_context *tctx)
    400403{
    401         char **result;
     404        const char **result;
    402405        const char *list[] = {
    403406                "element_0",
     
    421424                NULL
    422425        };
    423         result = str_list_copy(tctx, list);
     426        result = (const char **) str_list_copy(tctx, list);
    424427        torture_assert(tctx, result, "str_list_copy() must not return NULL");
    425428        result = str_list_append(result, list2);
     
    433436static bool test_list_append_const(struct torture_context *tctx)
    434437{
    435         char **result;
     438        const char **result;
    436439        const char *list[] = {
    437440                "element_0",
     
    455458                NULL
    456459        };
    457         result = str_list_copy(tctx, list);
     460        result = (const char **) str_list_copy(tctx, list);
    458461        torture_assert(tctx, result, "str_list_copy() must not return NULL");
    459462        result = str_list_append_const(result, list2);
     
    467470struct torture_suite *torture_local_util_strlist(TALLOC_CTX *mem_ctx)
    468471{
    469         struct torture_suite *suite = torture_suite_create(mem_ctx, "STRLIST");
     472        struct torture_suite *suite = torture_suite_create(mem_ctx, "strlist");
    470473        int i;
    471474
    472475        for (i = 0; i < ARRAY_SIZE(test_lists_shell_strings); i++) {
    473                 torture_suite_add_simple_tcase_const(suite, "lists_shell",
    474                                 test_lists_shell, &test_lists_shell_strings[i]);
     476                char *name;
     477                name = talloc_asprintf(suite, "lists_shell(%s)",
     478                                                           test_lists_shell_strings[i].list_as_string);
     479                torture_suite_add_simple_tcase_const(suite, name,
     480                        test_lists_shell,  &test_lists_shell_strings[i]);
    475481        }
    476482
    477483        for (i = 0; i < ARRAY_SIZE(test_lists_strings); i++) {
    478                 torture_suite_add_simple_tcase_const(suite, "lists",
    479                                                      test_list_make, &test_lists_strings[i]);
     484                char *name;
     485                name = talloc_asprintf(suite, "list_make(%s)",
     486                                                           test_lists_strings[i].list_as_string);
     487                torture_suite_add_simple_tcase_const(suite, name,
     488                        test_list_make, &test_lists_strings[i]);
    480489        }
    481490
  • vendor/current/lib/util/tests/time.c

    r414 r740  
    7878
    7979        result = timestring(tctx, 42 - (utc_offset < 0 ? utc_offset : 0));
    80         torture_assert(tctx, !strncmp(start, result, strlen(start)),
    81                                    result);
     80        torture_assert(tctx, !strncmp(start, result, strlen(start)), result);
    8281        return true;
    8382}
     
    102101struct torture_suite *torture_local_util_time(TALLOC_CTX *mem_ctx)
    103102{
    104         struct torture_suite *suite = torture_suite_create(mem_ctx, "TIME");
     103        struct torture_suite *suite = torture_suite_create(mem_ctx, "time");
    105104
    106105        torture_suite_add_simple_test(suite, "null_time", test_null_time);
Note: See TracChangeset for help on using the changeset viewer.