11using System ;
2- using System . Runtime . InteropServices ;
32using LightningDB . Comparers ;
43using Shouldly ;
54
@@ -85,19 +84,19 @@ public void signed_integer_comparer_sorts_int32_with_negatives_first()
8584 using var cursor = txn . CreateCursor ( db ) ;
8685
8786 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
88- MemoryMarshal . Read < int > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( - 50 ) ;
87+ cursor . GetCurrent ( ) . key . Read < int > ( ) . ShouldBe ( - 50 ) ;
8988
9089 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
91- MemoryMarshal . Read < int > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( - 10 ) ;
90+ cursor . GetCurrent ( ) . key . Read < int > ( ) . ShouldBe ( - 10 ) ;
9291
9392 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
94- MemoryMarshal . Read < int > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 0 ) ;
93+ cursor . GetCurrent ( ) . key . Read < int > ( ) . ShouldBe ( 0 ) ;
9594
9695 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
97- MemoryMarshal . Read < int > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 50 ) ;
96+ cursor . GetCurrent ( ) . key . Read < int > ( ) . ShouldBe ( 50 ) ;
9897
9998 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
100- MemoryMarshal . Read < int > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 100 ) ;
99+ cursor . GetCurrent ( ) . key . Read < int > ( ) . ShouldBe ( 100 ) ;
101100
102101 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . NotFound ) ;
103102 }
@@ -120,13 +119,13 @@ public void signed_integer_comparer_sorts_int64_with_negatives_first()
120119 using var cursor = txn . CreateCursor ( db ) ;
121120
122121 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
123- MemoryMarshal . Read < long > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( - 10L ) ;
122+ cursor . GetCurrent ( ) . key . Read < long > ( ) . ShouldBe ( - 10L ) ;
124123
125124 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
126- MemoryMarshal . Read < long > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 0L ) ;
125+ cursor . GetCurrent ( ) . key . Read < long > ( ) . ShouldBe ( 0L ) ;
127126
128127 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
129- MemoryMarshal . Read < long > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 50L ) ;
128+ cursor . GetCurrent ( ) . key . Read < long > ( ) . ShouldBe ( 50L ) ;
130129
131130 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . NotFound ) ;
132131 }
@@ -149,13 +148,13 @@ public void reverse_signed_integer_comparer_sorts_descending()
149148 using var cursor = txn . CreateCursor ( db ) ;
150149
151150 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
152- MemoryMarshal . Read < int > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 50 ) ;
151+ cursor . GetCurrent ( ) . key . Read < int > ( ) . ShouldBe ( 50 ) ;
153152
154153 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
155- MemoryMarshal . Read < int > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 0 ) ;
154+ cursor . GetCurrent ( ) . key . Read < int > ( ) . ShouldBe ( 0 ) ;
156155
157156 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
158- MemoryMarshal . Read < int > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( - 10 ) ;
157+ cursor . GetCurrent ( ) . key . Read < int > ( ) . ShouldBe ( - 10 ) ;
159158
160159 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . NotFound ) ;
161160 }
@@ -179,16 +178,16 @@ public void unsigned_integer_comparer_sorts_uint32()
179178 using var cursor = txn . CreateCursor ( db ) ;
180179
181180 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
182- MemoryMarshal . Read < uint > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 0u ) ;
181+ cursor . GetCurrent ( ) . key . Read < uint > ( ) . ShouldBe ( 0u ) ;
183182
184183 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
185- MemoryMarshal . Read < uint > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 50u ) ;
184+ cursor . GetCurrent ( ) . key . Read < uint > ( ) . ShouldBe ( 50u ) ;
186185
187186 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
188- MemoryMarshal . Read < uint > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 100u ) ;
187+ cursor . GetCurrent ( ) . key . Read < uint > ( ) . ShouldBe ( 100u ) ;
189188
190189 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
191- MemoryMarshal . Read < uint > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( uint . MaxValue ) ;
190+ cursor . GetCurrent ( ) . key . Read < uint > ( ) . ShouldBe ( uint . MaxValue ) ;
192191
193192 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . NotFound ) ;
194193 }
@@ -211,13 +210,13 @@ public void unsigned_integer_comparer_sorts_uint64()
211210 using var cursor = txn . CreateCursor ( db ) ;
212211
213212 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
214- MemoryMarshal . Read < ulong > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 0UL ) ;
213+ cursor . GetCurrent ( ) . key . Read < ulong > ( ) . ShouldBe ( 0UL ) ;
215214
216215 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
217- MemoryMarshal . Read < ulong > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 50UL ) ;
216+ cursor . GetCurrent ( ) . key . Read < ulong > ( ) . ShouldBe ( 50UL ) ;
218217
219218 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
220- MemoryMarshal . Read < ulong > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( ulong . MaxValue ) ;
219+ cursor . GetCurrent ( ) . key . Read < ulong > ( ) . ShouldBe ( ulong . MaxValue ) ;
221220
222221 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . NotFound ) ;
223222 }
@@ -240,13 +239,13 @@ public void reverse_unsigned_integer_comparer_sorts_descending()
240239 using var cursor = txn . CreateCursor ( db ) ;
241240
242241 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
243- MemoryMarshal . Read < uint > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 100u ) ;
242+ cursor . GetCurrent ( ) . key . Read < uint > ( ) . ShouldBe ( 100u ) ;
244243
245244 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
246- MemoryMarshal . Read < uint > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 50u ) ;
245+ cursor . GetCurrent ( ) . key . Read < uint > ( ) . ShouldBe ( 50u ) ;
247246
248247 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . Success ) ;
249- MemoryMarshal . Read < uint > ( cursor . GetCurrent ( ) . key . AsSpan ( ) ) . ShouldBe ( 0u ) ;
248+ cursor . GetCurrent ( ) . key . Read < uint > ( ) . ShouldBe ( 0u ) ;
250249
251250 cursor . Next ( ) . Item1 . ShouldBe ( MDBResultCode . NotFound ) ;
252251 }
0 commit comments