Assorted improvements to diagnostics.
[pspp] / tests / language / data-io / dataset.at
index 7d5e928e359da06c6caa9dfa3e64348bab43a3f8..c484f16b8114fb98a7a6c6be42bbf16b88c6f4c9 100644 (file)
@@ -1,3 +1,19 @@
+dnl PSPP - a program for statistical analysis.
+dnl Copyright (C) 2017 Free Software Foundation, Inc.
+dnl
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation, either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
+dnl
 AT_BANNER([DATASET commands])
 
 AT_SETUP([DATASET COPY])
@@ -50,13 +66,11 @@ y
 7
 8
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 clone
 initial (active dataset)
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 clone (active dataset)
 initial
 
@@ -68,8 +82,7 @@ x
 5
 6
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 clone
 initial (active dataset)
 
@@ -85,13 +98,11 @@ y,z
 7,7.00
 8,8.00
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 unnamed dataset (active dataset)
 initial
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 unnamed dataset (active dataset)
 ])
 AT_CLEANUP
@@ -110,8 +121,7 @@ DATASET DISPLAY.
 LIST.
 ])
 AT_CHECK([pspp -O format=csv dataset.pspp], [1], [dnl
-Table: Open datasets.
-Dataset
+Table: Datasets
 unnamed dataset (active dataset)
 second
 
@@ -119,11 +129,12 @@ Table: Data List
 x
 1
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 second (active dataset)
 
-dataset.pspp:10: error: LIST: LIST is allowed only after the active dataset has been defined.
+"dataset.pspp:10.1-10.4: error: LIST: LIST is allowed only after the active dataset has been defined.
+   10 | LIST.
+      | ^~~~"
 ])
 AT_CLEANUP
 
@@ -139,14 +150,12 @@ DATASET NAME c.
 DATASET DISPLAY.
 ])
 AT_CHECK([pspp -O format=csv dataset.pspp], [0], [dnl
-Table: Open datasets.
-Dataset
+Table: Datasets
 a (active dataset)
 b
 c
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 c (active dataset)
 ])
 AT_CLEANUP
@@ -160,13 +169,11 @@ DATASET ACTIVATE x.
 DATASET DISPLAY.
 ])
 AT_CHECK([pspp -O format=csv dataset.pspp], [0], [dnl
-Table: Open datasets.
-Dataset
+Table: Datasets
 unnamed dataset (active dataset)
 x
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 x (active dataset)
 ])
 AT_CLEANUP
@@ -194,8 +201,7 @@ DATASET ACTIVATE one.
 LIST.
 ])
 AT_CHECK([pspp -O format=csv dataset.pspp], [1], [dnl
-Table: Open datasets.
-Dataset
+Table: Datasets
 another
 one (active dataset)
 
@@ -209,7 +215,9 @@ one (active dataset)
 
 5 @&t@
 
-dataset.pspp:16: error: LIST: LIST is allowed only after the active dataset has been defined.
+"dataset.pspp:16.1-16.4: error: LIST: LIST is allowed only after the active dataset has been defined.
+   16 | LIST.
+      | ^~~~"
 
 Table: Data List
 x
@@ -253,50 +261,73 @@ DATASET CLOSE ALL.
 DATASET DISPLAY.
 ])
 AT_CHECK([pspp -O format=csv dataset.pspp], [0], [dnl
-Table: Open datasets.
-Dataset
+Table: Datasets
 unnamed dataset (active dataset)
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 unnamed dataset (active dataset)
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 this (active dataset)
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 unnamed dataset (active dataset)
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 this (active dataset)
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 unnamed dataset (active dataset)
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 unnamed dataset (active dataset)
 that
 theother
 yetanother
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 unnamed dataset (active dataset)
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 that
 theother
 this (active dataset)
 yetanother
 
-Table: Open datasets.
-Dataset
+Table: Datasets
 unnamed dataset (active dataset)
 ])
 AT_CLEANUP
+
+
+
+dnl The bug for which the following test checks, is apparent only
+dnl when compiled with -fsanitize=address or run under valgrind
+AT_SETUP([DATASET heap overflow])
+AT_DATA([dataset.pspp], [dnl
+DATASET DECLARE initial.
+DATA LIST /x 1.
+
+DATASET COPY subsq.
+
+DATA LIST /y 2-4.
+BEGIN DATA.
+7
+END DATA.
+
+DATASET ACTIVATE subsq.
+
+LIST.
+])
+
+AT_CHECK([pspp -O format=csv dataset.pspp], [0], [dnl
+Table: Reading 1 record from INLINE.
+Variable,Record,Columns,Format
+x,1,1-1,F1.0
+
+Table: Reading 1 record from INLINE.
+Variable,Record,Columns,Format
+y,1,2-4,F3.0
+])
+
+AT_CLEANUP
\ No newline at end of file