svn commit: samba r20556 - in branches/SAMBA_4_0/source/pidl/tests: .

jelmer at samba.org jelmer at samba.org
Fri Jan 5 17:18:23 GMT 2007


Author: jelmer
Date: 2007-01-05 17:18:22 +0000 (Fri, 05 Jan 2007)
New Revision: 20556

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20556

Log:
Add more tests to make sure nothing breaks when I replace the ParseExpr code.

Modified:
   branches/SAMBA_4_0/source/pidl/tests/util.pl


Changeset:
Modified: branches/SAMBA_4_0/source/pidl/tests/util.pl
===================================================================
--- branches/SAMBA_4_0/source/pidl/tests/util.pl	2007-01-05 16:26:16 UTC (rev 20555)
+++ branches/SAMBA_4_0/source/pidl/tests/util.pl	2007-01-05 17:18:22 UTC (rev 20556)
@@ -3,7 +3,7 @@
 # Published under the GNU General Public License
 use strict;
 
-use Test::More tests => 29;
+use Test::More tests => 41;
 use FindBin qw($RealBin);
 use lib "$RealBin/../lib";
 use Parse::Pidl::Util;
@@ -57,3 +57,21 @@
 is("2/2*(r->length)", 
 	ParseExpr("constant/constant*(len)", {"constant" => "2", 
 			                              "len" => "r->length"}));
+is("2+2-r->length", 
+	ParseExpr("constant+constant-len", {"constant" => "2", 
+			                              "len" => "r->length"}));
+is("*r->length", ParseExpr("*len", { "len" => "r->length"}));
+is("**r->length", ParseExpr("**len", { "len" => "r->length"}));
+is("r->length&2", ParseExpr("len&2", { "len" => "r->length"}));
+is("&r->length", ParseExpr("&len", { "len" => "r->length"}));
+is("strlen(\"data\")", ParseExpr("strlen(foo)", { "foo" => "\"data\""}));
+is("strlen(\"data\", 4)", ParseExpr("strlen(foo, 4)", { "foo" => "\"data\""}));
+is("foo / bar", ParseExpr("foo / bar", { "bla" => "\"data\""}));
+is("r->length%2", ParseExpr("len%2", { "len" => "r->length"}));
+is("r->length==2", ParseExpr("len==2", { "len" => "r->length"}));
+is("r->length!=2", ParseExpr("len!=2", { "len" => "r->length"}));
+is("pr->length", ParseExpr("pr->length", { "p" => "r"}));
+TODO: {
+	todo_skip 1, "Broken at the moment";
+	is("r->length", ParseExpr("p->length", { "p" => "r"}));
+}



More information about the samba-cvs mailing list