0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-10-18 18:08:45 +00:00
Commit Graph

9 Commits

Author SHA1 Message Date
Pavel Tvrdík
4fb506466c Birdtest: filter/trie
Thanks to Santiago for reuse here his code.
bt_rand_num() -> bt_random()
2015-08-28 15:56:35 +02:00
Pavel Tvrdík
daaa115943 Birdtest: add some utils to framework
and updates old tests
2015-08-19 14:57:34 +02:00
Pavel Tvrdík
e0176f2639 Birdtest: Clean up unit tests from mock-ups 2015-08-05 12:36:40 +02:00
Pavel Tvrdík
5419d2a3c5 Birdtest: Compability bug fixes
Tested on Ubuntu & FreeBSD & NetBSD & OpenBSD
2015-04-15 15:42:43 +02:00
Pavel Tvrdík
979dc9e65e Birdtest: Refactore some tests
lib/bitops_test.c
lib/ip_test.c
lib/lists_test.c
lib/md5_test.c
2015-04-15 12:11:50 +02:00
Pavel Tvrdík
a84b9c62d1 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
2015-04-13 10:52:21 +02:00
Pavel Tvrdík
947018a7ef Birdtest: bt_test_case() -> bt_test_suite() 2015-04-13 10:42:10 +02:00
Pavel Tvrdík
e7bb2daf1f Birdtest: improve bt_check macro
Now dat for testing can be defined somelike this:

  struct in_out_data_ {
    char *in;
    u32 out;
  } in_out_data[] = {
      {
	  .in  = "192.168.1.128",
	  .out = build_ip4(192, 168, 1, 128),
      },
      {
	  .in  = "255.255.255.255",
	  .out = build_ip4(255, 255, 255, 255),
      },
      ...
  };

  bt_check(ip4_pton_, in_out_data, "%s", "0x%08X");
2015-04-03 12:46:04 +02:00
Pavel Tvrdík
3bbe27472c Birdtest: Add test for lib/bitops.c 2015-03-27 14:10:28 +01:00