From 5340489807985b3bb4c10eacfa701d643ee7a36c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 18 Feb 2007 23:57:26 +0000 Subject: r21440: Support different variables in environments. (This used to be commit 1702a663ba4ce6f5803e265a969f2be564fce1e3) --- source4/pidl/tests/samba-ndr.pl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'source4/pidl/tests') diff --git a/source4/pidl/tests/samba-ndr.pl b/source4/pidl/tests/samba-ndr.pl index 50b0bd269f..28b41e4486 100755 --- a/source4/pidl/tests/samba-ndr.pl +++ b/source4/pidl/tests/samba-ndr.pl @@ -4,7 +4,7 @@ use strict; use warnings; -use Test::More tests => 31; +use Test::More tests => 32; use FindBin qw($RealBin); use lib "$RealBin"; use Util; @@ -156,22 +156,29 @@ $fn = { ELEMENTS => [ { DIRECTION => ["out"], NAME => "foo" } ] }; is_deeply({ }, GenerateFunctionInEnv($fn)); $fn = { ELEMENTS => [ { NAME => "foo" }, { NAME => "bar" } ] }; -is_deeply({ foo => "r->foo", bar => "r->bar", this => "r" }, GenerateStructEnv($fn)); +is_deeply({ foo => "r->foo", bar => "r->bar", this => "r" }, + GenerateStructEnv($fn, "r")); + +$fn = { ELEMENTS => [ { NAME => "foo" }, { NAME => "bar" } ] }; +is_deeply({ foo => "some->complex.variable->foo", + bar => "some->complex.variable->bar", + this => "some->complex.variable" }, + GenerateStructEnv($fn, "some->complex.variable")); $fn = { ELEMENTS => [ { NAME => "foo", PROPERTIES => { value => 3 }} ] }; -my $env = GenerateStructEnv($fn); +my $env = GenerateStructEnv($fn, "r"); EnvSubstituteValue($env, $fn); is_deeply($env, { foo => 3, this => "r" }); $fn = { ELEMENTS => [ { NAME => "foo" }, { NAME => "bar" } ] }; -$env = GenerateStructEnv($fn); +$env = GenerateStructEnv($fn, "r"); EnvSubstituteValue($env, $fn); is_deeply($env, { foo => 'r->foo', bar => 'r->bar', this => "r" }); $fn = { ELEMENTS => [ { NAME => "foo", PROPERTIES => { value => 0 }} ] }; -$env = GenerateStructEnv($fn); +$env = GenerateStructEnv($fn, "r"); EnvSubstituteValue($env, $fn); is_deeply($env, { foo => 0, this => "r" }); -- cgit