]> andersk Git - splint.git/commitdiff
Added test case for division by zero.
authorevans1629 <evans1629>
Tue, 5 Feb 2002 23:13:13 +0000 (23:13 +0000)
committerevans1629 <evans1629>
Tue, 5 Feb 2002 23:13:13 +0000 (23:13 +0000)
test/Makefile.am
test/Makefile.in
test/divzero.c [new file with mode: 0644]
test/divzero.expect [new file with mode: 0644]

index a68940569c5c004314a626b4e572be3dac308173..f3d1e7a734cc9063ba2e517f87f7fb5420b01f39 100644 (file)
@@ -39,7 +39,7 @@ UNITTESTS = \
   abstptr abstract alias alttypes ansireserved argorder \
   args arraydims blocks break cases cast charlit clauses commentchar compdestroy \
   constannot controldepth csyntax czechnames czechoslovaknames deadparam \
-  decl enum exports external fields flags forbody format freearray \
+  decl divzero enum exports external fields flags forbody format freearray \
   funcpointer functionmacro glob globals impabstract info init inparam internal iter keep libs \
   linked lintcomments list loopexec \
   macros macrosef merge mergenull modifies modtest moduncon \
@@ -337,6 +337,10 @@ decl:
        -$(SPLINTRN) decl.c +strict -exportlocal -expect 5
        -$(SPLINTR) decl2 -expect 4
 
+.PHONY: divzero
+divzero:
+       -$(SPLINTR) divzero.c -varuse -expect 0
+
 .PHONY: enum
 enum:
        -$(SPLINTR) enum -expect 16
index ea002057797624a179bcf92e7d084435ce0129fc..88318b9323d482c09375f2d70b62d98d7ece7c0e 100644 (file)
@@ -116,7 +116,7 @@ UNITTESTS = \
   abstptr abstract alias alttypes ansireserved argorder \
   args arraydims blocks break cases cast charlit clauses commentchar compdestroy \
   constannot controldepth csyntax czechnames czechoslovaknames deadparam \
-  decl enum exports external fields flags forbody format freearray \
+  decl divzero enum exports external fields flags forbody format freearray \
   funcpointer functionmacro glob globals impabstract info init inparam internal iter keep libs \
   linked lintcomments list loopexec \
   macros macrosef merge mergenull modifies modtest moduncon \
@@ -1152,6 +1152,10 @@ decl:
        -$(SPLINTRN) decl.c +strict -exportlocal -expect 5
        -$(SPLINTR) decl2 -expect 4
 
+.PHONY: divzero
+divzero:
+       -$(SPLINTR) divzero.c -varuse -expect 0
+
 .PHONY: enum
 enum:
        -$(SPLINTR) enum -expect 16
diff --git a/test/divzero.c b/test/divzero.c
new file mode 100644 (file)
index 0000000..3a0ce5d
--- /dev/null
@@ -0,0 +1,6 @@
+void f (void)
+{
+  int x = 3 / 0;
+  double d = 3.0 / 0.0;
+  
+}
diff --git a/test/divzero.expect b/test/divzero.expect
new file mode 100644 (file)
index 0000000..2b06c77
--- /dev/null
@@ -0,0 +1,2 @@
+
+Finished checking --- no warnings
This page took 0.049871 seconds and 5 git commands to generate.