Commit Graph

326 Commits

Author SHA1 Message Date
Vladimir Serbinenko
9b824d73af TEST: remove prinring of md5 of encoding.dat 2020-11-16 10:06:27 +01:00
Vladimir Serbinenko
e187cee802 TEST: Don't suppress errors on copying of encoding.dat 2020-11-16 06:30:48 +01:00
Vladimir Serbinenko
cb5c080151 TEST: Fix path to test/runner.cpp 2020-11-16 04:09:37 +01:00
Vladimir Serbinenko
23111de32e TEST: clean copied encoding.dat 2020-11-16 03:47:22 +01:00
Vladimir Serbinenko
f5ffbe1155 TEST: Copy encoding.dat to make tests work in relative build directory 2020-11-16 02:38:22 +01:00
Vladimir Serbinenko
cd8270f039 TEST: Third attempt to fix the tests
Some tests unnecessarily referred to null osystem. Tested with PSP target
2020-11-16 01:51:14 +01:00
Vladimir Serbinenko
e3ace27da0 TEST: Second attempt at fixing tests
The framework doesn't understand preprocessor, put preprocessing inside the
tests.
2020-11-16 00:51:22 +01:00
Vladimir Serbinenko
a9fe1d7a84 TEST: Skip CJK tests outside of POSIX
They need file access that needs null backend which for now only
peopwely compiles on POSIX.
2020-11-15 23:57:53 +01:00
Cameron Cawley
3dd369e81f TEST: Fix compiling with MinGW 2020-11-15 21:28:27 +00:00
Vladimir Serbinenko
68a9136e4d
COMMON: Rewrite Encoder and drop dependency on iconv (#2586)
Different platforms have different levels of support of encodings and
often have slight variations. We already have tables for most encoding
with only CJK missing. Full transcoding inclusion allows us to get reliable
encoding results independently of platform. The biggest con is the need for
external tables encoding.dat.

It removes a duplicate table for korean in graphics/korfont.cpp
2020-11-15 16:20:35 +01:00
Eugene Sandulenko
c952d34410 TEST: Remove now unneeded library from dependencies 2020-10-09 23:33:38 +02:00
Eugene Sandulenko
3ba3e4e565 TEST: Fix linking 2020-10-09 21:31:15 +02:00
Paweł Kołodziejski
35b9cccbde ALL: Merge ResidualVM 2020-10-09 19:44:13 +02:00
Pawel Kolodziejski
4631c0e2ed ALL: Sync with ScummVM rev: a4002bdeee 2020-10-04 23:59:26 +02:00
Thierry Crozat
a275522f89 COMMON: Add list initialization and move semantics to Array 2020-10-03 15:51:14 +02:00
Pawel Kolodziejski
15a759370a ALL: Synced with ScummVM - rev: bdbbcd81ae 2020-09-12 19:38:50 +02:00
Vladimir Menshakov
0a4154318c COMMON: implement %c formatter (used in hardware-input.cpp)
Fix invalid descriptor name for half-axis.
Add some tests for U32String::Format.
2020-09-12 11:56:17 +01:00
Pawel Kolodziejski
d5304e2568 ALL: Synced with ScummVM - rev: 33a47d23b8 2020-09-03 02:21:14 +02:00
Vladimir Menshakov
8ddcbf8120 COMMON: Fix warnings about different signedness (uint32/char comparison), remove unused var
Add tests for both str/ustr comparison operators.
2020-09-02 20:35:43 +01:00
Vladimir Menshakov
f63f424309 COMMON: Preserve the order of insertion for equal range of the keys. 2020-08-31 18:17:29 +01:00
Pawel Kolodziejski
aea3bae26d ALL: Synced with ScummVM - rev 0b777c23a9 2020-08-11 00:59:40 +02:00
Cameron Cawley
68107af6de
TESTS: Fix the subsystem of the test runner on Windows 2020-07-26 17:07:35 +01:00
Pawel Kolodziejski
8f4e1c6cf3 Sync with ScummVM rev. 654b8208b8 2020-06-22 08:14:16 +02:00
Matthew Duggan
eeb2d2cf1f ULTIMA8: Fix unit tests 2020-06-17 18:29:47 +09:00
Pawel Kolodziejski
b586571900 ALL: synced with ScummVM commit 09bf38c120 2020-05-09 20:05:54 +02:00
Matthew Duggan
cecedb4f37 ULTIMA8: Refactor DataSources to inherit from Common::Streams 2020-04-11 17:05:40 +09:00
Matthew Duggan
4161cab9ba ULTIMA8: Update unit tests for function renames 2020-04-04 17:45:36 +09:00
Matthew Duggan
8c3ebe9af4 ULTIMA8: Correct Box.InBox boundary conditions
The boundary conditions were reversed in Box.Inbox when compared with
Box.Overlaps.  Since InBox is not being used and Overlaps is, I went with the
definitions from Overlaps. Also configured unit tests to exercise this
behavior.
2020-03-25 22:38:26 +09:00
Paul Gilbert
b5af8110ba ULTIMA8: Disable unit test for CRLF file handling 2020-03-08 10:35:57 -07:00
Matthew Duggan
c99de06915 ULTIMA8: Add unit tests for IBufferDataSource 2020-03-04 19:03:25 -08:00
Matthew Duggan
896d281ddc ULTIMA8: Free the correct pointer in ~OAutoBufferDataSource
Also add a unit test for the class to make sure the problem
is fixed.
2020-03-02 11:12:22 +02:00
Matthew Duggan
d058083888 ULTIMA8: Add some unit tests for base U8 classes 2020-02-29 16:29:33 -08:00
Bastien Bouclet
bb27669026 COMMON: Refill the stream buffer after making a large read
After reading directly from the parent stream, the buffer needs to be
filled with the end of the read data so seeking back in the stream into
the buffered area and reading returns data consistent with the parent
stream.

Fixes bug #11342 (PSP port only).
2020-02-07 18:33:56 +01:00
Jaromir Wysoglad
1346dcc3ef TESTBED: Move encoding conversion tests to testbed
This way it is possible to test the backend conversions too.
2019-08-24 18:12:45 +03:00
Jaromir Wysoglad
5fcd14fbea TEST: Remove tests for ascii transliteration
This can be handled differently by each conversion method.
The "Šáleček" could be transliterated as "Salecek" or as
"S'alecek" or maybe even differently.
2019-08-24 18:12:45 +03:00
Jaromir Wysoglad
3513972e92 TEST: Add tests for Common::Encoding 2019-08-24 18:12:45 +03:00
Bastien Bouclet
d474e3f94f ALL: Sync with ScummVM - rev. ea3f8f2e33 2019-06-29 19:08:44 +02:00
Bastien Bouclet
148655f5c2 COMMON: Use a prefix table to speed up the Huffman decoder
Symbols for codes shorter than the prefix table index width are stored
in the table. All the entries in the table with an index starting with
the code are set to the symbol value. That way, when decoding it is
possible to get the number of bits corresponding to the table width from
the bitstream and directly find the symbol value. Longer code still need
to be searched for in the codes list.
2019-04-14 20:24:26 +02:00
Bastien Bouclet
c087c5320c COMMON: Rework the BitStream class to improve its performance
* Fixed peekBits not to seek the underlying stream. Seeking can be slow
  when the stream is a file.
* Changed multi-bit  operations to work on multiple bits at once rather
  than iterating over single-bit operations.

This is an almost direct port of a patch for xoreos provided by DrMcCoy.
2019-04-14 20:22:50 +02:00
Bastien Bouclet
0f57aea2df COMMON: Use a prefix table to speed up the Huffman decoder
Symbols for codes shorter than the prefix table index width are stored
in the table. All the entries in the table with an index starting with
the code are set to the symbol value. That way, when decoding it is
possible to get the number of bits corresponding to the table width from
the bitstream and directly find the symbol value. Longer code still need
to be searched for in the codes list.
2019-04-13 16:24:25 +03:00
Bastien Bouclet
ae9eeb731f COMMON: Rework the BitStream class to improve its performance
* Fixed peekBits not to seek the underlying stream. Seeking can be slow
  when the stream is a file.
* Changed multi-bit  operations to work on multiple bits at once rather
  than iterating over single-bit operations.

This is an almost direct port of a patch for xoreos provided by DrMcCoy.
2019-04-13 16:24:25 +03:00
Thierry Crozat
563520f5c8 TESTS: Reduce error for double precision math test
If we want to properly test the computation is in double precision,
we should be using a much smaller error than the one used for the
single precision tests.
2019-04-12 01:37:59 +01:00
David Fioramonti
322af3e49a TESTS: Use relative difference for math tests
Also add double template variants and use already defined delta
assert macro.
2019-04-11 17:20:00 -07:00
David Fioramonti
cf0e9bfc1b TESTS: further reduce precision for math tests
Since the math is doing subtraction on numbers around 360 and single
precision has about ~7 decimal digits of accuracy we can only
compare numbers to 360.0001 to be safe i'll use 1e-3.
2019-04-11 16:50:07 -07:00
David Fioramonti
9b993aed00 TESTS: reduce precision for math tests
I can't reproduce any precision issues on my machine so this
is only a guess.
2019-04-11 15:59:45 -07:00
David Fioramonti
edb93c4606 TESTS: Use Less than or equal to for math tests
This should fix debian build.

Its seems the precision that debian is using is rounding the
error delta to zero so that the actual error is not less than
this.
2019-04-11 04:35:30 -07:00
David Fioramonti
07f806697d TESTS: Use M_PI for Common math tests
Instead of defining a new variable constant pi we use M_PI.
2019-04-06 20:34:08 -07:00
Jaromir Wysoglad
56397ae457 COMMON: add tests for Common::String
I added tests for firstChar, setChar, insertChar
2019-04-06 15:02:58 +03:00
Jaromir Wysoglad
bf5999044b COMMON: add test for Common::isPunct 2019-04-06 15:02:58 +03:00
Jaromir Wysoglad
b070845a31 COMMON: add 2 tests for common/math.h 2019-04-06 15:02:58 +03:00