forked from ppy/osu-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into bezier-approximation-tensor
- Loading branch information
Showing
82 changed files
with
830 additions
and
611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+148 KB
(100%)
osu.Framework.NativeLibs/runtimes/linux-x64/native/libavcodec.so
Binary file not shown.
Binary file modified
BIN
+28.3 KB
(110%)
osu.Framework.NativeLibs/runtimes/linux-x64/native/libavformat.so
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
osu.Framework.NativeLibs/runtimes/linux-x64/native/libavutil.so
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
osu.Framework.NativeLibs/runtimes/linux-x64/native/libswscale.so
Binary file not shown.
Binary file modified
BIN
+273 KB
(100%)
osu.Framework.NativeLibs/runtimes/osx/native/libavcodec.58.dylib
Binary file not shown.
Binary file modified
BIN
+65.1 KB
(110%)
osu.Framework.NativeLibs/runtimes/osx/native/libavformat.58.dylib
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
osu.Framework.NativeLibs/runtimes/osx/native/libavutil.56.dylib
Binary file not shown.
Binary file modified
BIN
-32 Bytes
(100%)
osu.Framework.NativeLibs/runtimes/osx/native/libswscale.5.dylib
Binary file not shown.
Binary file modified
BIN
+131 KB
(100%)
osu.Framework.NativeLibs/runtimes/win-arm64/native/avcodec-58.dll
Binary file not shown.
Binary file modified
BIN
+32 KB
(110%)
osu.Framework.NativeLibs/runtimes/win-arm64/native/avformat-58.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
osu.Framework.NativeLibs/runtimes/win-arm64/native/avutil-56.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
osu.Framework.NativeLibs/runtimes/win-arm64/native/swscale-5.dll
Binary file not shown.
Binary file modified
BIN
+152 KB
(100%)
osu.Framework.NativeLibs/runtimes/win-x64/native/avcodec-58.dll
Binary file not shown.
Binary file modified
BIN
+37.5 KB
(110%)
osu.Framework.NativeLibs/runtimes/win-x64/native/avformat-58.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
osu.Framework.NativeLibs/runtimes/win-x64/native/avutil-56.dll
Binary file not shown.
Binary file modified
BIN
+512 Bytes
(100%)
osu.Framework.NativeLibs/runtimes/win-x64/native/swscale-5.dll
Binary file not shown.
Binary file modified
BIN
+156 KB
(100%)
osu.Framework.NativeLibs/runtimes/win-x86/native/avcodec-58.dll
Binary file not shown.
Binary file modified
BIN
+39.5 KB
(110%)
osu.Framework.NativeLibs/runtimes/win-x86/native/avformat-58.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
osu.Framework.NativeLibs/runtimes/win-x86/native/avutil-56.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
osu.Framework.NativeLibs/runtimes/win-x86/native/swscale-5.dll
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Globalization; | ||
using NUnit.Framework; | ||
using osu.Framework.Bindables; | ||
|
||
|
@@ -26,7 +27,7 @@ public void TestSet(bool value) | |
public void TestParsingString(string value, bool expected) | ||
{ | ||
var bindable = new BindableBool(); | ||
bindable.Parse(value); | ||
bindable.Parse(value, CultureInfo.InvariantCulture); | ||
|
||
Assert.AreEqual(expected, bindable.Value); | ||
} | ||
|
@@ -36,7 +37,7 @@ public void TestParsingString(string value, bool expected) | |
public void TestParsingBoolean(bool value) | ||
{ | ||
var bindable = new BindableBool(); | ||
bindable.Parse(value); | ||
bindable.Parse(value, CultureInfo.InvariantCulture); | ||
|
||
Assert.AreEqual(value, bindable.Value); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Globalization; | ||
using NUnit.Framework; | ||
using osu.Framework.Bindables; | ||
using osu.Framework.Graphics; | ||
|
@@ -41,7 +42,7 @@ public void TestSet(byte r, byte g, byte b, byte a) | |
public void TestParsingString(string value, Colour4 expected) | ||
{ | ||
var bindable = new BindableColour4(); | ||
bindable.Parse(value); | ||
bindable.Parse(value, CultureInfo.InvariantCulture); | ||
|
||
Assert.AreEqual(expected, bindable.Value); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Globalization; | ||
using NUnit.Framework; | ||
using osu.Framework.Bindables; | ||
using osu.Framework.Utils; | ||
|
||
namespace osu.Framework.Tests.Bindables | ||
{ | ||
|
@@ -53,7 +55,7 @@ public void TestDefaultCheck(double value, double def, double? precision = null) | |
public void TestParsingString(string value, double expected) | ||
{ | ||
var bindable = new BindableDouble(); | ||
bindable.Parse(value); | ||
bindable.Parse(value, CultureInfo.InvariantCulture); | ||
|
||
Assert.AreEqual(expected, bindable.Value); | ||
} | ||
|
@@ -66,7 +68,7 @@ public void TestParsingString(string value, double expected) | |
public void TestParsingStringWithRange(string value, double minValue, double maxValue, double expected) | ||
{ | ||
var bindable = new BindableDouble { MinValue = minValue, MaxValue = maxValue }; | ||
bindable.Parse(value); | ||
bindable.Parse(value, CultureInfo.InvariantCulture); | ||
|
||
Assert.AreEqual(expected, bindable.Value); | ||
} | ||
|
@@ -81,7 +83,7 @@ public void TestParsingStringWithRange(string value, double minValue, double max | |
public void TestParsingDouble(double value) | ||
{ | ||
var bindable = new BindableDouble(); | ||
bindable.Parse(value); | ||
bindable.Parse(value, CultureInfo.InvariantCulture); | ||
|
||
Assert.AreEqual(value, bindable.Value); | ||
} | ||
|
@@ -98,5 +100,35 @@ public void TestPropagationToPlainBindable() | |
number.MinValue = 0; | ||
number.MaxValue = 10; | ||
} | ||
|
||
[TestCase("1.4", "en-US", 1.4)] | ||
[TestCase("1,4", "de-DE", 1.4)] | ||
[TestCase("1.400,01", "de-DE", 1400.01)] | ||
[TestCase("1 234,57", "ru-RU", 1234.57)] | ||
[TestCase("1,094", "fr-FR", 1.094)] | ||
[TestCase("1,400.01", "zh-CN", 1400.01)] | ||
public void TestParsingStringLocale(string value, string locale, double expected) | ||
{ | ||
var bindable = new BindableDouble(); | ||
bindable.Parse(value, CultureInfo.GetCultureInfo(locale)); | ||
Assert.AreEqual(expected, bindable.Value); | ||
} | ||
|
||
[TestCase(1.4, "en-US", "1.4")] | ||
[TestCase(1.4, "de-DE", "1,4")] | ||
[TestCase(1400.01, "de-DE", "1400,01")] | ||
[TestCase(1234.57, "ru-RU", "1234,57")] | ||
[TestCase(1.094, "fr-FR", "1,094")] | ||
[TestCase(1400.01, "zh-CN", "1400.01")] | ||
public void TestParsingNumberLocale(double value, string locale, string expected) | ||
{ | ||
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo(locale); | ||
|
||
var bindable = new BindableDouble(value); | ||
string? asString = bindable.ToString(); | ||
Assert.AreEqual(expected, asString); | ||
Assert.DoesNotThrow(() => bindable.Parse(asString, CultureInfo.CurrentCulture)); | ||
Assert.AreEqual(value, bindable.Value, Precision.DOUBLE_EPSILON); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.