#include #include /////////////////////////////////////////////////////////////////////////////// int main (int, char**) { cruft::TAP::logger tap; tap.expect_eq (cruft::typeidx (), cruft::typeidx (), "equality for int"); tap.expect_eq (cruft::typeidx (), cruft::typeidx (), "equality for float"); tap.expect_neq (cruft::typeidx (), cruft::typeidx (), "inequality for int/float"); struct tag_a {}; struct tag_b {}; // Register an unequal number of types (that don't include f32) to each // tag before we get to testing in the expectation that will force f32 to // be different in the following tests. cruft::typeidx (); cruft::typeidx (); cruft::typeidx (); cruft::typeidx (); cruft::typeidx (); // We test using f32 rather than int because we're pretty sure it's not // going to have the first index (and hence give us false results) given // int was registered first just above here. tap.expect_neq ( cruft::typeidx (), cruft::typeidx (), "inequality for f32/f32, tag_a" ); tap.expect_neq ( cruft::typeidx (), cruft::typeidx (), "inequality for f32/f32, tag_a/tag_b" ); tap.expect_neq ( cruft::typeidx (), cruft::typeidx (), "equality for f32/f32, tag_a/tag_a" ); return tap.status (); }