From 5a1544f9256177e7452452713dfc76e9d05c7ad8 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 29 Jan 2014 20:24:26 +0100 Subject: [PATCH] tests/empdump: New; exercising the empdump utility Signed-off-by: Markus Armbruster --- Make.mk | 1 + tests/empdump-test | 33 +++++++ tests/empdump/errors.err | 99 +++++++++++++++++++ tests/empdump/errors.status | 77 +++++++++++++++ tests/empdump/verify-fails | 19 ++++ tests/empdump/verify-fixed | 19 ++++ tests/empdump/verify-prep | 5 + tests/empdump/xundump-errors/colhdr-amb | 4 + tests/empdump/xundump-errors/colhdr-dup | 3 + tests/empdump/xundump-errors/colhdr-dup2 | 8 ++ tests/empdump/xundump-errors/colhdr-dup3 | 4 + tests/empdump/xundump-errors/colhdr-ellipsis | 3 + tests/empdump/xundump-errors/colhdr-ellipsis2 | 3 + tests/empdump/xundump-errors/colhdr-ellipsis3 | 3 + tests/empdump/xundump-errors/colhdr-ellipsis4 | 3 + tests/empdump/xundump-errors/colhdr-ellipsis5 | 4 + tests/empdump/xundump-errors/colhdr-eof | 1 + tests/empdump/xundump-errors/colhdr-first | 4 + tests/empdump/xundump-errors/colhdr-idxbig | 3 + tests/empdump/xundump-errors/colhdr-idxneg | 3 + tests/empdump/xundump-errors/colhdr-idxreq | 3 + tests/empdump/xundump-errors/colhdr-junk | 3 + tests/empdump/xundump-errors/colhdr-junk2 | 3 + tests/empdump/xundump-errors/colhdr-junk3 | 3 + tests/empdump/xundump-errors/colhdr-malidx | 3 + tests/empdump/xundump-errors/colhdr-malidx2 | 3 + tests/empdump/xundump-errors/colhdr-malidx3 | 3 + tests/empdump/xundump-errors/colhdr-miss | 7 ++ tests/empdump/xundump-errors/colhdr-miss2 | 32 ++++++ tests/empdump/xundump-errors/colhdr-noidx | 3 + tests/empdump/xundump-errors/colhdr-sep | 3 + tests/empdump/xundump-errors/colhdr-symidx | 3 + tests/empdump/xundump-errors/colhdr-unexp2 | 4 + tests/empdump/xundump-errors/colhdr-unk | 4 + tests/empdump/xundump-errors/fld-ambsym | 3 + tests/empdump/xundump-errors/fld-badnum | 4 + tests/empdump/xundump-errors/fld-constnum | 4 + tests/empdump/xundump-errors/fld-conststr | 4 + tests/empdump/xundump-errors/fld-conststr2 | 9 ++ tests/empdump/xundump-errors/fld-eof | 2 + tests/empdump/xundump-errors/fld-invesc | 3 + tests/empdump/xundump-errors/fld-invid | 4 + tests/empdump/xundump-errors/fld-invid1 | 4 + tests/empdump/xundump-errors/fld-invid2 | 4 + tests/empdump/xundump-errors/fld-invid3 | 5 + tests/empdump/xundump-errors/fld-invid4 | 4 + tests/empdump/xundump-errors/fld-junk | 3 + tests/empdump/xundump-errors/fld-junk2 | 3 + tests/empdump/xundump-errors/fld-malnum | 3 + tests/empdump/xundump-errors/fld-malstr | 3 + tests/empdump/xundump-errors/fld-many | 3 + tests/empdump/xundump-errors/fld-miss | 3 + tests/empdump/xundump-errors/fld-miss2 | 3 + tests/empdump/xundump-errors/fld-nonil | 4 + tests/empdump/xundump-errors/fld-nonum | 4 + tests/empdump/xundump-errors/fld-nostr | 4 + tests/empdump/xundump-errors/fld-nosym | 3 + tests/empdump/xundump-errors/fld-nosymset | 3 + tests/empdump/xundump-errors/fld-sep | 3 + tests/empdump/xundump-errors/fld-strbig | 4 + tests/empdump/xundump-errors/fld-unexpid | 8 ++ tests/empdump/xundump-errors/fld-unexpid1 | 9 ++ tests/empdump/xundump-errors/fld-unksym | 3 + tests/empdump/xundump-errors/fld-unparen | 3 + tests/empdump/xundump-errors/ftr-fewrows | 3 + tests/empdump/xundump-errors/ftr-fewrows2 | 5 + tests/empdump/xundump-errors/ftr-fewrows3 | 5 + tests/empdump/xundump-errors/ftr-fewrows4 | 8 ++ tests/empdump/xundump-errors/ftr-junk | 3 + tests/empdump/xundump-errors/ftr-mal | 3 + tests/empdump/xundump-errors/ftr-mal2 | 7 ++ tests/empdump/xundump-errors/ftr-manyrows | 7 ++ tests/empdump/xundump-errors/ftr-mismatch | 3 + tests/empdump/xundump-errors/hdr-extra | 3 + tests/empdump/xundump-errors/hdr-extra2 | 3 + tests/empdump/xundump-errors/hdr-junk | 3 + tests/empdump/xundump-errors/hdr-none | 2 + tests/empdump/xundump-errors/hdr-noperm | 2 + tests/empdump/xundump-errors/hdr-noperm2 | 2 + tests/empdump/xundump-errors/hdr-unexp | 5 + tests/empdump/xundump-errors/hdr-unktab | 2 + 81 files changed, 561 insertions(+) create mode 100755 tests/empdump-test create mode 100644 tests/empdump/errors.err create mode 100644 tests/empdump/errors.status create mode 100644 tests/empdump/verify-fails create mode 100644 tests/empdump/verify-fixed create mode 100644 tests/empdump/verify-prep create mode 100644 tests/empdump/xundump-errors/colhdr-amb create mode 100644 tests/empdump/xundump-errors/colhdr-dup create mode 100644 tests/empdump/xundump-errors/colhdr-dup2 create mode 100644 tests/empdump/xundump-errors/colhdr-dup3 create mode 100644 tests/empdump/xundump-errors/colhdr-ellipsis create mode 100644 tests/empdump/xundump-errors/colhdr-ellipsis2 create mode 100644 tests/empdump/xundump-errors/colhdr-ellipsis3 create mode 100644 tests/empdump/xundump-errors/colhdr-ellipsis4 create mode 100644 tests/empdump/xundump-errors/colhdr-ellipsis5 create mode 100644 tests/empdump/xundump-errors/colhdr-eof create mode 100644 tests/empdump/xundump-errors/colhdr-first create mode 100644 tests/empdump/xundump-errors/colhdr-idxbig create mode 100644 tests/empdump/xundump-errors/colhdr-idxneg create mode 100644 tests/empdump/xundump-errors/colhdr-idxreq create mode 100644 tests/empdump/xundump-errors/colhdr-junk create mode 100644 tests/empdump/xundump-errors/colhdr-junk2 create mode 100644 tests/empdump/xundump-errors/colhdr-junk3 create mode 100644 tests/empdump/xundump-errors/colhdr-malidx create mode 100644 tests/empdump/xundump-errors/colhdr-malidx2 create mode 100644 tests/empdump/xundump-errors/colhdr-malidx3 create mode 100644 tests/empdump/xundump-errors/colhdr-miss create mode 100644 tests/empdump/xundump-errors/colhdr-miss2 create mode 100644 tests/empdump/xundump-errors/colhdr-noidx create mode 100644 tests/empdump/xundump-errors/colhdr-sep create mode 100644 tests/empdump/xundump-errors/colhdr-symidx create mode 100644 tests/empdump/xundump-errors/colhdr-unexp2 create mode 100644 tests/empdump/xundump-errors/colhdr-unk create mode 100644 tests/empdump/xundump-errors/fld-ambsym create mode 100644 tests/empdump/xundump-errors/fld-badnum create mode 100644 tests/empdump/xundump-errors/fld-constnum create mode 100644 tests/empdump/xundump-errors/fld-conststr create mode 100644 tests/empdump/xundump-errors/fld-conststr2 create mode 100644 tests/empdump/xundump-errors/fld-eof create mode 100644 tests/empdump/xundump-errors/fld-invesc create mode 100644 tests/empdump/xundump-errors/fld-invid create mode 100644 tests/empdump/xundump-errors/fld-invid1 create mode 100644 tests/empdump/xundump-errors/fld-invid2 create mode 100644 tests/empdump/xundump-errors/fld-invid3 create mode 100644 tests/empdump/xundump-errors/fld-invid4 create mode 100644 tests/empdump/xundump-errors/fld-junk create mode 100644 tests/empdump/xundump-errors/fld-junk2 create mode 100644 tests/empdump/xundump-errors/fld-malnum create mode 100644 tests/empdump/xundump-errors/fld-malstr create mode 100644 tests/empdump/xundump-errors/fld-many create mode 100644 tests/empdump/xundump-errors/fld-miss create mode 100644 tests/empdump/xundump-errors/fld-miss2 create mode 100644 tests/empdump/xundump-errors/fld-nonil create mode 100644 tests/empdump/xundump-errors/fld-nonum create mode 100644 tests/empdump/xundump-errors/fld-nostr create mode 100644 tests/empdump/xundump-errors/fld-nosym create mode 100644 tests/empdump/xundump-errors/fld-nosymset create mode 100644 tests/empdump/xundump-errors/fld-sep create mode 100644 tests/empdump/xundump-errors/fld-strbig create mode 100644 tests/empdump/xundump-errors/fld-unexpid create mode 100644 tests/empdump/xundump-errors/fld-unexpid1 create mode 100644 tests/empdump/xundump-errors/fld-unksym create mode 100644 tests/empdump/xundump-errors/fld-unparen create mode 100644 tests/empdump/xundump-errors/ftr-fewrows create mode 100644 tests/empdump/xundump-errors/ftr-fewrows2 create mode 100644 tests/empdump/xundump-errors/ftr-fewrows3 create mode 100644 tests/empdump/xundump-errors/ftr-fewrows4 create mode 100644 tests/empdump/xundump-errors/ftr-junk create mode 100644 tests/empdump/xundump-errors/ftr-mal create mode 100644 tests/empdump/xundump-errors/ftr-mal2 create mode 100644 tests/empdump/xundump-errors/ftr-manyrows create mode 100644 tests/empdump/xundump-errors/ftr-mismatch create mode 100644 tests/empdump/xundump-errors/hdr-extra create mode 100644 tests/empdump/xundump-errors/hdr-extra2 create mode 100644 tests/empdump/xundump-errors/hdr-junk create mode 100644 tests/empdump/xundump-errors/hdr-none create mode 100644 tests/empdump/xundump-errors/hdr-noperm create mode 100644 tests/empdump/xundump-errors/hdr-noperm2 create mode 100644 tests/empdump/xundump-errors/hdr-unexp create mode 100644 tests/empdump/xundump-errors/hdr-unktab diff --git a/Make.mk b/Make.mk index 2cd5efc4a..f0a00b93f 100644 --- a/Make.mk +++ b/Make.mk @@ -273,6 +273,7 @@ else @echo "$(srcdir)/tests/bridgefall-test SKIPPED" @echo "$(srcdir)/tests/retreat-test SKIPPED" endif + $(srcdir)/tests/empdump-test $(srcdir) ### Implicit rules diff --git a/tests/empdump-test b/tests/empdump-test new file mode 100755 index 000000000..f3f410300 --- /dev/null +++ b/tests/empdump-test @@ -0,0 +1,33 @@ +#!/bin/sh -e +# Basic empdump test + +if [ $# -ne 1 ] +then echo "Usage: $0 SRCDIR" >&2; exit 1 +fi + +srcdir="$1" + +. "$srcdir"/tests/test-common.sh + +create_sandbox + +$files -f >/dev/null +for i in `git ls-files "$testdir"/xundump-errors | uniq` +do run errors $empdump -ni "$i" +done +run errors $empdump -i "$testdir"/verify-prep +run errors $empdump -ni "$testdir"/verify-fails +run errors $empdump -ni "$testdir"/verify-fixed + +$files -f >/dev/null +run import1 $empdump -i "$srcdir"/tests/smoke/final.xdump +run export1 $empdump -xm +mv sandbox/export1.out sandbox/intermediate.xdump +mv $data $data-intermediate +$files -f >/dev/null +run import2 $empdump -i sandbox/intermediate.xdump +run export2 $empdump -x +mv sandbox/export2.out sandbox/final.xdump + +cmp_run errors import1 export1 import2 export2 +EMPIRE_CHECK_ACCEPT= cmp_out1 final.xdump "$srcdir"/tests/smoke/final.xdump diff --git a/tests/empdump/errors.err b/tests/empdump/errors.err new file mode 100644 index 000000000..97db388c7 --- /dev/null +++ b/tests/empdump/errors.err @@ -0,0 +1,99 @@ +tests/empdump/xundump-errors/colhdr-amb:2: Header m of field 3 is ambiguous +tests/empdump/xundump-errors/colhdr-dup:2: Duplicate header name in field 2 +tests/empdump/xundump-errors/colhdr-dup2:6: Duplicate header name in field 3 +tests/empdump/xundump-errors/colhdr-dup3:2: Duplicate header pkg(0) in field 8 +tests/empdump/xundump-errors/colhdr-ellipsis:2: Header field uid required in each table part +tests/empdump/xundump-errors/colhdr-ellipsis2:2: Junk after ... +tests/empdump/xundump-errors/colhdr-ellipsis3:2: Table infrastructure doesn't support ... +tests/empdump/xundump-errors/colhdr-ellipsis4:2: Header field uid required in each table part +tests/empdump/xundump-errors/colhdr-ellipsis5:2: Table sect doesn't support ... +tests/empdump/xundump-errors/colhdr-eof:2: Unexpected EOF +tests/empdump/xundump-errors/colhdr-first:2: Header field uid must come first +tests/empdump/xundump-errors/colhdr-idxbig:2: Header pkg(99) index out of bounds in field 7 +tests/empdump/xundump-errors/colhdr-idxneg:2: Index must not be negative in header field 7 +tests/empdump/xundump-errors/colhdr-idxreq:2: Header pkg requires an index in field 7 +tests/empdump/xundump-errors/colhdr-junk:2: Junk in header field 1 +tests/empdump/xundump-errors/colhdr-junk2:2: Junk in header field 1 +tests/empdump/xundump-errors/colhdr-junk3:2: Junk in header field 1 +tests/empdump/xundump-errors/colhdr-malidx:2: Malformed number in index of header field 1 +tests/empdump/xundump-errors/colhdr-malidx2:2: Malformed index in header field 1 +tests/empdump/xundump-errors/colhdr-malidx3:2: Malformed index in header field 1 +tests/empdump/xundump-errors/colhdr-miss:2: Header field uid missing +tests/empdump/xundump-errors/colhdr-miss:2: Header field ctype(2) missing +tests/empdump/xundump-errors/colhdr-miss:2: Header fields camt(0) ... camt(2) missing +tests/empdump/xundump-errors/colhdr-miss:2: Header field nllag missing +tests/empdump/xundump-errors/colhdr-miss2:21: Header field uid required in each table part +tests/empdump/xundump-errors/colhdr-miss2:21: Header fields ctype(0) ... ctype(2) missing +tests/empdump/xundump-errors/colhdr-miss2:21: Header fields camt(0) ... camt(2) missing +tests/empdump/xundump-errors/colhdr-miss2:21: Header field type missing +tests/empdump/xundump-errors/colhdr-miss2:21: Header field level missing +tests/empdump/xundump-errors/colhdr-miss2:21: Header field cost missing +tests/empdump/xundump-errors/colhdr-miss2:21: Header field nrndx missing +tests/empdump/xundump-errors/colhdr-miss2:21: Header field nrdep missing +tests/empdump/xundump-errors/colhdr-miss2:21: Header field nlndx missing +tests/empdump/xundump-errors/colhdr-miss2:21: Header field nlmin missing +tests/empdump/xundump-errors/colhdr-miss2:21: Header field nllag missing +tests/empdump/xundump-errors/colhdr-noidx:2: Header name doesn't take an index in field 1 +tests/empdump/xundump-errors/colhdr-sep:2: Bad field separator after field 1 +tests/empdump/xundump-errors/colhdr-symidx:2: Symbolic index in header field 1 not yet implemented +tests/empdump/xundump-errors/colhdr-unexp2:2: Expected header pkg(0) in field 7 +tests/empdump/xundump-errors/colhdr-unk:2: Header xxx of field 1 is unknown +tests/empdump/xundump-errors/fld-ambsym:2: Ambiguous flags symbol `s' in field 29 +tests/empdump/xundump-errors/fld-badnum:3: Field 2 can't hold this value +tests/empdump/xundump-errors/fld-constnum:3: Value for field 1 must be 0 +tests/empdump/xundump-errors/fld-conststr:3: Value for field 1 must be "road network" +tests/empdump/xundump-errors/fld-conststr2:8: Value for field 2 must be nil +tests/empdump/xundump-errors/fld-eof:2: Unexpected EOF +tests/empdump/xundump-errors/fld-invesc:2: Invalid escape sequence in field 1 +tests/empdump/xundump-errors/fld-invid:3: Field 1 can't hold this value +tests/empdump/xundump-errors/fld-invid1:3: Expected 0 in field 1 +tests/empdump/xundump-errors/fld-invid2:3: Field 1 must be > -1 +tests/empdump/xundump-errors/fld-invid3:4: Field 1 must be > 2 +tests/empdump/xundump-errors/fld-invid4:3: Field 1 must be <= 98 +tests/empdump/xundump-errors/fld-junk:2: Junk in field 1 +tests/empdump/xundump-errors/fld-junk2:2: Junk in field 19 +tests/empdump/xundump-errors/fld-malnum:2: Malformed number in field 1 +tests/empdump/xundump-errors/fld-malstr:2: Malformed string in field 1 +tests/empdump/xundump-errors/fld-many:2: Too many fields, expected only 6 +tests/empdump/xundump-errors/fld-miss:2: Field name missing +tests/empdump/xundump-errors/fld-miss2:2: Field ctype(0) missing +tests/empdump/xundump-errors/fld-nonil:3: Field 19 doesn't take nil +tests/empdump/xundump-errors/fld-nonum:3: Field 2 doesn't take numbers +tests/empdump/xundump-errors/fld-nostr:3: Field 1 doesn't take strings +tests/empdump/xundump-errors/fld-nosym:2: Field 1 doesn't take symbols +tests/empdump/xundump-errors/fld-nosymset:2: Field 1 doesn't take symbol sets +tests/empdump/xundump-errors/fld-sep:2: Bad field separator after field 1 +tests/empdump/xundump-errors/fld-strbig:3: Field 19 takes at most 9 characters +tests/empdump/xundump-errors/fld-unexpid:6: Table's first part doesn't have this row +tests/empdump/xundump-errors/fld-unexpid1:7: Expected 2 in field 1, like in table's first part +tests/empdump/xundump-errors/fld-unksym:2: Unknown level symbol `xxx' in field 11 +tests/empdump/xundump-errors/fld-unparen:2: Unmatched '(' in field 19 +tests/empdump/xundump-errors/ftr-fewrows:2: Expected 1024 more rows +tests/empdump/xundump-errors/ftr-fewrows2:4: Expected 13 more rows +tests/empdump/xundump-errors/ftr-fewrows3:4: Expected 1 more rows +tests/empdump/xundump-errors/ftr-fewrows4:7: Expected row with 2 in field 1, like in table's first part +tests/empdump/xundump-errors/ftr-junk:2: Junk after table footer +tests/empdump/xundump-errors/ftr-mal:2: Malformed table footer +tests/empdump/xundump-errors/ftr-mal2:6: Malformed table footer +tests/empdump/xundump-errors/ftr-manyrows:5: Too many rows +tests/empdump/xundump-errors/ftr-mismatch:2: Read 0 rows, which doesn't match footer 2 rows +tests/empdump/xundump-errors/hdr-extra:2: Extraneous header timestamp in field 1 +tests/empdump/xundump-errors/hdr-extra2:2: Extraneous header uid in field 1 +tests/empdump/xundump-errors/hdr-junk:1: Junk after xdump header +tests/empdump/xundump-errors/hdr-none:1: Expected xdump header +tests/empdump/xundump-errors/hdr-noperm:1: Table `map' is not permitted here +tests/empdump/xundump-errors/hdr-noperm2:1: Table `table' is not permitted here +tests/empdump/xundump-errors/hdr-unexp:4: Expected table `ship', not `plane' +tests/empdump/xundump-errors/hdr-unktab:1: Unknown table `xxx' +File plane uid 0 field flags: bit 8 is not in symbol table plane-flags +File plane uid 1 field mission: value 99 is not in symbol table missions +File plane uid 2 field owner: value 255 indexes table nat out of bounds 0..99 +File plane uid 2 field ship: value 42 indexes table ship out of bounds 0..0 +File plane uid 3 field ship: value 0 indexes table ship out of bounds 0..0 +File land uid 0 field ship: value 0 indexes table ship out of bounds 0..0 +File plane uid 3: on two carriers +File land uid 0: on two carriers +File plane uid 0: stuck in the air (fixed) +File plane uid 1: ghost stuck on carrier (fixed) +File land uid 0: ghost stuck on carrier (fixed) +File nuke uid 0: ghost stuck on carrier (fixed) diff --git a/tests/empdump/errors.status b/tests/empdump/errors.status new file mode 100644 index 000000000..3a96297fa --- /dev/null +++ b/tests/empdump/errors.status @@ -0,0 +1,77 @@ +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +0 +1 +0 diff --git a/tests/empdump/verify-fails b/tests/empdump/verify-fails new file mode 100644 index 000000000..03d784b2e --- /dev/null +++ b/tests/empdump/verify-fails @@ -0,0 +1,19 @@ +# Test every non-recoverable verify_fail(), as far as possible +# Not possible: header corrupt, incorrect uid +config plane +uid owner xloc yloc type effic mobil off tech opx opy mission radius wing range ship land harden flags access theta +# bit not in symbol table plane-flags +0 1 0 0 0 100 0 0 0 0 0 0 0 "" 0 -1 -1 0 256 0 0.00000 +# value not in symbol table missions +1 1 0 0 0 100 0 0 0 0 0 99 0 "" 0 -1 -1 0 0 0 0.00000 +# value indexes table nat out of bounds +# value refers to missing element of table ship +2 255 0 0 0 100 0 0 0 0 0 0 0 "" 0 42 -1 0 0 0 0.00000 +# on two carriers +3 1 0 0 0 100 0 0 0 0 0 0 0 "" 0 0 0 0 0 0 0.00000 +/config +config land +uid owner xloc yloc type effic mobil off tech opx opy mission radius army ship harden retreat rflags rpath civil milit shell gun petrol iron dust bar food oil lcm hcm uw rad pstage ptime land access +# on two carriers +0 1 0 0 0 100 0 0 0 0 0 none 0 "" 0 0 42 () "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 +/config diff --git a/tests/empdump/verify-fixed b/tests/empdump/verify-fixed new file mode 100644 index 000000000..ad94dc206 --- /dev/null +++ b/tests/empdump/verify-fixed @@ -0,0 +1,19 @@ +# Test every recoverable verify_fail(), as far as possible +# Not possible: bogus sect coordinates +config plane +uid owner xloc yloc type effic mobil off tech opx opy mission radius wing range ship land harden flags access theta +# stuck in the air +0 1 0 0 0 100 0 0 100 0 0 none 0 "" 0 -1 -1 0 (launched) 0 0.00000 +# ghost stuck on carrier +1 0 0 0 0 100 0 0 100 0 0 none 0 "" 0 0 -1 0 () 0 0.00000 +/config +config land +uid owner xloc yloc type effic mobil off tech opx opy mission radius army ship harden retreat rflags rpath civil milit shell gun petrol iron dust bar food oil lcm hcm uw rad pstage ptime land access +# ghost stuck on carrier +0 0 0 0 0 100 0 0 100 0 0 none 0 "" 0 0 42 () "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0 +/config +config nuke +uid owner xloc yloc type effic mobil off tech opx opy mission radius stockpile plane +# ghost stuck on carrier +0 0 0 0 0 100 0 0 300 0 0 none 0 "" 0 +/config diff --git a/tests/empdump/verify-prep b/tests/empdump/verify-prep new file mode 100644 index 000000000..3f68a3755 --- /dev/null +++ b/tests/empdump/verify-prep @@ -0,0 +1,5 @@ +config nat +cnum stat cname passwd ip hostname userid xcap ycap xorg yorg update tgms ann timeused btu access milreserve money login logout newstim annotim tech research education happiness relations(0) relations(1) relations(2) relations(3) relations(4) relations(5) relations(6) relations(7) relations(8) relations(9) relations(10) relations(11) relations(12) relations(13) relations(14) relations(15) relations(16) relations(17) relations(18) relations(19) relations(20) relations(21) relations(22) relations(23) relations(24) relations(25) relations(26) relations(27) relations(28) relations(29) relations(30) relations(31) relations(32) relations(33) relations(34) relations(35) relations(36) relations(37) relations(38) relations(39) relations(40) relations(41) relations(42) relations(43) relations(44) relations(45) relations(46) relations(47) relations(48) relations(49) relations(50) relations(51) relations(52) relations(53) relations(54) relations(55) relations(56) relations(57) relations(58) relations(59) relations(60) relations(61) relations(62) relations(63) relations(64) relations(65) relations(66) relations(67) relations(68) relations(69) relations(70) relations(71) relations(72) relations(73) relations(74) relations(75) relations(76) relations(77) relations(78) relations(79) relations(80) relations(81) relations(82) relations(83) relations(84) relations(85) relations(86) relations(87) relations(88) relations(89) relations(90) relations(91) relations(92) relations(93) relations(94) relations(95) relations(96) relations(97) relations(98) contacts(0) contacts(1) contacts(2) contacts(3) contacts(4) contacts(5) contacts(6) contacts(7) contacts(8) contacts(9) contacts(10) contacts(11) contacts(12) contacts(13) contacts(14) contacts(15) contacts(16) contacts(17) contacts(18) contacts(19) contacts(20) contacts(21) contacts(22) contacts(23) contacts(24) contacts(25) contacts(26) contacts(27) contacts(28) contacts(29) contacts(30) contacts(31) contacts(32) contacts(33) contacts(34) contacts(35) contacts(36) contacts(37) contacts(38) contacts(39) contacts(40) contacts(41) contacts(42) contacts(43) contacts(44) contacts(45) contacts(46) contacts(47) contacts(48) contacts(49) contacts(50) contacts(51) contacts(52) contacts(53) contacts(54) contacts(55) contacts(56) contacts(57) contacts(58) contacts(59) contacts(60) contacts(61) contacts(62) contacts(63) contacts(64) contacts(65) contacts(66) contacts(67) contacts(68) contacts(69) contacts(70) contacts(71) contacts(72) contacts(73) contacts(74) contacts(75) contacts(76) contacts(77) contacts(78) contacts(79) contacts(80) contacts(81) contacts(82) contacts(83) contacts(84) contacts(85) contacts(86) contacts(87) contacts(88) contacts(89) contacts(90) contacts(91) contacts(92) contacts(93) contacts(94) contacts(95) contacts(96) contacts(97) contacts(98) rejects(0) rejects(1) rejects(2) rejects(3) rejects(4) rejects(5) rejects(6) rejects(7) rejects(8) rejects(9) rejects(10) rejects(11) rejects(12) rejects(13) rejects(14) rejects(15) rejects(16) rejects(17) rejects(18) rejects(19) rejects(20) rejects(21) rejects(22) rejects(23) rejects(24) rejects(25) rejects(26) rejects(27) rejects(28) rejects(29) rejects(30) rejects(31) rejects(32) rejects(33) rejects(34) rejects(35) rejects(36) rejects(37) rejects(38) rejects(39) rejects(40) rejects(41) rejects(42) rejects(43) rejects(44) rejects(45) rejects(46) rejects(47) rejects(48) rejects(49) rejects(50) rejects(51) rejects(52) rejects(53) rejects(54) rejects(55) rejects(56) rejects(57) rejects(58) rejects(59) rejects(60) rejects(61) rejects(62) rejects(63) rejects(64) rejects(65) rejects(66) rejects(67) rejects(68) rejects(69) rejects(70) rejects(71) rejects(72) rejects(73) rejects(74) rejects(75) rejects(76) rejects(77) rejects(78) rejects(79) rejects(80) rejects(81) rejects(82) rejects(83) rejects(84) rejects(85) rejects(86) rejects(87) rejects(88) rejects(89) rejects(90) rejects(91) rejects(92) rejects(93) rejects(94) rejects(95) rejects(96) rejects(97) rejects(98) flags +0 deity "POGO" "peter" "" "" "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00000 0.00000 0.00000 0.00000 at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () +1 active "1" "1" "" "" "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00000 0.00000 0.00000 0.00000 at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war at-war 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () () +/config diff --git a/tests/empdump/xundump-errors/colhdr-amb b/tests/empdump/xundump-errors/colhdr-amb new file mode 100644 index 000000000..ed0049963 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-amb @@ -0,0 +1,4 @@ +config sect-chr +uid name m +# Header m of field 3 is ambiguous +/config diff --git a/tests/empdump/xundump-errors/colhdr-dup b/tests/empdump/xundump-errors/colhdr-dup new file mode 100644 index 000000000..6edfa2d46 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-dup @@ -0,0 +1,3 @@ +config ship-chr +name name +# Duplicate header name in field 2 diff --git a/tests/empdump/xundump-errors/colhdr-dup2 b/tests/empdump/xundump-errors/colhdr-dup2 new file mode 100644 index 000000000..2fb2be714 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-dup2 @@ -0,0 +1,8 @@ +config ship-chr +type name ... +/config + +config ship-chr +type name name +# Duplicate header name in field 3 +/config diff --git a/tests/empdump/xundump-errors/colhdr-dup3 b/tests/empdump/xundump-errors/colhdr-dup3 new file mode 100644 index 000000000..bef172d63 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-dup3 @@ -0,0 +1,4 @@ +config item +uid name mnem value sell lbs pkg(0) pkg(0) +# Duplicate header pkg(0) in field 8 +/config diff --git a/tests/empdump/xundump-errors/colhdr-ellipsis b/tests/empdump/xundump-errors/colhdr-ellipsis new file mode 100644 index 000000000..3cf6e023f --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-ellipsis @@ -0,0 +1,3 @@ +config product +... +# Header field uid required in each table part diff --git a/tests/empdump/xundump-errors/colhdr-ellipsis2 b/tests/empdump/xundump-errors/colhdr-ellipsis2 new file mode 100644 index 000000000..6d202d80f --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-ellipsis2 @@ -0,0 +1,3 @@ +config item +uid ... name +# Junk after ... diff --git a/tests/empdump/xundump-errors/colhdr-ellipsis3 b/tests/empdump/xundump-errors/colhdr-ellipsis3 new file mode 100644 index 000000000..1cf602ce5 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-ellipsis3 @@ -0,0 +1,3 @@ +config infrastructure +name ... +# Table infrastructure doesn't support ... diff --git a/tests/empdump/xundump-errors/colhdr-ellipsis4 b/tests/empdump/xundump-errors/colhdr-ellipsis4 new file mode 100644 index 000000000..cc65144e0 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-ellipsis4 @@ -0,0 +1,3 @@ +config product +sname name ... +# Header field uid required in each table part diff --git a/tests/empdump/xundump-errors/colhdr-ellipsis5 b/tests/empdump/xundump-errors/colhdr-ellipsis5 new file mode 100644 index 000000000..1a95aa54a --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-ellipsis5 @@ -0,0 +1,4 @@ +config sect +xloc yloc ... +# Table sect doesn't support ... +/config diff --git a/tests/empdump/xundump-errors/colhdr-eof b/tests/empdump/xundump-errors/colhdr-eof new file mode 100644 index 000000000..ee64c5e40 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-eof @@ -0,0 +1 @@ +config ship-chr # Unexpected EOF diff --git a/tests/empdump/xundump-errors/colhdr-first b/tests/empdump/xundump-errors/colhdr-first new file mode 100644 index 000000000..3077bea7c --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-first @@ -0,0 +1,4 @@ +config ship +owner uid ... +# Header field uid must come first +/config diff --git a/tests/empdump/xundump-errors/colhdr-idxbig b/tests/empdump/xundump-errors/colhdr-idxbig new file mode 100644 index 000000000..fdbecd3d0 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-idxbig @@ -0,0 +1,3 @@ +config item +uid name mnem value sell lbs pkg(99) +# Header pkg(99) index out of bounds in field 7 diff --git a/tests/empdump/xundump-errors/colhdr-idxneg b/tests/empdump/xundump-errors/colhdr-idxneg new file mode 100644 index 000000000..3ae1ca46d --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-idxneg @@ -0,0 +1,3 @@ +config item +uid name mnem value sell lbs pkg(-1) +# Index must not be negative in header field 7 diff --git a/tests/empdump/xundump-errors/colhdr-idxreq b/tests/empdump/xundump-errors/colhdr-idxreq new file mode 100644 index 000000000..1cc33944b --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-idxreq @@ -0,0 +1,3 @@ +config item +uid name mnem value sell lbs pkg +# Header pkg requires an index in field 7 diff --git a/tests/empdump/xundump-errors/colhdr-junk b/tests/empdump/xundump-errors/colhdr-junk new file mode 100644 index 000000000..f9e544d92 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-junk @@ -0,0 +1,3 @@ +config item +0 +# Junk in header field 1 diff --git a/tests/empdump/xundump-errors/colhdr-junk2 b/tests/empdump/xundump-errors/colhdr-junk2 new file mode 100644 index 000000000..3e3f0c952 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-junk2 @@ -0,0 +1,3 @@ +config item +/config +# Junk in header field 1 diff --git a/tests/empdump/xundump-errors/colhdr-junk3 b/tests/empdump/xundump-errors/colhdr-junk3 new file mode 100644 index 000000000..25838bded --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-junk3 @@ -0,0 +1,3 @@ +config item +.a +# Junk in header field 1 diff --git a/tests/empdump/xundump-errors/colhdr-malidx b/tests/empdump/xundump-errors/colhdr-malidx new file mode 100644 index 000000000..aafaa8aba --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-malidx @@ -0,0 +1,3 @@ +config item +x(- +# Malformed number in index of header field 1 diff --git a/tests/empdump/xundump-errors/colhdr-malidx2 b/tests/empdump/xundump-errors/colhdr-malidx2 new file mode 100644 index 000000000..54b92f1a7 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-malidx2 @@ -0,0 +1,3 @@ +config item +x(! +# Malformed index in header field 1 diff --git a/tests/empdump/xundump-errors/colhdr-malidx3 b/tests/empdump/xundump-errors/colhdr-malidx3 new file mode 100644 index 000000000..46e399917 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-malidx3 @@ -0,0 +1,3 @@ +config item +x(0 y +# Malformed index in header field 1 diff --git a/tests/empdump/xundump-errors/colhdr-miss b/tests/empdump/xundump-errors/colhdr-miss new file mode 100644 index 000000000..c00f56682 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-miss @@ -0,0 +1,7 @@ +config product +name sname ctype(0) ctype(1) type level cost nrndx nrdep nlndx nlmin +# Header field uid missing +# Header field ctype(2) missing +# Header fields camt(0) ... camt(2) missing +# Header field nllag missing +/config diff --git a/tests/empdump/xundump-errors/colhdr-miss2 b/tests/empdump/xundump-errors/colhdr-miss2 new file mode 100644 index 000000000..044641ede --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-miss2 @@ -0,0 +1,32 @@ +config product +uid sname ... + 0 "iron" + 1 "dust" + 2 "food" + 3 "oil" + 4 "rad" + 5 "shells" + 6 "guns" + 7 "petrol" + 8 "bars" + 9 "lcm" + 10 "hcm" + 11 "tech" + 12 "medical" + 13 "edu" + 14 "happy" +/config + +config product +name +# Header field uid required in each table part +# Header fields ctype(0) ... ctype(2) missing +# Header fields camt(0) ... camt(2) missing +# Header field type missing +# Header field level missing +# Header field cost missing +# Header field nrndx missing +# Header field nrdep missing +# Header field nlndx missing +# Header field nlmin missing +# Header field nllag missing diff --git a/tests/empdump/xundump-errors/colhdr-noidx b/tests/empdump/xundump-errors/colhdr-noidx new file mode 100644 index 000000000..ec0bec27e --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-noidx @@ -0,0 +1,3 @@ +config ship-chr +name(0) +# Header name doesn't take an index in field 1 diff --git a/tests/empdump/xundump-errors/colhdr-sep b/tests/empdump/xundump-errors/colhdr-sep new file mode 100644 index 000000000..7cc9bedfe --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-sep @@ -0,0 +1,3 @@ +config item +u= +# Bad field separator after field 1 diff --git a/tests/empdump/xundump-errors/colhdr-symidx b/tests/empdump/xundump-errors/colhdr-symidx new file mode 100644 index 000000000..1d6bb922f --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-symidx @@ -0,0 +1,3 @@ +config item +f(x) +# Symbolic index in header field 1 not yet implemented diff --git a/tests/empdump/xundump-errors/colhdr-unexp2 b/tests/empdump/xundump-errors/colhdr-unexp2 new file mode 100644 index 000000000..aa09d1a65 --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-unexp2 @@ -0,0 +1,4 @@ +config item +uid name mnem value sell lbs pkg(1) +# Expected header pkg(0) in field 7 +/config diff --git a/tests/empdump/xundump-errors/colhdr-unk b/tests/empdump/xundump-errors/colhdr-unk new file mode 100644 index 000000000..a5295014f --- /dev/null +++ b/tests/empdump/xundump-errors/colhdr-unk @@ -0,0 +1,4 @@ +config ship-chr +xxx +# Header xxx of field 1 is unknown +/config diff --git a/tests/empdump/xundump-errors/fld-ambsym b/tests/empdump/xundump-errors/fld-ambsym new file mode 100644 index 000000000..e100d256e --- /dev/null +++ b/tests/empdump/xundump-errors/fld-ambsym @@ -0,0 +1,3 @@ +XDUMP ship-chr 1 +0 "ft\040\040\040fishing\040trawler" 300 10 0 0 0 0 0 0 900 0 0 0 15 0 25 15 10 25 15 2 0 0 0 0 35 300 (sw s) 0 0 +# Ambiguous flags symbol `s' in field 29 diff --git a/tests/empdump/xundump-errors/fld-badnum b/tests/empdump/xundump-errors/fld-badnum new file mode 100644 index 000000000..f0bfe261f --- /dev/null +++ b/tests/empdump/xundump-errors/fld-badnum @@ -0,0 +1,4 @@ +config land +uid owner ... +0 1.1 +# Field 2 can't hold this value diff --git a/tests/empdump/xundump-errors/fld-constnum b/tests/empdump/xundump-errors/fld-constnum new file mode 100644 index 000000000..410ad88e8 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-constnum @@ -0,0 +1,4 @@ +config realm +cnum realm xl xh yl yh +1 0 0 0 0 0 +# Value for field 1 must be 0 diff --git a/tests/empdump/xundump-errors/fld-conststr b/tests/empdump/xundump-errors/fld-conststr new file mode 100644 index 000000000..b2501ae5d --- /dev/null +++ b/tests/empdump/xundump-errors/fld-conststr @@ -0,0 +1,4 @@ +config infrastructure +name lcms hcms dcost mcost enable +"lala" 1 1 1 1 1 +# Value for field 1 must be "road network" diff --git a/tests/empdump/xundump-errors/fld-conststr2 b/tests/empdump/xundump-errors/fld-conststr2 new file mode 100644 index 000000000..c5a4a071b --- /dev/null +++ b/tests/empdump/xundump-errors/fld-conststr2 @@ -0,0 +1,9 @@ +config ship-chr +type name ... +0 nil +/config + +config ship-chr +type name ... +0 "non-nil" +# Value for field 2 must be nil diff --git a/tests/empdump/xundump-errors/fld-eof b/tests/empdump/xundump-errors/fld-eof new file mode 100644 index 000000000..5ec23829c --- /dev/null +++ b/tests/empdump/xundump-errors/fld-eof @@ -0,0 +1,2 @@ +XDUMP ship-chr 0 +0 # Unexpected EOF \ No newline at end of file diff --git a/tests/empdump/xundump-errors/fld-invesc b/tests/empdump/xundump-errors/fld-invesc new file mode 100644 index 000000000..ba24795f0 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-invesc @@ -0,0 +1,3 @@ +XDUMP infrastructure 0 +"lala\0" +# Invalid escape sequence in field 1 diff --git a/tests/empdump/xundump-errors/fld-invid b/tests/empdump/xundump-errors/fld-invid new file mode 100644 index 000000000..4860a5ab8 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-invid @@ -0,0 +1,4 @@ +config ship +uid ... +0.1 +# Field 1 can't hold this value diff --git a/tests/empdump/xundump-errors/fld-invid1 b/tests/empdump/xundump-errors/fld-invid1 new file mode 100644 index 000000000..2a59fcf97 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-invid1 @@ -0,0 +1,4 @@ +config item +uid ... +1 +# Expected 0 in field 1 diff --git a/tests/empdump/xundump-errors/fld-invid2 b/tests/empdump/xundump-errors/fld-invid2 new file mode 100644 index 000000000..5b40538a6 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-invid2 @@ -0,0 +1,4 @@ +config ship +uid ... +-1 +# Field 1 must be > -1 diff --git a/tests/empdump/xundump-errors/fld-invid3 b/tests/empdump/xundump-errors/fld-invid3 new file mode 100644 index 000000000..17675dcd8 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-invid3 @@ -0,0 +1,5 @@ +config ship +uid ... +2 +0 +# Field 1 must be > 2 diff --git a/tests/empdump/xundump-errors/fld-invid4 b/tests/empdump/xundump-errors/fld-invid4 new file mode 100644 index 000000000..7343785ef --- /dev/null +++ b/tests/empdump/xundump-errors/fld-invid4 @@ -0,0 +1,4 @@ +config nat +cnum ... +100 +# Field 1 must be <= 98 diff --git a/tests/empdump/xundump-errors/fld-junk b/tests/empdump/xundump-errors/fld-junk new file mode 100644 index 000000000..f3e16f45b --- /dev/null +++ b/tests/empdump/xundump-errors/fld-junk @@ -0,0 +1,3 @@ +XDUMP infrastructure 0 +! +# Junk in field 1 diff --git a/tests/empdump/xundump-errors/fld-junk2 b/tests/empdump/xundump-errors/fld-junk2 new file mode 100644 index 000000000..f8726ee5e --- /dev/null +++ b/tests/empdump/xundump-errors/fld-junk2 @@ -0,0 +1,3 @@ +XDUMP plane 0 +0 1 0 0 0 0 0 0 0 0 0 0 0 "" 0 -1 -1 0 (! +# Junk in field 19 diff --git a/tests/empdump/xundump-errors/fld-malnum b/tests/empdump/xundump-errors/fld-malnum new file mode 100644 index 000000000..5495e5b91 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-malnum @@ -0,0 +1,3 @@ +XDUMP infrastructure 0 ++ +# Malformed number in field 1 diff --git a/tests/empdump/xundump-errors/fld-malstr b/tests/empdump/xundump-errors/fld-malstr new file mode 100644 index 000000000..d2f039a66 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-malstr @@ -0,0 +1,3 @@ +XDUMP infrastructure 0 +"lala +# Malformed string in field 1 diff --git a/tests/empdump/xundump-errors/fld-many b/tests/empdump/xundump-errors/fld-many new file mode 100644 index 000000000..aaa9e78ed --- /dev/null +++ b/tests/empdump/xundump-errors/fld-many @@ -0,0 +1,3 @@ +XDUMP realm 0 +0 0 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f +# Too many fields, expected only 6 diff --git a/tests/empdump/xundump-errors/fld-miss b/tests/empdump/xundump-errors/fld-miss new file mode 100644 index 000000000..d92284ba7 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-miss @@ -0,0 +1,3 @@ +XDUMP item 0 +0 +# Field name missing diff --git a/tests/empdump/xundump-errors/fld-miss2 b/tests/empdump/xundump-errors/fld-miss2 new file mode 100644 index 000000000..eaeb3c96f --- /dev/null +++ b/tests/empdump/xundump-errors/fld-miss2 @@ -0,0 +1,3 @@ +XDUMP product 0 +0 "iron\040ore" "iron" +# Field ctype(0) missing diff --git a/tests/empdump/xundump-errors/fld-nonil b/tests/empdump/xundump-errors/fld-nonil new file mode 100644 index 000000000..d1b65fce4 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-nonil @@ -0,0 +1,4 @@ +config land +uid owner xloc yloc type effic mobil off tech opx opy mission radius army ship harden retreat rflags rpath ... +0 1 0 0 0 100 0 0 100 0 0 0 0 "" -1 0 42 0 nil +# Field 19 doesn't take nil diff --git a/tests/empdump/xundump-errors/fld-nonum b/tests/empdump/xundump-errors/fld-nonum new file mode 100644 index 000000000..85d3d73e2 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-nonum @@ -0,0 +1,4 @@ +config item +uid name ... +0 0 +# Field 2 doesn't take numbers diff --git a/tests/empdump/xundump-errors/fld-nostr b/tests/empdump/xundump-errors/fld-nostr new file mode 100644 index 000000000..b8fb9df56 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-nostr @@ -0,0 +1,4 @@ +config item +uid ... +"" +# Field 1 doesn't take strings diff --git a/tests/empdump/xundump-errors/fld-nosym b/tests/empdump/xundump-errors/fld-nosym new file mode 100644 index 000000000..b9e2b0708 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-nosym @@ -0,0 +1,3 @@ +XDUMP infrastructure 0 +xxx +# Field 1 doesn't take symbols diff --git a/tests/empdump/xundump-errors/fld-nosymset b/tests/empdump/xundump-errors/fld-nosymset new file mode 100644 index 000000000..579e4ac4f --- /dev/null +++ b/tests/empdump/xundump-errors/fld-nosymset @@ -0,0 +1,3 @@ +XDUMP infrastructure 0 +() +# Field 1 doesn't take symbol sets diff --git a/tests/empdump/xundump-errors/fld-sep b/tests/empdump/xundump-errors/fld-sep new file mode 100644 index 000000000..9d4233798 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-sep @@ -0,0 +1,3 @@ +XDUMP ship-chr 0 +0! +# Bad field separator after field 1 diff --git a/tests/empdump/xundump-errors/fld-strbig b/tests/empdump/xundump-errors/fld-strbig new file mode 100644 index 000000000..49967346d --- /dev/null +++ b/tests/empdump/xundump-errors/fld-strbig @@ -0,0 +1,4 @@ +config land +uid owner xloc yloc type effic mobil off tech opx opy mission radius army ship harden retreat rflags rpath ... +0 1 0 0 0 100 0 0 100 0 0 0 0 "" -1 0 42 0 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +# Field 19 takes at most 9 characters diff --git a/tests/empdump/xundump-errors/fld-unexpid b/tests/empdump/xundump-errors/fld-unexpid new file mode 100644 index 000000000..3b85502dd --- /dev/null +++ b/tests/empdump/xundump-errors/fld-unexpid @@ -0,0 +1,8 @@ +config ship +uid ... +/config +config ship +uid ... +2 +# Table's first part doesn't have this row +/config diff --git a/tests/empdump/xundump-errors/fld-unexpid1 b/tests/empdump/xundump-errors/fld-unexpid1 new file mode 100644 index 000000000..fe85f50b7 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-unexpid1 @@ -0,0 +1,9 @@ +config ship +uid ... +2 +/config +config ship +uid ... +1 +# Expected 2 in field 1, like in table's first part +/config diff --git a/tests/empdump/xundump-errors/fld-unksym b/tests/empdump/xundump-errors/fld-unksym new file mode 100644 index 000000000..29d31a0d1 --- /dev/null +++ b/tests/empdump/xundump-errors/fld-unksym @@ -0,0 +1,3 @@ +XDUMP product 1 +0 "iron ore" "iron" 0 0 0 0 0 0 0 xxx +# Unknown level symbol `xxx' in field 11 diff --git a/tests/empdump/xundump-errors/fld-unparen b/tests/empdump/xundump-errors/fld-unparen new file mode 100644 index 000000000..68f56b5fd --- /dev/null +++ b/tests/empdump/xundump-errors/fld-unparen @@ -0,0 +1,3 @@ +XDUMP plane 0 +0 1 0 0 0 0 0 0 0 0 0 0 0 "" 0 -1 -1 0 (launched sync +# Unmatched '(' in field 19 diff --git a/tests/empdump/xundump-errors/ftr-fewrows b/tests/empdump/xundump-errors/ftr-fewrows new file mode 100644 index 000000000..0be2020f6 --- /dev/null +++ b/tests/empdump/xundump-errors/ftr-fewrows @@ -0,0 +1,3 @@ +XDUMP sect 0 +/0 +# Expected 1024 more rows diff --git a/tests/empdump/xundump-errors/ftr-fewrows2 b/tests/empdump/xundump-errors/ftr-fewrows2 new file mode 100644 index 000000000..bb63ac57f --- /dev/null +++ b/tests/empdump/xundump-errors/ftr-fewrows2 @@ -0,0 +1,5 @@ +config item +uid ... +0 +/config +# Expected 13 more rows diff --git a/tests/empdump/xundump-errors/ftr-fewrows3 b/tests/empdump/xundump-errors/ftr-fewrows3 new file mode 100644 index 000000000..58bd59002 --- /dev/null +++ b/tests/empdump/xundump-errors/ftr-fewrows3 @@ -0,0 +1,5 @@ +XDUMP infrastructure 1133466732 +"road\040network" 2 2 2 1 1 +"rail\040network" 1 1 1 1 1 +/2 +# Expected 1 more rows diff --git a/tests/empdump/xundump-errors/ftr-fewrows4 b/tests/empdump/xundump-errors/ftr-fewrows4 new file mode 100644 index 000000000..7136469ba --- /dev/null +++ b/tests/empdump/xundump-errors/ftr-fewrows4 @@ -0,0 +1,8 @@ +config ship +uid ... +2 +/config +config ship +uid ... +/config +# Expected row with 2 in field 1, like in table's first part diff --git a/tests/empdump/xundump-errors/ftr-junk b/tests/empdump/xundump-errors/ftr-junk new file mode 100644 index 000000000..fd8bc3acd --- /dev/null +++ b/tests/empdump/xundump-errors/ftr-junk @@ -0,0 +1,3 @@ +XDUMP ship-chr 1130359236 +/0x +# Junk after table footer diff --git a/tests/empdump/xundump-errors/ftr-mal b/tests/empdump/xundump-errors/ftr-mal new file mode 100644 index 000000000..07799940e --- /dev/null +++ b/tests/empdump/xundump-errors/ftr-mal @@ -0,0 +1,3 @@ +XDUMP ship-chr 1130359236 +/x +# Malformed table footer diff --git a/tests/empdump/xundump-errors/ftr-mal2 b/tests/empdump/xundump-errors/ftr-mal2 new file mode 100644 index 000000000..fd50c36b9 --- /dev/null +++ b/tests/empdump/xundump-errors/ftr-mal2 @@ -0,0 +1,7 @@ +config infrastructure +name lcm hcm dcost mcost enab +"road network" 2 2 2 1 1 +"rail network" 1 1 1 1 1 +"defense factor" 1 1 1 1 0 +/con +# Malformed table footer diff --git a/tests/empdump/xundump-errors/ftr-manyrows b/tests/empdump/xundump-errors/ftr-manyrows new file mode 100644 index 000000000..659643227 --- /dev/null +++ b/tests/empdump/xundump-errors/ftr-manyrows @@ -0,0 +1,7 @@ +XDUMP infrastructure 1133466732 +"road\040network" 2 2 2 1 1 +"rail\040network" 1 1 1 1 1 +"defense\040factor" 1 1 1 1 0 +"lala" 1 1 1 1 1 +# Too many rows +/4 diff --git a/tests/empdump/xundump-errors/ftr-mismatch b/tests/empdump/xundump-errors/ftr-mismatch new file mode 100644 index 000000000..81159c7dc --- /dev/null +++ b/tests/empdump/xundump-errors/ftr-mismatch @@ -0,0 +1,3 @@ +XDUMP ship-chr 1130359236 +/2 +# Read 0 rows, which doesn't match footer 2 rows diff --git a/tests/empdump/xundump-errors/hdr-extra b/tests/empdump/xundump-errors/hdr-extra new file mode 100644 index 000000000..c856f3db9 --- /dev/null +++ b/tests/empdump/xundump-errors/hdr-extra @@ -0,0 +1,3 @@ +config news +timestamp +# Extraneous header timestamp in field 1 diff --git a/tests/empdump/xundump-errors/hdr-extra2 b/tests/empdump/xundump-errors/hdr-extra2 new file mode 100644 index 000000000..fa27ebb8f --- /dev/null +++ b/tests/empdump/xundump-errors/hdr-extra2 @@ -0,0 +1,3 @@ +config sect +uid ... +# Extraneous header uid in field 1 diff --git a/tests/empdump/xundump-errors/hdr-junk b/tests/empdump/xundump-errors/hdr-junk new file mode 100644 index 000000000..fde930830 --- /dev/null +++ b/tests/empdump/xundump-errors/hdr-junk @@ -0,0 +1,3 @@ +XDUMP ship 1130359236 junk +# Junk after xdump header +/0 diff --git a/tests/empdump/xundump-errors/hdr-none b/tests/empdump/xundump-errors/hdr-none new file mode 100644 index 000000000..700ef8655 --- /dev/null +++ b/tests/empdump/xundump-errors/hdr-none @@ -0,0 +1,2 @@ +junk +# Expected xdump header diff --git a/tests/empdump/xundump-errors/hdr-noperm b/tests/empdump/xundump-errors/hdr-noperm new file mode 100644 index 000000000..3f5e46aad --- /dev/null +++ b/tests/empdump/xundump-errors/hdr-noperm @@ -0,0 +1,2 @@ +config map +# Table `map' is not permitted here diff --git a/tests/empdump/xundump-errors/hdr-noperm2 b/tests/empdump/xundump-errors/hdr-noperm2 new file mode 100644 index 000000000..3bf4d47fc --- /dev/null +++ b/tests/empdump/xundump-errors/hdr-noperm2 @@ -0,0 +1,2 @@ +config table +# Table `table' is not permitted here diff --git a/tests/empdump/xundump-errors/hdr-unexp b/tests/empdump/xundump-errors/hdr-unexp new file mode 100644 index 000000000..dd8ab024f --- /dev/null +++ b/tests/empdump/xundump-errors/hdr-unexp @@ -0,0 +1,5 @@ +config ship +uid ... +/config +config plane +# Expected table `ship', not `plane' diff --git a/tests/empdump/xundump-errors/hdr-unktab b/tests/empdump/xundump-errors/hdr-unktab new file mode 100644 index 000000000..632f51aec --- /dev/null +++ b/tests/empdump/xundump-errors/hdr-unktab @@ -0,0 +1,2 @@ +XDUMP xxx 1 +# Unknown table `xxx' -- 2.43.0