fix C compiler warning in tests
simplify comparison in test