Skip to content

Commit e81c09b

Browse files
committed
for unit test
1 parent 1fc3f88 commit e81c09b

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/Box2D.NET/B2Constants.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static class B2Constants
1010
{
1111
// Used to detect bad values. Positions greater than about 16km will have precision
1212
// problems, so 100km as a limit should be fine in all cases.
13-
internal static float B2_HUGE => (100000.0f * b2GetLengthUnitsPerMeter());
13+
public static float B2_HUGE => (100000.0f * b2GetLengthUnitsPerMeter());
1414

1515
// Maximum parallel workers. Used to size some static arrays.
1616
public const int B2_MAX_WORKERS = 64;
@@ -24,15 +24,15 @@ public static class B2Constants
2424
// chosen to be numerically significant, but visually insignificant. In meters.
2525
// Normally this is 0.5cm.
2626
// @warning modifying this can have a significant impact on stability
27-
internal static float B2_LINEAR_SLOP => (0.005f * b2GetLengthUnitsPerMeter());
27+
public static float B2_LINEAR_SLOP => (0.005f * b2GetLengthUnitsPerMeter());
2828

2929
// Maximum number of simultaneous worlds that can be allocated
3030
public const int B2_MAX_WORLDS = 128;
3131

3232
// The maximum rotation of a body per time step. This limit is very large and is used
3333
// to prevent numerical problems. You shouldn't need to adjust this.
3434
// @warning increasing this to 0.5f * b2_pi or greater will break continuous collision.
35-
internal static readonly float B2_MAX_ROTATION = (0.25f * B2MathFunction.B2_PI);
35+
public static readonly float B2_MAX_ROTATION = (0.25f * B2MathFunction.B2_PI);
3636

3737
// Box2D uses limited speculative collision. This reduces jitter.
3838
// Normally this is 2cm.
@@ -46,11 +46,10 @@ public static class B2Constants
4646
// to move by a small amount without triggering a tree adjustment. This is in meters.
4747
// Normally this is 5cm.
4848
// @warning modifying this can have a significant impact on performance
49-
internal static float B2_MAX_AABB_MARGIN => (0.05f * b2GetLengthUnitsPerMeter());
49+
public static float B2_MAX_AABB_MARGIN => (0.05f * b2GetLengthUnitsPerMeter());
5050

5151
// For small objects the margin is limited to this fraction times the maximum extent
52-
internal static readonly float B2_AABB_MARGIN_FRACTION = 0.125f;
53-
52+
public static readonly float B2_AABB_MARGIN_FRACTION = 0.125f;
5453

5554
// The time that a body must be still before it will go to sleep. In seconds.
5655
public const float B2_TIME_TO_SLEEP = 0.5f;
@@ -78,7 +77,6 @@ public static class B2Constants
7877
// Use to validate definitions. Do not take my cookie.
7978
public const int B2_SECRET_COOKIE = 1152023;
8079

81-
8280
// @base
8381
/// Simple djb2 hash function for determinism testing
8482
public const int B2_HASH_INIT = 5381;

test/Box2D.NET.Test/B2DeterminismTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public void MultithreadingTest()
182182
for (int workerCount = 1; workerCount < 6; ++workerCount)
183183
{
184184
int result = SingleMultithreadingTest(workerCount);
185-
Assert.That(result == 0);
185+
Assert.That(result, Is.EqualTo(0));
186186
}
187187
}
188188

@@ -207,8 +207,8 @@ public void CrossPlatformTest()
207207
done = UpdateFallingHinges(worldId, ref data);
208208
}
209209

210-
Assert.That(data.sleepStep == EXPECTED_SLEEP_STEP);
211-
Assert.That(data.hash == EXPECTED_HASH);
210+
Assert.That(data.sleepStep, Is.EqualTo(EXPECTED_SLEEP_STEP));
211+
Assert.That(data.hash, Is.EqualTo(EXPECTED_HASH));
212212

213213
DestroyFallingHinges(ref data);
214214

0 commit comments

Comments
 (0)