Commit Graph

9240 Commits

Author SHA1 Message Date
73fe402756 Merge branch 'master' into fix-html-unescaping 2019-09-21 12:59:57 +09:00
0d43f4e4f9 Merge remote-tracking branch 'refs/remotes/ppy/master' into beatmap-mod-selector 2019-09-20 23:39:44 +03:00
bbf3ac77f8 Add visual test for HTML string unescaping. 2019-09-20 21:35:26 +02:00
ff2f3cde02 Add test 2019-09-20 19:53:03 +09:00
2bbf4ca4b5 Update LabelledTextBox to use LabelledComponent 2019-09-20 18:50:50 +09:00
e0a97cfac5 Add a LabelledComponent base class 2019-09-20 18:35:15 +09:00
a06cb54732 Merge branch 'master' into beatmap-parsing-fallback-v2 2019-09-20 15:28:08 +09:00
f306fe27d8 Add test to cover corruption case 2019-09-20 15:05:48 +09:00
f10b390ca0 Bump Microsoft.NET.Test.Sdk from 16.2.0 to 16.3.0
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.2.0 to 16.3.0.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v16.2.0...v16.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-19 16:32:39 +00:00
0cf4db899f Few cleanups 2019-09-19 17:03:52 +03:00
efea8be97d Merge remote-tracking branch 'refs/remotes/ppy/master' into beatmap-mod-selector 2019-09-19 17:03:00 +03:00
529a1c3b91 Merge remote-tracking branch 'refs/remotes/ppy/master' into beatmap-mod-selector 2019-09-19 16:46:58 +03:00
41be9b3f8f Add asserts to the test scene 2019-09-19 16:45:38 +03:00
708dfa2bdc Merge remote-tracking branch 'refs/remotes/ppy/master' into page-selector 2019-09-19 16:37:51 +03:00
4e9bb7b121 Merge remote-tracking branch 'upstream/master' into hold-to-press-setting 2019-09-19 22:35:18 +09:00
23c5cb6367 Expand tests to cover new behaviour 2019-09-19 22:35:14 +09:00
0a67d1db1b Merge pull request #5355 from EVAST9919/songselect-best-user-score
Show personal best on song select
2019-09-19 21:17:23 +09:00
50d4206c45 Fix exit scenarios 2019-09-19 20:17:58 +09:00
ddff9882cf Fix importing archives which are nested in a single folder within a zip 2019-09-19 19:11:04 +09:00
2b6c9aeb26 Move top score container to more local namespace 2019-09-19 15:38:40 +09:00
9b35de9ce1 Update tests 2019-09-19 15:23:37 +09:00
a7b6895d4c Revert changes to BeatmapDetailArea 2019-09-19 14:26:15 +09:00
e793854735 Invert BypassFail usage 2019-09-19 08:00:41 +03:00
e5509cd390 Rename test 2019-09-19 13:19:48 +09:00
2e0a85c2f6 Merge remote-tracking branch 'upstream/master' into songselect-best-user-score 2019-09-19 12:57:30 +09:00
3efcf0493c Remove redundant using directive 2019-09-18 23:28:48 +03:00
ea6318ed73 Fix failing test 2019-09-18 23:17:24 +03:00
871adb16e0 Add asserts for fail bypassing 2019-09-18 22:51:03 +03:00
e17cd9e964 Reduce length of tests 2019-09-18 16:14:31 +09:00
77947e8309 Fix rewind tests failing 2019-09-17 22:33:27 +09:00
38d85e44be Merge branch 'master' into key-counter-fixes 2019-09-17 22:33:15 +09:00
9d8eb42ac7 Merge branch 'master' into news-overlay-header 2019-09-16 00:59:18 +09:00
babd34470e Fix DrawableFlag returns empty texture if there's no flag avaliable for needed country 2019-09-15 02:33:21 +03:00
29fcab65f9 Remove superfluous csproj entries 2019-09-15 01:28:07 +02:00
86588778b1 Implement fallback decoder registration
After the preparatory introduction of LineBufferedReader, it is now
possible to introduce registration of fallback decoders that won't drop
input supplied in the first line of the file.

A fallback decoder is used when the magic in the first line of the file
does not match any of the other known decoders. In such a case,
the fallback decoder is constructed and provided a LineBufferedReader
instance. The process of matching magic only peeks the first non-empty
line, so it is available for re-reading in Decode() using ReadLine().

There can be only one fallback decoder per type; a second attempt of
registering a fallback will result in an exception to avoid bugs.

To address the issue of parsing failing on badly or non-headered files,
set the legacy decoders for Beatmaps and Storyboards as the fallbacks.

Due to non-trivial logic, several new, passing unit tests with possible
edge cases also included.
2019-09-15 01:28:07 +02:00
11eda44d34 Migrate decoding to line-buffered reader
Migrate all usages of StreamReader in the context of decoding beatmaps,
storyboards or skins to the new LineBufferedReader.
2019-09-15 01:28:07 +02:00
7b1ff38df7 Implement line-buffered reader
Add a line-buffered reader decorator operating on StreamReader
instances. The decorator has two main operations - PeekLine(), which
allows to see the next line in the stream without consuming it,
ReadLine(), which consumes and returns the next line in the stream, and
ReadToEnd() which reads all the remaining text in the stream (including
the unconsumed peeked line). Peeking line-per-line uses an internal
queue of lines that have been read ahead from the underlying stream.

The addition of the line-buffered reader is a workaround solution to
a problem with decoding. At current selecting a decoder works by
irreversibly reading the first line from the stream and looking for
a magic string that indicates the type of decoder to use.

It might however be possible for a file to be valid in format, just
missing a header. In such a case a lack of a line-buffered reader makes
it impossible to reparse the content of that first line. Introducing it
will however allow to peek the first line for magic first.

 - If magic is found in the first line, GetDecoder() will peek it and
   use it to return the correct Decoder instance. Note that in the case
   of JsonBeatmapDecoder the magic is the opening JSON object brace,
   and therefore must not be consumed.

 - If magic is not found, the fallback decoder will be able to consume
   it using ReadLine() in Decode().

This commit additionally contains basic unit tests for the reader.

Suggested-by: Aergwyn <aergwyn@t-online.de>
2019-09-15 01:26:15 +02:00
2cd3657b5e Merge branch 'master' into beatmap-video 2019-09-13 23:08:57 +09:00
9e53c091a3 Merge pull request #6095 from peppy/fix-test-dummy-api
Fix incorrect DI usage of IAPIProvider in many tests
2019-09-13 22:22:07 +09:00
b10ce0b12d Merge branch 'master' into key-counter-fixes 2019-09-13 19:43:33 +09:00
437e121056 Merge remote-tracking branch 'refs/remotes/ppy/master' into beatmap-video 2019-09-13 13:39:58 +03:00
a7c59098ce Fix missing assignment 2019-09-13 17:38:04 +09:00
7cb79dd760 Fix incorrect DI usage of IAPIProvider in many tests 2019-09-13 17:15:33 +09:00
9a9654dbd1 Fix the Test Scene 2019-09-13 10:59:09 +03:00
c9ae4336f9 Fix RankingsScope test 2019-09-13 10:50:26 +03:00
51f17ccb1b Remove test duplicate 2019-09-13 10:48:02 +03:00
cb98b07e33 Merge master with conflicts resolved 2019-09-13 10:45:01 +03:00
ffd205f470 Merge remote-tracking branch 'upstream/master' into pr/EVAST9919/6076 2019-09-13 16:25:30 +09:00
c4f9be5913 Merge pull request #6093 from smoogipoo:fix-player-restart
Fix player not correctly restarting after an unpause
2019-09-13 16:09:41 +09:00
a05ae2c1b2 Merge remote-tracking branch 'upstream/master' into pr/EVAST9919/6082 2019-09-13 15:53:11 +09:00