1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 05:17:25 +08:00
Commit Graph

420 Commits

Author SHA1 Message Date
Craftplacer
da5853e7eb Create a new BeatmapSetInfo when setting files 2020-08-29 10:25:43 +02:00
smoogipoo
436dbafe57 Fix incorrect comparison for mods of different instances 2020-08-28 22:12:17 +09:00
Bartłomiej Dach
37387d7741 Add assertions to existing test to cover bug 2020-08-27 18:18:30 +02:00
Bartłomiej Dach
9d70b4af09 Add failing test case 2020-08-27 18:06:59 +02:00
Craftplacer
492be0e016 Fix formatting 2020-08-23 15:23:10 +02:00
Craftplacer
e6646b9877 Resolve review comments 2020-08-23 15:08:02 +02:00
Craftplacer
cfd82104db Minor changes and improvements 2020-08-16 01:00:28 +02:00
Craftplacer
434354c44c Properly implement SkinConfiguration equality 2020-08-16 00:21:26 +02:00
Craftplacer
3a6e378a08 Change skin testing 2020-08-15 23:41:53 +02:00
Craftplacer
0e8411f76c Rename fields and make readonly 2020-08-15 22:06:26 +02:00
Craftplacer
c4a7fac760 Add required parameters and other various changes 2020-08-15 22:03:24 +02:00
Craftplacer
69590113d6 Temporary changes 2020-08-12 06:40:21 +02:00
smoogipoo
e87f50f74f Rename method 2020-08-07 22:31:41 +09:00
Dean Herbert
880a127228 Use async overload 2020-06-10 00:08:48 +09:00
smoogipoo
88aed1d504 Merge branch 'master' into update-inspectcode-version 2020-06-09 20:12:39 +09:00
smoogipoo
8a021e0beb Use save method in test 2020-06-08 22:35:01 +09:00
Dean Herbert
b41384dde8
Merge branch 'master' into multiplayer-beatmap-checksum 2020-06-07 18:05:33 +09:00
Dean Herbert
66ec2afe5c Remove broken import test 2020-06-03 23:38:40 +09:00
Dean Herbert
5ed3cd205f Simplify reuse check using FileInfo IDs 2020-06-03 23:35:56 +09:00
Dean Herbert
25160dc220 Fix test name 2020-06-03 19:15:52 +09:00
Dean Herbert
012933545e Add test coverage 2020-06-03 18:33:41 +09:00
smoogipoo
f3b5149648 Move some suggestions to warnings, resolve issues 2020-06-03 16:48:44 +09:00
smoogipoo
dfb9687fb5 Extract update into PreUpdate(), add test 2020-06-02 17:22:09 +09:00
Dean Herbert
0ef971be28 Merge branch 'master' into i-has-curve-with-repeats 2020-05-31 22:30:18 +09:00
Dean Herbert
f989f1aa00 Change event flow to avoid firing store delete events on update 2020-05-27 16:08:47 +09:00
Dean Herbert
6b5b215299 Split out IHasPath from IHasCurve to better define hitobjects 2020-05-26 17:44:47 +09:00
smoogipoo
bc35bc5efb Merge branch 'master' into applydefaults-cancellation 2020-05-25 16:45:30 +09:00
smoogipoo
e5de382760 Merge branch 'master' into storyboard-overlay-layer 2020-05-20 15:08:45 +09:00
Bartłomiej Dach
6e27247cdf Adjust storyboard decoder test in line with changes 2020-05-19 19:47:50 +02:00
Dean Herbert
052ad79fc6 Convert dangerous events to IBindables 2020-05-19 16:44:22 +09:00
smoogipoo
6cd1753459 Add overload to prevent crashes (bosu) 2020-05-15 18:51:44 +09:00
smoogipoo
ca6e6f7496 Add required parameter for android build 2020-05-11 17:26:11 +09:00
Dean Herbert
7f7d5e6617 Fix apparently required argument 2020-05-11 16:37:08 +09:00
Dean Herbert
93440874db Refactor beatmap encoder test to be a bit easier to understand 2020-05-11 16:30:54 +09:00
alex
0e2ccac33b Add spaces to comments 2020-05-04 18:36:24 -07:00
Dean Herbert
31c3fd86b9 Avoid using internal EF methods in tests 2020-04-28 16:22:00 +09:00
Dean Herbert
aaa0f908d5
Merge pull request #8818 from smoogipoo/fix-beatmap-encoder
Fix beatmap encoder by enabling untested test cases
2020-04-22 13:03:56 +09:00
Dean Herbert
360c9f8e38 Add test coverage and handle null creator 2020-04-22 09:19:34 +09:00
smoogipoo
1e7e7417ed Fix testing relying on control point order 2020-04-22 09:04:44 +09:00
smoogipoo
8ea76244a2 Fix only single beatmap being tested 2020-04-22 09:04:44 +09:00
smoogipoo
9713d90388 Always apply beatmap converter/processor 2020-04-22 09:04:44 +09:00
smoogipoo
72fb34f82c Fix overriding control points incorrectly 2020-04-21 14:19:05 +09:00
smoogipoo
41caa37856 Add tests 2020-04-10 13:29:49 +09:00
smoogipoo
ecd7ce4b98 Fix test scene 2020-04-09 21:00:23 +09:00
smoogipoo
ee6ea08cf8 Cleanup handling of hitobject updates 2020-04-09 20:16:44 +09:00
Will Kennedy
877bd7837a Changed variable names 2020-04-02 22:02:57 -04:00
Will Kennedy
c042e709a5 Fix GetDecoder getting fallback decoder too often 2020-04-02 20:43:54 -04:00
Dean Herbert
6d81da5419
Merge branch 'master' into video-offset 2020-03-25 11:28:59 +09:00
Dean Herbert
368bf58521 Rename and make fields readonly 2020-03-25 11:08:08 +09:00
Dean Herbert
729e006c3a
Merge branch 'master' into video-offset 2020-03-21 20:03:46 +09:00
Dean Herbert
370ff70dd4 Fix incorrect host name specification 2020-03-17 18:32:30 +09:00
Dan Balasescu
1d556bfc5f
Merge branch 'master' into video-offset 2020-03-11 15:13:18 +09:00
smoogipoo
7a9c85d69d Fix now failing test due to parsing ranges 2020-03-10 12:21:40 +09:00
voidedWarranties
48282dea8b Remove individual setting to disable videos, fix tests 2020-03-07 22:08:38 -08:00
smoogipoo
363d7d724a Use old ctor params 2020-01-15 14:02:29 +09:00
smoogipoo
0e844b3039 Cleanup / re-protect file store 2020-01-14 19:24:53 +09:00
smoogipoo
4b8d628000 Remove file addition test 2020-01-14 19:24:53 +09:00
smoogipoo
524ff41931 Add more assertions 2020-01-14 19:24:53 +09:00
smoogipoo
b592b6d80d Improve robustness by always creating a new file 2020-01-14 19:24:53 +09:00
smoogipoo
000fc836b2 Remove unused class 2020-01-14 19:24:53 +09:00
smoogipoo
dce93dfe7c Split test 2020-01-14 19:24:53 +09:00
smoogipoo
609102bea3 Initial file updating implementation 2020-01-14 19:24:53 +09:00
smoogipoo
681a43a318 Refactor to support beatmap updates 2020-01-14 19:24:53 +09:00
smoogipoo
6069d98ced Remove generic editor beatmap 2019-12-27 19:39:30 +09:00
Dean Herbert
0677f746aa Provide the ruleset to converter classes 2019-12-24 16:02:16 +09:00
smoogipoo
705cdde148 Fix incorrect test 2019-12-20 16:42:45 +09:00
smoogipoo
c976427206 Refactor test to be more complete 2019-12-13 19:00:28 +09:00
smoogipoo
be000e13e4 Implement initial legacy beatmap encoding support 2019-12-12 18:34:40 +09:00
Huo Yaoyuan
374ef6ff83 Merge branch 'master' into sharpen 2019-11-20 17:30:58 +08:00
Dean Herbert
9f62ec869a Add failing test 2019-11-14 19:38:20 +09:00
Huo Yaoyuan
d60493a961 Use discards. 2019-11-12 20:03:21 +08:00
Huo Yaoyuan
144812669d Use static local functions. 2019-11-12 19:56:54 +08:00
smoogipoo
cf2d885099 Fix control points being flushed too late 2019-10-30 18:02:18 +09:00
Dan Balasescu
514c9f1eef
Merge branch 'master' into bindable-control-points 2019-10-30 16:20:54 +09:00
Dean Herbert
7c6ccce3ba Add tests covering precision case 2019-10-29 18:02:30 +09:00
Dean Herbert
8baf569f59 Remove necessity of AutoGenerated flag 2019-10-25 19:58:42 +09:00
Dan Balasescu
26a33bfa4e
Merge branch 'master' into fix-resume-from-player-audio 2019-10-11 19:21:14 +09:00
Dean Herbert
c7eb0b401b
Merge branch 'master' into ignore-macosx-folder-in-archives 2019-10-11 14:36:52 +09:00
Bartłomiej Dach
11acd177f1 Add import test with files to be filtered out
Add a test case reproducing the conditions encountered "in the wild"
wherein a skin import would be performed incorrectly due to a __MACOSX
resource fork directory present next to a directory with the actual skin
files in the archive.
2019-10-10 23:54:17 +02:00
Bartłomiej Dach
c8ffc134d4 Use nameof when instantiating headless game hosts
As a purely cosmetic code improvement, substitute string literals
in constructor calls of HeadlessGameHost in ImportBeatmapTest for nameof
operator usages.
2019-10-10 22:36:43 +02:00
Bartłomiej Dach
cb1f7e2dc7 Fix platform dependency in buffered reader test
Tests for the line-buffered reader added in 7b1ff38 were subtly
dependent on the execution environment due to differing end-of-line
markers on Windows and Unix-based systems.

Because StreamReader discards all newlines when reading line-by-line,
LineBufferedReader used a StringBuilder to patch the peeked lines
back together with the remaining contents of the file being read.
As StringBuilder.AppendLine uses the environment-specific newline
delimiter, the delimiters after the peeked-but-unconsumed lines can
therefore be substituted by the platform-specific variants, causing
the test failures due to the overly-simplified way they were written.

Reformulate the test to avoid such issues from resurfacing again
by splitting lines by \r or \n and then testing each line individually.
Additionally remove all raw literals in favour of explicitly mixing
various line delimiter character sequences for additional coverage.
2019-10-10 15:33:18 +02:00
Dean Herbert
8df2e359c4 Fix tests on CI 2019-10-10 17:42:15 +09:00
Bartłomiej Dach
76c74719a4 Add test for fallback decoder overwrite
LegacyDifficultyCalculatorBeatmapDecoder was registered as a fallback
decoder in commit ffde389 for future use in the server-side difficulty
calculation components. Due to the pre-existing fallback registrations
this causes a runtime crash when the diffcalc components are started.
Add a test reproducing this scenario to prevent the issue from
resurfacing in the future.
2019-10-04 17:00:51 +02:00
Dean Herbert
9eab56e2fc
Merge branch 'master' into editor-beatmap-changed-event 2019-10-04 17:58:58 +08:00
Dean Herbert
6268bbcfc8
Merge branch 'master' into beatmap-parsing-fallback-v2 2019-10-03 15:12:21 +08:00
smoogipoo
3fb0b0b668 Rename to StartTimeChanged and add xmldocs 2019-10-03 14:37:16 +09:00
smoogipoo
f2719afd0e Add tests for Editorbeatmap 2019-10-03 14:27:40 +09:00
Dean Herbert
a06cb54732
Merge branch 'master' into beatmap-parsing-fallback-v2 2019-09-20 15:28:08 +09:00
Dean Herbert
f306fe27d8 Add test to cover corruption case 2019-09-20 15:05:48 +09:00
Dean Herbert
ddff9882cf Fix importing archives which are nested in a single folder within a zip 2019-09-19 19:11:04 +09:00
Bartłomiej Dach
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
Bartłomiej Dach
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
Bartłomiej Dach
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
Dean Herbert
f925e781a9 Refactor HitWindows for legibility 2019-09-06 15:24:14 +09:00
iiSaLMaN
94b5caf740 Fix build issues 2019-08-23 15:18:56 +03:00
David Zhao
15a592e25e Just assert doesn't throw and don't catch at LegacyDecoder 2019-08-07 19:25:40 +09:00
David Zhao
497d2cb677 shorten tests and rename 2019-08-06 12:35:18 +09:00
David Zhao
2c32d886d7 Add better asserts 2019-08-06 10:39:54 +09:00
David Zhao
b8c38d4dfd remove unnecessary assert 2019-08-06 10:36:26 +09:00
David Zhao
a5c17ae26d Don't use GetDecoder 2019-08-06 10:14:36 +09:00
David Zhao
cd6fe91882 Log error for invalid events 2019-08-06 10:05:21 +09:00
smoogipoo
f2b940f930 Add tests 2019-08-01 17:31:37 +09:00
Dean Herbert
60ea3d4e1a Fix skinning support for combobreak 2019-06-30 21:58:30 +09:00
Dean Herbert
9e1cb90dd8 Remove existing argument for ItemAdded event
For all usages, it looks like this was unnecessary.
2019-06-26 11:40:41 +09:00
Dean Herbert
12aa264657 Consolidate tests and check for file reference counts 2019-06-10 18:35:23 +09:00
Dean Herbert
28b2a516e3 Ensure exception is only thrown once on rollback 2019-06-10 18:13:33 +09:00
Dean Herbert
dcdb806120 Catch newly thrown exception in test 2019-06-10 17:26:56 +09:00
Dean Herbert
5b75060b94 Add test for rollback logic correctly dereferencing files 2019-06-10 16:45:45 +09:00
smoogipoo
f090e292c9 Move ArchiveModelManager import process to async flow 2019-06-10 13:42:22 +09:00
Dean Herbert
58efa7a177
Merge pull request #4729 from peppy/fix-control-point-ordering
Fix control points with same timestamp potentially being parsed incorrectly
2019-05-21 15:33:27 +09:00
smoogipoo
7e38aabe75 Remove equivalence check from controlpoint parsing 2019-05-21 14:27:41 +09:00
smoogipoo
e3ae858c87 Adjust testcase to avoid potential rounding issues 2019-05-21 14:01:41 +09:00
smoogipoo
f1c9073338 Fix commented line check not working with whitespace 2019-05-14 16:16:55 +09:00
smoogipoo
19bc6b72cc More tests to showcase failures 2019-05-14 10:13:42 +09:00
smoogipoo
7aa10956b5 Add unit test 2019-05-14 09:46:42 +09:00
smoogipoo
d7c09e7dbd Merge remote-tracking branch 'origin/master' into fix-new-inspections
# Conflicts:
#	osu.Game.Rulesets.Catch/Judgements/CatchDropletJudgement.cs
#	osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs
#	osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs
#	osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs
#	osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs
#	osu.Game.Tests/Visual/SongSelect/TestCaseBeatmapScoresContainer.cs
#	osu.Game/Graphics/OsuFont.cs
#	osu.Game/Online/API/Requests/Responses/APILegacyScoreInfo.cs
#	osu.Game/Overlays/Profile/Header/BadgeContainer.cs
#	osu.Game/Overlays/Profile/ProfileHeader.cs
#	osu.Game/Screens/Select/PlaySongSelect.cs
#	osu.Game/Skinning/LegacySkinDecoder.cs
2019-05-07 13:20:17 +09:00
smoogipoo
0222424aef Make mods IReadOnlyList<Mod> gamewide
Prevents potential multiple evaluations of enumerable.
2019-04-10 17:20:36 +09:00
smoogipoo
c584967eb1 Remove mods from workingbeatmap 2019-04-09 12:59:32 +09:00
Dean Herbert
c39c37a18d Apply more missed cases 2019-04-01 12:44:46 +09:00
Dean Herbert
4c77899738 Add storyboard ordering test 2019-03-26 16:37:52 +09:00
Dean Herbert
461a0a5038
Merge branch 'master' into remove-unnecessary-code 2019-03-20 10:22:24 +09:00
Dean Herbert
0241148385 Add extensive tests 2019-03-13 11:30:38 +09:00
smoogipoo
00191ca940 Actually set the beatmap difficulty 2019-03-12 15:24:35 +09:00
smoogipoo
059397ac50 Remove unnecessary early return for maching beatmap IDs 2019-03-12 14:40:13 +09:00
Dean Herbert
d0ae75af6e Add tests and fix scenario where all matching are contained by duplicate candidate 2019-03-11 18:13:33 +09:00
Dean Herbert
cfac47413c Disable failing tests temporarily 2019-03-08 10:42:25 +09:00
smoogipoo
a08086cc8a Fix volume not being considered for file samples 2019-03-05 18:21:29 +09:00
Dean Herbert
80737b9ef8 Remove "silent" parameter; consolidate import logic 2019-02-25 18:24:06 +09:00
Dean Herbert
628b3e1119 Move osu-resources to nuget 2019-01-28 18:33:39 +09:00
Dean Herbert
8617aaa2a7 Update licence header (and remove year) 2019-01-24 17:43:03 +09:00
Unknown
6eff79913b remove blank lines 2019-01-11 10:34:56 +01:00
Dean Herbert
c45c34d400 Make beatmap importing possible elsewhere in tests 2018-12-25 19:17:21 +09:00
smoogipoo
eb88768bd0 Fix incorrect controlpoint being applied to samples 2018-12-03 17:21:27 +09:00
smoogipoo
a8ad7d4670 Add silent import parameter 2018-11-30 18:27:13 +09:00
Dean Herbert
10095d09c3 Fix test namespace 2018-11-30 17:02:01 +09:00
Dean Herbert
3727955911 Refactors/renames 2018-11-30 16:35:45 +09:00
Dean Herbert
831cd3ed59 ScoreInfo scoreInfo -> ScoreInfo score 2018-11-30 15:18:52 +09:00
smoogipoo
2bedffc00f Add tests 2018-11-30 14:27:34 +09:00
smoogipoo
a88b69ec43 Notify of existing imports 2018-11-28 20:19:35 +09:00
smoogipoo
f27bd3ef3e OpenTK -> osuTK 2018-11-20 17:14:59 +09:00
smoogipoo
ace1dce281 Merge remote-tracking branch 'origin/master' into fix-slider-samples
# Conflicts:
#	osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs
2018-11-05 18:10:22 +09:00
smoogipoo
92d570342c Fix sample additions not falling back to non-addition bank 2018-11-05 17:35:24 +09:00
smoogipoo
a4caaf56ef Merge remote-tracking branch 'origin/master' into fix-slider-samples
# Conflicts:
#	osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs
#	osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs
#	osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs
#	osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs
#	osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs
#	osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs
2018-11-05 16:38:28 +09:00
smoogipoo
8a2a6a3ecb Preserve the beatmap's version 2018-10-23 14:59:21 +09:00
smoogipoo
47be95ce0b Fix slider nodes using the wrong samples 2018-10-16 17:10:24 +09:00
smoogipoo
cb1703c6e2 Fix colours with alpha components not being parsed 2018-10-05 11:19:01 +09:00
smoogipoo
557a2ee39d Add more comprehensive tests 2018-08-17 10:04:00 +09:00
smoogipoo
05b5144dac Add parsing test 2018-08-15 13:36:22 +09:00
smoogipoo
e360985d73 Replace variables into the entire line 2018-08-14 18:15:09 +09:00
smoogipoo
c087a73f40 Implement per-hitobject custom sample banks 2018-07-20 15:12:44 +09:00