makepad/libs/box3d/tests/test_id.rs
Admin 848e715c6c box3d: pure Rust port of Box3D (erincatto/box3d @ 29bf523)
Full engine port in libs/box3d: math, geometry, GJK/TOI, hull builder,
dynamic tree, manifolds, constraint graph, solver (serial, scalar SIMD
path), all 8 joint types, sensors, mover, world API. 147 ported C unit
tests green in debug and release. See libs/box3d/README.md for the
upstream revision and sync notes, PORTING.md for conventions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 16:06:18 +02:00

27 lines
474 B
Rust

// Port of box3d/test/test_id.c
use makepad_box3d::ensure;
use makepad_box3d::id::*;
#[test]
fn id_test() {
let x: u64 = 0x0123456789ABCDEF;
{
let id = load_body_id(x);
let y = store_body_id(id);
ensure!(x == y);
}
{
let id = load_shape_id(x);
let y = store_shape_id(id);
ensure!(x == y);
}
{
let id = load_joint_id(x);
let y = store_joint_id(id);
ensure!(x == y);
}
}