summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/samba-ndr.pl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-01-10 00:37:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:37:19 -0500
commit348b7bc380e4ce95cf053134e62c3f5ab6520e34 (patch)
tree95c6543948e1dc5dc8555f33775a6f64d7f3f647 /source4/pidl/tests/samba-ndr.pl
parent95f7f4d001684d447ce8e0f880200cfac89f011a (diff)
downloadsamba-348b7bc380e4ce95cf053134e62c3f5ab6520e34.tar.gz
samba-348b7bc380e4ce95cf053134e62c3f5ab6520e34.tar.bz2
samba-348b7bc380e4ce95cf053134e62c3f5ab6520e34.zip
r20638: Check for NULL pointers (where possible) in print functions. Fixes #4218,
but without reintroducing coverity warnings. (This used to be commit a0e2e30d570f246d646f88d7f81ab08208b96131)
Diffstat (limited to 'source4/pidl/tests/samba-ndr.pl')
-rwxr-xr-xsource4/pidl/tests/samba-ndr.pl16
1 files changed, 8 insertions, 8 deletions
diff --git a/source4/pidl/tests/samba-ndr.pl b/source4/pidl/tests/samba-ndr.pl
index 487f203f41..a3e94bd8b5 100755
--- a/source4/pidl/tests/samba-ndr.pl
+++ b/source4/pidl/tests/samba-ndr.pl
@@ -31,12 +31,12 @@ my $fn = check_null_pointer({
},
]
}
-}, { bla => "r->in.bla" }, \&print_fn);
+}, { bla => "r->in.bla" }, \&print_fn, "return;");
test_warnings("", sub { $fn->("r->in.bla"); });
-is($output, "if (r->in.bla == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;");
+is($output, "if (r->in.bla == NULL) return;");
# Test case 2: Simple ref pointer dereference
@@ -55,7 +55,7 @@ $fn = check_null_pointer({
},
]
}
-}, { bla => "r->in.bla" }, \&print_fn);
+}, { bla => "r->in.bla" }, \&print_fn, undef);
test_warnings("", sub { $fn->("r->in.bla"); });
@@ -77,7 +77,7 @@ $fn = check_null_pointer({
},
]
}
-}, { bla => "r->in.bla" }, \&print_fn);
+}, { bla => "r->in.bla" }, \&print_fn, undef);
test_warnings("nofile:1: too much dereferences for `bla'\n",
sub { $fn->("r->in.bla"); });
@@ -104,12 +104,12 @@ $fn = check_null_pointer({
},
]
}
-}, { bla => "r->in.bla" }, \&print_fn);
+}, { bla => "r->in.bla" }, \&print_fn, "return;");
test_warnings("",
sub { $fn->("*r->in.bla"); });
-is($output, "if (*r->in.bla == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;");
+is($output, "if (*r->in.bla == NULL) return;");
# Test case 5: Unknown variable
@@ -127,9 +127,9 @@ $fn = check_null_pointer({
},
]
}
-}, { }, \&print_fn);
+}, { }, \&print_fn, "return;");
test_warnings("nofile:2: unknown dereferenced expression `r->in.bla'\n",
sub { $fn->("r->in.bla"); });
-is($output, "if (r->in.bla == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;");
+is($output, "if (r->in.bla == NULL) return;");