empserver/tests
Markus Armbruster c016c5fe76 Fix five year old show stopper bugs on big endian hosts
emp_server and empdump refuse to start on most big endian hosts,
because ef_verify_config() chokes on mdchr_ca[]:

Config meta uid 0 field type: value 0 is not in symbol table meta-type
Config meta uid 1 field type: value 0 is not in symbol table meta-type
Config meta uid 2 field type: value 0 is not in symbol table meta-type
Config meta uid 3 field type: value 0 is not in symbol table meta-type
Config meta uid 4 field type: value 0 is not in symbol table meta-type

Broken in commit 06a0036 (v4.3.12), which changed struct castr member
ca_type from packed_nsc_type (typedef'ed to char) to enum nsc_type,
but neglected to update the ca_type in mdchr_ca[].

On little endian hosts, the selector reads the least significant byte,
with sign extension.  Happens to work, because the type values are all
sufficiently small integers.

On big endian hosts, the selector reads the most signiciant byte.
which is always zero (NSC_NOTYPE).  Makes ef_verify_config() fail.

Except when sizeof(enum nsc_notype) == 1.  Then selector type works
fine, and ef_verify_config() succeeds, but we run into the next
problem: the same commit also changed member ca_flags from nsc_flags
(typedef'ed to unsigned char) to int without updating the ca_type in
mdchr_ca[].  This breaks "only" xdump meta column flags.

v4.3.12 was released in April 2008.  Either nobody has tried to run a
game on a big endian host since, or all who did gave up quietly,
without reporting the problem.

We clearly need to test on a wider range of machines.
2013-05-08 06:57:58 +02:00
..
fairland Change fairland island size probability distribution 2013-05-08 06:57:55 +02:00
files Use int instead of signed char for pln_flags 2013-05-08 06:57:54 +02:00
smoke Fix five year old show stopper bugs on big endian hosts 2013-05-08 06:57:58 +02:00
fairland-test Switch PRNG from BSD random() to Mersenne Twister 2013-05-08 06:55:21 +02:00
files-test Add files test to make check 2013-05-08 06:55:18 +02:00
normalize.pl Use int instead of long for flags 2013-05-08 06:57:51 +02:00
smoke-test Switch PRNG from BSD random() to Mersenne Twister 2013-05-08 06:55:21 +02:00
test-common.sh Make smoke test time out instead of hang when server misbehaves 2013-05-08 06:57:55 +02:00