pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src/language/tests check-model.h check-mod... [simpler-p


From: Ben Pfaff
Subject: [Pspp-cvs] pspp/src/language/tests check-model.h check-mod... [simpler-proc]
Date: Wed, 18 Apr 2007 05:20:47 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Branch:         simpler-proc
Changes by:     Ben Pfaff <blp> 07/04/18 05:20:47

Modified files:
        src/language/tests: check-model.h check-model.q datasheet-test.c 

Log message:
        Document model checker interface.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/tests/check-model.h?cvsroot=pspp&only_with_tag=simpler-proc&r1=1.1.2.1&r2=1.1.2.2
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/tests/check-model.q?cvsroot=pspp&only_with_tag=simpler-proc&r1=1.1.2.3&r2=1.1.2.4
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/tests/datasheet-test.c?cvsroot=pspp&only_with_tag=simpler-proc&r1=1.1.2.2&r2=1.1.2.3

Patches:
Index: check-model.h
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/tests/Attic/check-model.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -b -r1.1.2.1 -r1.1.2.2
--- check-model.h       14 Apr 2007 05:04:23 -0000      1.1.2.1
+++ check-model.h       18 Apr 2007 05:20:47 -0000      1.1.2.2
@@ -16,6 +16,13 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA. */
 
+/* PSPP syntax interface to model checker.
+
+   A model checker is a software testing tool.  PSPP includes a
+   generic model checker in libpspp/model-checker.[ch].  This
+   module layers a PSPP syntax interface on top of the model
+   checker's options. */
+
 #ifndef LANGUAGE_TESTS_CHECK_MODEL
 #define LANGUAGE_TESTS_CHECK_MODEL 1
 

Index: check-model.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/tests/Attic/check-model.q,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -b -r1.1.2.3 -r1.1.2.4
--- check-model.q       15 Apr 2007 05:15:17 -0000      1.1.2.3
+++ check-model.q       18 Apr 2007 05:20:47 -0000      1.1.2.4
@@ -57,6 +57,13 @@
 static struct mc_options *parse_options (struct lexer *);
 static void print_results (const struct mc_results *, FILE *);
 
+/* Parses a syntax description of model checker options from
+   LEXER and passes them, along with AUX, to the CHECKER
+   function, which must wrap a call to mc_run and return the
+   mc_results that it returned.  This function then prints a
+   description of the mc_results to the output file.  Returns
+   true if the model checker run found no errors, false
+   otherwise. */
 bool
 check_model (struct lexer *lexer, 
              struct mc_results *(*checker) (struct mc_options *, void *aux),
@@ -92,6 +99,7 @@
   return ok;
 }
 
+/* Fancy progress function for mc_options_set_progress_func. */
 static bool
 fancy_progress (struct mc *mc) 
 {
@@ -107,6 +115,8 @@
   return true;
 }
 
+/* Parses options from LEXER and returns a corresponding
+   mc_options, or a null pointer if parsing fails. */
 static struct mc_options *
 parse_options (struct lexer *lexer) 
 {
@@ -208,6 +218,7 @@
   return options;
 }
 
+/* Prints a description of RESULTS to stream F. */
 static void
 print_results (const struct mc_results *results, FILE *f) 
 {
@@ -252,3 +263,9 @@
 
   putc ('\n', f);
 }
+
+/*
+  Local Variables:
+  mode: c
+  End:
+*/

Index: datasheet-test.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/tests/Attic/datasheet-test.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -b -r1.1.2.2 -r1.1.2.3
--- datasheet-test.c    14 Apr 2007 23:03:23 -0000      1.1.2.2
+++ datasheet-test.c    18 Apr 2007 05:20:47 -0000      1.1.2.3
@@ -29,31 +29,19 @@
 #include "error.h"
 #include "xalloc.h"
 
-static bool
-parse_coordinates (struct lexer *lexer, int *rows, int *cols) 
-{
-  lex_match (lexer, '=');
-  lex_match (lexer, '(');
-
-  if (!lex_force_int (lexer))
-    return false;
-  *rows = lex_integer (lexer);
-  lex_get (lexer);
-
-  lex_match (lexer, ',');
-
-  if (!lex_force_int (lexer))
-    return false;
-  *cols = lex_integer (lexer);
-  lex_get (lexer);
-  
-  lex_match (lexer, ')');
-  return true;
-}
+static bool parse_coordinates (struct lexer *, int *rows, int *cols);
 
+/* Parses and executes the DEBUG DATASHEET command, which runs
+   the model checker on the datasheet data structure.  The
+   command may include a specification of the form
+   MAX=(ROWS,COLS) to specify the maximum size of the data sheet
+   during the model checker run (default: 4x4) or
+   BACKING=(ROWS,COLS) to specify the size of the casereader
+   backing the datasheet (default: no backing).  These may be
+   optionally followed by any of the common model checker option
+   specifications (see check-model.q). */
 int
-cmd_debug_datasheet (struct lexer *lexer,
-                     struct dataset *dataset UNUSED) 
+cmd_debug_datasheet (struct lexer *lexer, struct dataset *dataset UNUSED) 
 {
   struct datasheet_test_params params;
   bool ok;
@@ -88,3 +76,29 @@
           ok ? "successful" : "failed");
   return ok ? lex_end_of_command (lexer) : CMD_FAILURE;
 }
+
+/* Parses a pair of coordinates with the syntax =(ROWS,COLS),
+   where all of the delimiters are optional, into *ROWS and
+   *COLS.  Returns true if successful, false on parse failure. */
+static bool
+parse_coordinates (struct lexer *lexer, int *rows, int *cols) 
+{
+  lex_match (lexer, '=');
+  lex_match (lexer, '(');
+
+  if (!lex_force_int (lexer))
+    return false;
+  *rows = lex_integer (lexer);
+  lex_get (lexer);
+
+  lex_match (lexer, ',');
+
+  if (!lex_force_int (lexer))
+    return false;
+  *cols = lex_integer (lexer);
+  lex_get (lexer);
+  
+  lex_match (lexer, ')');
+  return true;
+}
+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]