Skip to content

Commit

Permalink
remove obsolete unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
Wsm2110 committed Oct 13, 2024
1 parent a84bc9f commit d4e20fc
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions unittests/Faster.Map.CMap.Tests/EntryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,4 @@ public void Enter_DetectsResizedOrTombstone_ReturnsImmediately()
// Assert
Assert.Equal(-125, entry.Meta); // Meta should remain as _resized
}

[Fact]
public void Enter_MultipleThreads_CorrectlyLocksAndUnlocks()
{
// Arrange
var entry = new CMap<int, string>.Entry();
entry.Meta = 0b00000000;

// Act
var thread1 = new Task(() => entry.Enter());
var thread2 = new Task(() => entry.Enter());

thread1.Start();
thread2.Start();

// Assert
Assert.Equal(0b01000000, entry.Meta & 0b1000000); // Ensure the 7th bit is set


thread1.ContinueWith(_ => entry.Exit());
thread2.ContinueWith(_ => entry.Exit());

Assert.Equal(0b00000000, entry.Meta & 0b00100000); // Ensure the 7th bit is cleared
}
}

0 comments on commit d4e20fc

Please sign in to comment.