pidl:Samba4/NDR/Client: fix arguments to warning()
[samba.git] / pidl / tests / ndr_string.pl
index faecbbf4c5f4ce8b10ec89518046e737163310df..8e8b8ecbad6c46f4ff428549b67381f60f1dd307 100755 (executable)
@@ -14,8 +14,7 @@ test_samba4_ndr("string-pull-empty",
 '
        uint8_t data[] = { 0x00, 0x00, 0x00, 0x00 };
        DATA_BLOB b = { data, 4 };
-       struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL, 
-               smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
+       struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
        struct TestString r;
        r.in.data = NULL;
 
@@ -37,8 +36,7 @@ test_samba4_ndr("string-ascii-pull",
        uint8_t data[] = { 0x03, 0x00, 0x00, 0x00, 
                                           \'f\', \'o\', \'o\', 0 };
        DATA_BLOB b = { data, 8 };
-       struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
-               smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
+       struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
        struct TestString r;
        r.in.data = NULL;
 
@@ -70,12 +68,11 @@ test_samba4_ndr("string-wchar-fixed-array-01",
                           0x00,  0x00, 0x00,  0x00,
                           0x04,  0x00, 0x00,  0x00,
                           \'f\', 0x00, \'o\', 0x00,
-                          \'o\', 0x00, 0x00,  0x00
+                          \'o\', 0x00, 0x00,  0x00,
                           0x02,  0x00, 0x00,  0x00
        };
        DATA_BLOB b = { data, sizeof(data) };
-       struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
-               smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
+       struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
        struct TestString r;
        struct TestStringStruct str;
        r.in.str = &str;
@@ -86,16 +83,16 @@ test_samba4_ndr("string-wchar-fixed-array-01",
        if (r.in.str == NULL)
                return 2;
 
-       if (r.in.str.l1 == 0x00000001)
+       if (r.in.str->l1 != 0x00000001)
                return 3;
 
        if (strncmp(str.str, "foo", 3) != 0)
                return 4;
 
-       if (r.in.str.str[4] != 0)
+       if (r.in.str->str[4] != 0)
                return 5;
 
-       if (r.in.str.l3 == 0x00000002)
+       if (r.in.str->l2 != 0x00000002)
                return 6;
 ');
 
@@ -114,14 +111,13 @@ test_samba4_ndr("string-wchar-fixed-array-02",
                           0x00,  0x00, 0x00,  0x00,
                           0x06,  0x00, 0x00,  0x00,
                           \'f\', 0x00, \'o\', 0x00,
-                          \'o\', 0x00, \'b\', 0x00
+                          \'o\', 0x00, \'b\', 0x00,
                           \'a\', 0x00, \'r\', 0x00,
-                          0x00,  0x00, 0x00,  0x00
+                          0x00,  0x00, 0x00,  0x00,
                           0x02,  0x00, 0x00,  0x00
        };
        DATA_BLOB b = { data, sizeof(data) };
-       struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
-               smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
+       struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
        struct TestString r;
        struct TestStringStruct str;
        r.in.str = &str;
@@ -146,14 +142,13 @@ test_samba4_ndr("string-wchar-fixed-array-03",
                           0x00,  0x00, 0x00,  0x00,
                           0x07,  0x00, 0x00,  0x00,
                           \'f\', 0x00, \'o\', 0x00,
-                          \'o\', 0x00, \'b\', 0x00
+                          \'o\', 0x00, \'b\', 0x00,
                           \'a\', 0x00, \'r\', 0x00,
-                          0x00,  0x00, 0x00,  0x00
+                          0x00,  0x00, 0x00,  0x00,
                           0x02,  0x00, 0x00,  0x00
        };
        DATA_BLOB b = { data, sizeof(data) };
-       struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
-               smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
+       struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
        struct TestString r;
        struct TestStringStruct str;
        r.in.str = &str;
@@ -174,8 +169,7 @@ test_samba4_ndr("string-out",
        uint8_t data[] = { 0x03, 0x00, 0x00, 0x00, 
                                           \'f\', \'o\', \'o\', 0 };
        DATA_BLOB b = { data, 8 };
-       struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
-               smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
+       struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
        struct TestString r;
        char *str = NULL;
        r.out.data = &str;