this should be rather checked with an ASSERT() or REQUIRE() call.