I guess the tests might need to be <code> if (h) { assert_string_equal(h, host); } else { assert_int_equal(p, NULL); }</code>, and similar for port, if assert_string_equally really doesn't handle NULL !