summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/ndr_compat.pl
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/tests/ndr_compat.pl')
-rwxr-xr-xsource4/pidl/tests/ndr_compat.pl27
1 files changed, 27 insertions, 0 deletions
diff --git a/source4/pidl/tests/ndr_compat.pl b/source4/pidl/tests/ndr_compat.pl
new file mode 100755
index 0000000000..735d929e27
--- /dev/null
+++ b/source4/pidl/tests/ndr_compat.pl
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+# (C) 2007 Jelmer Vernooij <jelmer@samba.org>
+# Published under the GNU General Public License
+use strict;
+
+use Test::More tests => 3;
+use FindBin qw($RealBin);
+use lib "$RealBin";
+use Util;
+use Parse::Pidl;
+use Parse::Pidl::IDL;
+
+sub parse_idl($)
+{
+ my $idl = shift;
+ my $pidl = Parse::Pidl::IDL::parse_string("interface echo { $idl }; ", "nofile");
+ Parse::Pidl::NDR::Parse($pidl);
+}
+
+test_warnings("", sub {parse_idl("void x();"); });
+test_warnings("nofile:0: top-level [out] pointer `x' is not a [ref] pointer\n", sub {parse_idl("void x([out,unique] int *x);"); });
+
+test_warnings("nofile:0: pointer_default_top() is a pidl extension and should not be used\n", sub {
+ my $pidl = Parse::Pidl::IDL::parse_string("[pointer_default_top(unique)] interface echo { void x(); }; ", "nofile");
+ Parse::Pidl::NDR::Parse($pidl);
+});
+