convert some asserts to function calls (#4636)

1 file changed