summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/ndr_deprecations.pl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-02-07 19:03:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:44:48 -0500
commitecf2c1effb778a95fd863a5e87ec7e378d228b57 (patch)
tree8b94782e07399490d6390e066c557af8c04aefc1 /source4/pidl/tests/ndr_deprecations.pl
parent2811e18da0d8dae2e2560c11a28450ae8b2a98d5 (diff)
downloadsamba-ecf2c1effb778a95fd863a5e87ec7e378d228b57.tar.gz
samba-ecf2c1effb778a95fd863a5e87ec7e378d228b57.tar.bz2
samba-ecf2c1effb778a95fd863a5e87ec7e378d228b57.zip
r21222: Merge a couple of pidl fixes:
* Pidl will now warn when trying to use pointers as integers in expressions. * "subcontext()" is now marked as deprecated. The alternatives, transmit_as() / represent_as() should be available soon. * More tests. * Remove some unused code in smbtorture. (This used to be commit 37c0da541e3962164d5af3e3c9560803a733f3b7)
Diffstat (limited to 'source4/pidl/tests/ndr_deprecations.pl')
-rwxr-xr-xsource4/pidl/tests/ndr_deprecations.pl28
1 files changed, 28 insertions, 0 deletions
diff --git a/source4/pidl/tests/ndr_deprecations.pl b/source4/pidl/tests/ndr_deprecations.pl
new file mode 100755
index 0000000000..89738e42f6
--- /dev/null
+++ b/source4/pidl/tests/ndr_deprecations.pl
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+# (C) 2007 Jelmer Vernooij <jelmer@samba.org>
+# Published under the GNU General Public License
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+use FindBin qw($RealBin);
+use lib "$RealBin";
+use Util;
+use Parse::Pidl::Util qw(MyDumper);
+use Parse::Pidl::NDR qw(ValidElement);
+
+# Case 1
+
+my $e = {
+ 'FILE' => 'foo.idl',
+ 'NAME' => 'v',
+ 'PROPERTIES' => {"subcontext" => 1},
+ 'POINTERS' => 0,
+ 'TYPE' => 'uint8',
+ 'PARENT' => { TYPE => 'STRUCT' },
+ 'LINE' => 42 };
+
+test_warnings("foo.idl:42: subcontext() is deprecated. Use represent_as() or transmit_as() instead\n",
+ sub { ValidElement($e); });
+
+