diff options
author | bubulle <bubulle@alioth.debian.org> | 2010-04-06 18:12:47 +0000 |
---|---|---|
committer | bubulle <bubulle@alioth.debian.org> | 2010-04-06 18:12:47 +0000 |
commit | c038a4e9c09ba4ac77d885ac0afee418f41b8891 (patch) | |
tree | f5b2444727ff995f46dabbbf94863e9926501444 /pidl/tests/ndr_string.pl | |
parent | 9e2f5a6ab663f7a111832217c527508c75ddae8a (diff) | |
download | samba-c038a4e9c09ba4ac77d885ac0afee418f41b8891.tar.gz |
Revert to 3.4.7...for now?
git-svn-id: svn://svn.debian.org/svn/pkg-samba/trunk/samba@3416 fc4039ab-9d04-0410-8cac-899223bdd6b0
Diffstat (limited to 'pidl/tests/ndr_string.pl')
-rwxr-xr-x | pidl/tests/ndr_string.pl | 110 |
1 files changed, 1 insertions, 109 deletions
diff --git a/pidl/tests/ndr_string.pl b/pidl/tests/ndr_string.pl index 7b76c7b295..2f2d941665 100755 --- a/pidl/tests/ndr_string.pl +++ b/pidl/tests/ndr_string.pl @@ -4,7 +4,7 @@ # Published under the GNU General Public License use strict; -use Test::More tests => 6 * 8; +use Test::More tests => 3 * 8; use FindBin qw($RealBin); use lib "$RealBin"; use Util qw(test_samba4_ndr); @@ -55,114 +55,6 @@ test_samba4_ndr("string-ascii-pull", return 4; '); -test_samba4_ndr("string-wchar-fixed-array-01", -' - typedef struct { - uint32 l1; - [string,charset(UTF16)] uint16 str[6]; - uint32 l2; - } TestStringStruct; - - [public] void TestString([in,ref] TestStringStruct *str); -', -' - uint8_t data[] = { 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, - \'f\', 0x00, \'o\', 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 TestString r; - struct TestStringStruct str; - r.in.str = &str; - - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestString(ndr, NDR_IN, &r))) - return 1; - - if (r.in.str == NULL) - return 2; - - if (r.in.str->l1 != 0x00000001) - return 3; - - if (strncmp(str.str, "foo", 3) != 0) - return 4; - - if (r.in.str->str[4] != 0) - return 5; - - if (r.in.str->l2 != 0x00000002) - return 6; -'); - -test_samba4_ndr("string-wchar-fixed-array-02", -' - typedef struct { - uint32 l1; - [string,charset(UTF16)] uint16 str[6]; - uint32 l2; - } TestStringStruct; - - [public] void TestString([in,ref] TestStringStruct *str); -', -' - uint8_t data[] = { 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, - \'f\', 0x00, \'o\', 0x00, - \'o\', 0x00, \'b\', 0x00, - \'a\', 0x00, \'r\', 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 TestString r; - struct TestStringStruct str; - r.in.str = &str; - - /* the string terminator is wrong */ - if (NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestString(ndr, NDR_IN, &r))) - return 1; -'); - -test_samba4_ndr("string-wchar-fixed-array-03", -' - typedef struct { - uint32 l1; - [string,charset(UTF16)] uint16 str[6]; - uint32 l2; - } TestStringStruct; - - [public] void TestString([in,ref] TestStringStruct *str); -', -' - uint8_t data[] = { 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, - \'f\', 0x00, \'o\', 0x00, - \'o\', 0x00, \'b\', 0x00, - \'a\', 0x00, \'r\', 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 TestString r; - struct TestStringStruct str; - r.in.str = &str; - - /* the length 0x07 is to large */ - if (NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestString(ndr, NDR_IN, &r))) - return 1; -'); - SKIP: { skip "doesn't seem to work yet", 8; |