From efc03df292aa84edb592c22191dbf86cdf8c32d0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 21 Aug 2005 23:17:35 +0000 Subject: r9459: Move pidl up one level (to prevent too much nesting) (This used to be commit e48202275e60c18e464457d200daeb953386e221) --- source4/pidl/tests/ndr_array.pl | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 source4/pidl/tests/ndr_array.pl (limited to 'source4/pidl/tests/ndr_array.pl') diff --git a/source4/pidl/tests/ndr_array.pl b/source4/pidl/tests/ndr_array.pl new file mode 100755 index 0000000000..d486308339 --- /dev/null +++ b/source4/pidl/tests/ndr_array.pl @@ -0,0 +1,45 @@ +#!/usr/bin/perl +# Array testing +# (C) 2005 Jelmer Vernooij +# Published under the GNU General Public License +use strict; + +use Parse::Pidl::Test; + +my %settings = Parse::Pidl::Test::GetSettings(@ARGV); +$settings{'IDL-Arguments'} = ['--quiet', '--parse', '--parser=ndr_test.c', '--header=ndr_test.h']; +$settings{'IncludeFiles'} = ['ndr_test.h']; +$settings{'ExtraFiles'} = ['ndr_test.c']; + +Parse::Pidl::Test::test_idl( + # Name + 'Fixed-Array', + + # Settings + \%settings, + + # IDL + '[public] void Test([in] uint8 x[10]);', + + # C Test + ' + uint8_t data[] = {1,2,3,4,5,6,7,8,9,10}; + int i; + DATA_BLOB b; + struct ndr_pull *ndr; + struct Test r; + + b.data = data; + b.length = 10; + ndr = ndr_pull_init_blob(&b, mem_ctx); + + if (NT_STATUS_IS_ERR(ndr_pull_Test(ndr, NDR_IN, &r))) + return 1; + + if (ndr->offset != 10) + return 2; + + for (i = 0; i < 10; i++) { + if (r.in.x[i] != i+1) return 3; + } +'); -- cgit From 68ef82aac72c351f6e166b92bbb4573e8bcdbc86 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 24 Dec 2005 23:32:50 +0000 Subject: r12464: Add simple IDL parsing tests for pidl using the standard perl testing framework (Test::Simple, distributed with perl itself). Run these tests from 'make test' (This used to be commit 975d8816db6697dab828941b69a740e3a0a2c272) --- source4/pidl/tests/ndr_array.pl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'source4/pidl/tests/ndr_array.pl') diff --git a/source4/pidl/tests/ndr_array.pl b/source4/pidl/tests/ndr_array.pl index d486308339..ad313949c5 100755 --- a/source4/pidl/tests/ndr_array.pl +++ b/source4/pidl/tests/ndr_array.pl @@ -4,12 +4,7 @@ # Published under the GNU General Public License use strict; -use Parse::Pidl::Test; - -my %settings = Parse::Pidl::Test::GetSettings(@ARGV); -$settings{'IDL-Arguments'} = ['--quiet', '--parse', '--parser=ndr_test.c', '--header=ndr_test.h']; -$settings{'IncludeFiles'} = ['ndr_test.h']; -$settings{'ExtraFiles'} = ['ndr_test.c']; +use Test::Simple tests => 1; Parse::Pidl::Test::test_idl( # Name -- cgit From 7717f180ca2f908e1b3258355520719991215050 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 25 Dec 2005 03:04:13 +0000 Subject: r12470: Add helper module for pidl tests Convert other pidl tests to use Test::More and run them from 'make test' (This used to be commit 3a57d29a62112ab654e290ccc985fba7f67664c5) --- source4/pidl/tests/ndr_array.pl | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'source4/pidl/tests/ndr_array.pl') diff --git a/source4/pidl/tests/ndr_array.pl b/source4/pidl/tests/ndr_array.pl index ad313949c5..b28070536e 100755 --- a/source4/pidl/tests/ndr_array.pl +++ b/source4/pidl/tests/ndr_array.pl @@ -4,19 +4,17 @@ # Published under the GNU General Public License use strict; -use Test::Simple tests => 1; +use Test::More tests => 8; +use FindBin qw($RealBin); +use lib "$RealBin/../lib"; +use lib "$RealBin"; +use Util qw(test_samba4_ndr); -Parse::Pidl::Test::test_idl( - # Name +test_samba4_ndr( 'Fixed-Array', - # Settings - \%settings, - - # IDL '[public] void Test([in] uint8 x[10]);', - # C Test ' uint8_t data[] = {1,2,3,4,5,6,7,8,9,10}; int i; -- cgit From f7ca27b9ca318657b38688bf063a63d96b1e8c3a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 5 Jan 2007 15:03:21 +0000 Subject: r20548: Remove unnecessary "use lib", fix warnings. (This used to be commit 30d721569fdf33e4784eb1f7c650e75ed1b80527) --- source4/pidl/tests/ndr_array.pl | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/pidl/tests/ndr_array.pl') diff --git a/source4/pidl/tests/ndr_array.pl b/source4/pidl/tests/ndr_array.pl index b28070536e..27f42cd391 100755 --- a/source4/pidl/tests/ndr_array.pl +++ b/source4/pidl/tests/ndr_array.pl @@ -6,7 +6,6 @@ use strict; use Test::More tests => 8; use FindBin qw($RealBin); -use lib "$RealBin/../lib"; use lib "$RealBin"; use Util qw(test_samba4_ndr); -- cgit From 1f87eb38fdb76d73ea1dd045d8555a662bf0c77b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 31 Oct 2007 16:44:42 +0100 Subject: r25768: pidl: NT_STATUS_IS_ERR() is NOT the same as !NT_STATUS_IS_OK() Everything but success should be handled as error in the tests. metze (This used to be commit cadb1cc743a19fc16e61f8246b1e8771c806caea) --- source4/pidl/tests/ndr_array.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/pidl/tests/ndr_array.pl') diff --git a/source4/pidl/tests/ndr_array.pl b/source4/pidl/tests/ndr_array.pl index 27f42cd391..8e40d36a10 100755 --- a/source4/pidl/tests/ndr_array.pl +++ b/source4/pidl/tests/ndr_array.pl @@ -25,7 +25,7 @@ test_samba4_ndr( b.length = 10; ndr = ndr_pull_init_blob(&b, mem_ctx); - if (NT_STATUS_IS_ERR(ndr_pull_Test(ndr, NDR_IN, &r))) + if (!NT_STATUS_IS_OK(ndr_pull_Test(ndr, NDR_IN, &r))) return 1; if (ndr->offset != 10) -- cgit From 3e1fb13024eec442bfdd0335bc03689f64d50c0e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 9 Nov 2007 19:23:25 +0100 Subject: r25915: ndr/pidl: change NTSTAUS into enum ndr_err_code (pidl code) Samba4/NDR/Parser.pm Samba4/NDR/Server.pm Samba3/ServerNDR.pm tests/ metze (This used to be commit 7106f21de8dfc472aa0846b49bfdb7543c63b310) --- source4/pidl/tests/ndr_array.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/pidl/tests/ndr_array.pl') diff --git a/source4/pidl/tests/ndr_array.pl b/source4/pidl/tests/ndr_array.pl index 8e40d36a10..174d702c07 100755 --- a/source4/pidl/tests/ndr_array.pl +++ b/source4/pidl/tests/ndr_array.pl @@ -25,7 +25,7 @@ test_samba4_ndr( b.length = 10; ndr = ndr_pull_init_blob(&b, mem_ctx); - if (!NT_STATUS_IS_OK(ndr_pull_Test(ndr, NDR_IN, &r))) + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_Test(ndr, NDR_IN, &r))) return 1; if (ndr->offset != 10) -- cgit From 584044d5e7148c5135518500ba81caece092c04a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 14 Dec 2007 00:27:38 +0100 Subject: r26444: Fix pidl tests. (This used to be commit bc643f1014cef7f0bc66ad0edfa22395c69b8352) --- source4/pidl/tests/ndr_array.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/pidl/tests/ndr_array.pl') diff --git a/source4/pidl/tests/ndr_array.pl b/source4/pidl/tests/ndr_array.pl index 174d702c07..2a6b5bbd57 100755 --- a/source4/pidl/tests/ndr_array.pl +++ b/source4/pidl/tests/ndr_array.pl @@ -23,7 +23,7 @@ test_samba4_ndr( b.data = data; b.length = 10; - ndr = ndr_pull_init_blob(&b, mem_ctx); + ndr = ndr_pull_init_blob(&b, mem_ctx, NULL); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_Test(ndr, NDR_IN, &r))) return 1; -- cgit