pspp-cvs
[Top][All Lists]
Advanced

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

[Pspp-cvs] pspp src/language/data-io/ChangeLog src/languag...


From: Ben Pfaff
Subject: [Pspp-cvs] pspp src/language/data-io/ChangeLog src/languag...
Date: Thu, 26 Jul 2007 01:52:04 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Changes by:     Ben Pfaff <blp> 07/07/26 01:52:04

Modified files:
        src/language/data-io: ChangeLog data-list.c 
        tests          : ChangeLog 
        tests/command  : data-list.sh 

Log message:
        Fix bug #17100.
        
        * command/data-list.sh: Add tests for multi-record DATA LIST with
        and without empty trailing record.
        
        * data-list.c (read_from_data_list_fixed): Handle multi-record
        DATA LIST correctly.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/data-io/ChangeLog?cvsroot=pspp&r1=1.41&r2=1.42
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/data-io/data-list.c?cvsroot=pspp&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/pspp/tests/ChangeLog?cvsroot=pspp&r1=1.98&r2=1.99
http://cvs.savannah.gnu.org/viewcvs/pspp/tests/command/data-list.sh?cvsroot=pspp&r1=1.11&r2=1.12

Patches:
Index: src/language/data-io/ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/ChangeLog,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- src/language/data-io/ChangeLog      12 Jul 2007 04:34:33 -0000      1.41
+++ src/language/data-io/ChangeLog      26 Jul 2007 01:52:04 -0000      1.42
@@ -1,3 +1,9 @@
+2007-07-25  Ben Pfaff  <address@hidden>
+
+       Fix bug #17100.
+       * data-list.c (read_from_data_list_fixed): Handle multi-record
+       DATA LIST correctly.
+
 2007-07-11  Ben Pfaff  <address@hidden>
 
        * get.c (map_case): Create destination case instead of leaving it

Index: src/language/data-io/data-list.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/data-list.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- src/language/data-io/data-list.c    7 Jul 2007 06:14:12 -0000       1.33
+++ src/language/data-io/data-list.c    26 Jul 2007 01:52:04 -0000      1.34
@@ -683,9 +683,15 @@
       line = dfm_get_record (dls->reader);
 
       ll_for_each_continue (spec, struct dls_var_spec, ll, &dls->specs)
+        {
+          if (row < spec->record)
+            break;
+
         data_in (ss_substr (line, spec->first_column - 1, spec->input.w),
                  spec->input.type, spec->input.d, spec->first_column,
-                 case_data_rw_idx (c, spec->fv), fmt_var_width (&spec->input));
+                   case_data_rw_idx (c, spec->fv),
+                   fmt_var_width (&spec->input));
+        }
 
       dfm_forward_record (dls->reader);
     }

Index: tests/ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/tests/ChangeLog,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -b -r1.98 -r1.99
--- tests/ChangeLog     25 Jul 2007 04:07:50 -0000      1.98
+++ tests/ChangeLog     26 Jul 2007 01:52:04 -0000      1.99
@@ -1,7 +1,13 @@
+2007-07-25  Ben Pfaff  <address@hidden>
+
+       Fix bug #17100.
+       * command/data-list.sh: Add tests for multi-record DATA LIST with
+       and without empty trailing record.
+
 2007-07-24  Ben Pfaff  <address@hidden>
 
-       * tests/command/flip.sh: Add tests to avoid regression on bugs
-       #20493, #20494.
+       * command/flip.sh: Add tests to avoid regression on bugs #20493,
+       #20494.
 
 2007-07-22  Ben Pfaff  <address@hidden>
 

Index: tests/command/data-list.sh
===================================================================
RCS file: /cvsroot/pspp/pspp/tests/command/data-list.sh,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- tests/command/data-list.sh  11 Nov 2006 19:30:59 -0000      1.11
+++ tests/command/data-list.sh  26 Jul 2007 01:52:04 -0000      1.12
@@ -104,6 +104,40 @@
                        
 end data.
 list.
+
+* Test DATA LIST FIXED with multiple records.
+data list fixed notable
+       /1 start 1-20 (adate)
+       /2 end 1-20 (adate)
+       /3 count 1-3.
+begin data.
+07-22-2007
+10-06-2007
+321
+07-14-1789
+08-26-1789
+4
+01-01-1972
+12-31-1999
+682
+end data.
+list.
+
+* Test that DATA LIST FIXED works with an empty trailing record.
+data list fixed notable records=2/x 1 y 2.
+begin data.
+12
+
+34
+
+56
+
+78
+
+90
+
+end data.
+list.
 EOF
 if [ $? -ne 0 ] ; then no_result ; fi
 
@@ -155,6 +189,18 @@
      .        .       3.00      .   
      .        .        .       4.00 
      .        .        .        .   
+               start                  end count
+-------------------- -------------------- -----
+          07/22/2007           10/06/2007   321
+          07/14/1789           08/26/1789     4
+          01/01/1972           12/31/1999   682
+x y
+- -
+1 2
+3 4
+5 6
+7 8
+9 0
 EOF
 if [ $? -ne 0 ] ; then fail ; fi
 




reply via email to

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