test_qstrings.c 283 B

123456789101112131415161718192021
  1. #include <stddef.h>
  2. #include <assert.h>
  3. #include "qstrings.h"
  4. void test_is_vzero(void)
  5. {
  6. const char *v = "\x0\x0\x0\x1\x0\x1";
  7. assert(is_vzero(v, 3));
  8. assert(!is_vzero(v, 4));
  9. assert(!is_vzero(v, 6));
  10. }
  11. int main(int argc, char **argv)
  12. {
  13. test_is_vzero();
  14. return 0;
  15. }