mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixed enum tests
This commit is contained in:
parent
8e8a28b23e
commit
295a46237a
1 changed files with 12 additions and 3 deletions
|
@ -123,7 +123,8 @@ namespace Tests
|
||||||
{
|
{
|
||||||
A,
|
A,
|
||||||
B,
|
B,
|
||||||
C
|
C,
|
||||||
|
D = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -292,11 +293,19 @@ namespace Tests
|
||||||
|
|
||||||
Test.Assert(sizeof(EnumN) == sizeof(System.Interop.c_int));
|
Test.Assert(sizeof(EnumN) == sizeof(System.Interop.c_int));
|
||||||
|
|
||||||
Test.Assert(value.HasFlag(.A) == false);
|
Test.Assert(value.HasFlag(.A) == true);
|
||||||
Test.Assert(value.HasFlag(.B) == true);
|
Test.Assert(value.HasFlag(.B) == true);
|
||||||
|
Test.Assert(value.HasFlag(.B | .C) == false);
|
||||||
|
Test.Assert(value.HasFlag(.D) == false);
|
||||||
Test.Assert(value.Underlying == 1);
|
Test.Assert(value.Underlying == 1);
|
||||||
|
|
||||||
|
value = .B | .C;
|
||||||
|
Test.Assert(value.HasFlag(.A) == true);
|
||||||
|
Test.Assert(value.HasFlag(.B) == true);
|
||||||
|
Test.Assert(value.HasFlag(.B | .C) == true);
|
||||||
|
Test.Assert(value.HasFlag(.D) == false);
|
||||||
|
Test.Assert(value.Underlying == 3);
|
||||||
|
|
||||||
ref System.Interop.c_int valueRef = ref value.UnderlyingRef;
|
ref System.Interop.c_int valueRef = ref value.UnderlyingRef;
|
||||||
valueRef = 2;
|
valueRef = 2;
|
||||||
Test.Assert(value == .C);
|
Test.Assert(value == .C);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue