Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a warning and Unity build #3663

Merged
merged 3 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Realm/Realm/Logging/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using System;
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
Expand Down Expand Up @@ -49,6 +50,7 @@ protected override void LogImpl(LogLevel level, LogCategory category, string mes
/// A few built-in implementations are provided by <see cref="Console"/>, <see cref="Null"/>, and <see cref="Function(Action{string})"/>,
/// but you can implement your own.
/// </summary>
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Original logger is deprecated")]
public abstract class RealmLogger
{
private readonly Lazy<GCHandle> _gcHandle;
Expand Down
5 changes: 3 additions & 2 deletions Tests/Realm.Tests/Sync/DataTypeSynchronizationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -902,14 +902,15 @@ public void NestedCollections_Merge()
var list2 = obj1.RealmValueProperty.AsDictionary()["list"].AsList();
var dictionary2 = obj1.RealmValueProperty.AsDictionary()["dictionary"].AsDictionary();

Assert.That(list1, Does.Not.Contain((RealmValue)1));
Assert.That(list1, Does.Not.Contains((RealmValue)1));
Assert.That(list1, Contains.Item((RealmValue)2));
Assert.That(list1, Contains.Item((RealmValue)3));
Assert.That(list1, Contains.Item((RealmValue)4));
Assert.That(list1, Contains.Item((RealmValue)5));
Assert.That(list1, Is.EqualTo(list2).Using(_rvComparer));

Assert.That(dictionary1, Does.Not.ContainKey("key1"));
// Unity Nunit doesn't support Does.Not.ContainKey, so use a more simplistic expression here
Assert.That(dictionary1.ContainsKey("key1"), Is.False);
Assert.That(dictionary1, Contains.Key("key2"));
Assert.That(dictionary1, Contains.Key("key3"));
Assert.That(dictionary1, Is.EqualTo(dictionary2).Using(_rvComparer));
Expand Down
2 changes: 1 addition & 1 deletion Tests/Realm.Tests/Sync/SynchronizedInstanceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ public void SyncLogger_WhenLevelChanges_LogsAtNewLevel()
}

var regex = new Regex("Connection\\[\\d+] Session\\[\\d+]");
var logger = RealmLogger.Function((level, msg) =>
var logger = RealmLogger.Function((level, _, msg) =>
{
if (regex.IsMatch(msg))
{
Expand Down
Loading