Commit a84b9c62 authored by Pavel Tvrdík's avatar Pavel Tvrdík
Browse files

Birdtest: Add bt_assert_fn_in_*

- Improved test output formating: aligned, colored [ OK ] / [FAIL]
- A failed assert will not interupt the whole test suite
- bt_assert_fn_in_* are macros for testing input and output from the some
  function
parent 947018a7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ t_log2(void)
    in_out_data[i].in  = pow2(i+1);
    in_out_data[i].out = i+1;
  }
  bt_check(u32_log2, in_out_data, "%u", "%u");
  bt_assert_fn_in(u32_log2, in_out_data, "%u", "%u");

  u32_log2(0);

@@ -142,5 +142,5 @@ main(int argc, char *argv[])
  bt_test_suite(t_masklen, "u32_masklen()");
  bt_test_suite(t_log2, "u32_log2()");

  return 0;
  return bt_end();
}
+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ main(int argc, char *argv[])
  bt_test_suite(t_buffer_resize, "Init a small buffer and try overfill");
  bt_test_suite(t_buffer_flush, "Fill and flush all elements");

  return 0;
  return bt_end();
}


+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ main(int argc, char *argv[])
  bt_test_suite(t_calculate, "Checksum of pseudo-random data");
  bt_test_suite(t_verify, "Verification of pseudo-random data.");

  return 0;
  return bt_end();
}

/* Mockup */
+1 −1
Original line number Diff line number Diff line
@@ -72,6 +72,6 @@ main(int argc, char *argv[])

  bt_test_suite(t_ev_run_list, "Schedule and run 3 events in right order.");

  return 0;
  return bt_end();
}
+1 −1
Original line number Diff line number Diff line
@@ -301,5 +301,5 @@ main(int argc, char *argv[])
//bt_test_case(t_walk_delsafe_remove2,	"HASH_WALK_DELSAFE and HASH_REMOVE2. HASH_REMOVE2 is HASH_REMOVE and smart auto-resize function");
  bt_test_suite(t_walk_filter,		"HASH_WALK_FILTER");

  return 0;
  return bt_end();
}
Loading