Commit Graph

20 Commits (05b55c4d4349b69026213ce12e1a41af8e87b069)

Author SHA1 Message Date
Peter Nelson b1eb5533eb Add: WindowDesc unit test to validate NWidgetPart lists. 8 months ago
Peter Nelson 1c94fb0389 Add: Mock sprite cache intialization.
This fills up the sprite cache with SPR_OPENTTD_BASE + OPENTTD_SPRITE_COUNT zero-size sprites, to
allow GetSpriteSize() calls to continue from unit-tests.
8 months ago
Peter Nelson 46f63074da Add: MockFontCache for testing GUI code that only needs to know font sizes. 8 months ago
Peter Nelson ce6e739491 Codechange: Add unit-test to check if nested widget parts of properly closed.
Properly closed means exactly one EndContainer for every Container widget.
8 months ago
Peter Nelson e563057478 Add: WindowDesc unit test to validate ini-key value.
ini-key must be present if WWT_DEFSIZEBOX or WWT_STICKYBOX is present.
This was previously enforced by a workflow, however that parsed the source
code with regex which turned out to be error-prone.
8 months ago
Rubidium c6411168d8 Cleanup: missing spaces before continuation * in some comments 8 months ago
Patric Stout ba67f39db6
Codechange: vendor the nlohmann-json library (#11290) 10 months ago
Patric Stout 00f13282a9
Codechange: keep how we convert string <-> JSON private (#11269) 10 months ago
Patric Stout 5f9b8aaa95
Codechange: [Script] use nlohmann for Squirrel <-> JSON conversion (#11251) 10 months ago
Patric Stout 7afd686541
Codechange: add tests for GS <-> AdminPort JSON conversion (#11252)
While at it, fix a bug where booleans were made integers.
10 months ago
Rubidium 6635f809dd Fix #11181: attempting to read string as int triggers assertion 10 months ago
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
12 months ago
Patric Stout 0f3dd9c796
Fix: crash when window can't be placed on low resolution screens. (#10932)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
1 year ago
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 1 year ago
Rubidium 969a3dc0f3 Codechange: introduce generic ClampTo function to clamp to the range of a type 1 year ago
Rubidium b5f96808a1 Fix: FormatArrayAsHex returns gibberish instead of a hex array 1 year ago
Rubidium 4dd5f994be Codechange: replace strncasecmp with case ignoring variant of StrStarts/EndsWith 1 year ago
Rubidium 86786a7af6 Codechange: introduce StrEqualsIgnoreCase/StrCompareIgnoreCase to replace strcasecmp 1 year ago
Rubidium 43a7e54067 Add: unit test functionality using catch2 1 year ago
Rubidium c6ff7dad68 Add: compile time "unit tests" for GetPartialZ consistent 1 year ago