[klee-commits] [1523] Test case for --one-line-options, which should finish under 10s only

cristic at stanford.edu cristic at stanford.edu
Mon Mar 30 23:10:27 PDT 2009


Revision: 1523
          http://keeda.stanford.edu/viewvc/viewvc.cgi?view=rev&revision=1523
Author:   cristic
Date:     2009-03-30 23:10:27 -0700 (Mon, 30 Mar 2009)
Log Message:
-----------
Test case for --one-line-options, which should finish under 10s only
when the option is used.

Added Paths:
-----------
    test/SimpleModel/OneLineStreams.c

Added: test/SimpleModel/OneLineStreams.c
===================================================================
--- test/SimpleModel/OneLineStreams.c	                        (rev 0)
+++ test/SimpleModel/OneLineStreams.c	2009-03-31 06:10:27 UTC (rev 1523)
@@ -0,0 +1,31 @@
+// RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t1.bc
+// RUN: %klee --use-forked-stp --use-cex-cache --with-libc --with-file-model=release --allow-external-sym-calls --max-time=10  %t1.bc  --sym-files 0 10 --one-line-streams
+// RUN: test -f klee-last/test000019.bout
+// RUN: test ! -f klee-last/test000020.bout
+
+/* This tests the one-line-streams option.  This takes about 2 sec on
+   my machine (but a long time w/o) and generates 19 tests. */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+int main(int argc, char** argv)
+{
+  char line[2048];
+  char buf[256], name[64] = {'\0', }, type[64] = {'\0', }, date[64] = {'\0', };
+
+  memset(line, 0, sizeof line);
+  while (fgets(line, sizeof(line) - 1, stdin)) {
+    if (strncmp(line, "Name: ", 6) == 0)
+      strncpy(name, line + 6, sizeof(name) - 1);
+    if (strncmp(line, "Type: ", 6) == 0)
+      strncpy(type, line + 6, sizeof(type) - 1);
+  }
+  
+  if (strlen(name)) snprintf(buf, sizeof buf, "Name: %s\n", name);
+  if (strlen(type)) snprintf(buf, sizeof buf, "Type: %s\n", type);
+
+  return 0;
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://keeda.Stanford.EDU/pipermail/klee-commits/attachments/20090330/f953fe14/attachment.html 


More information about the klee-commits mailing list