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

Birdtest: Compability bug fixes

Tested on Ubuntu & FreeBSD & NetBSD & OpenBSD
parent 2bb3d343
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -19,7 +19,8 @@ t_mkmask(void)
  int i;
  u32 compute, expect;

  for (i = 0; i <= 32; i++)
  bt_assert(u32_mkmask(0) == 0x00000000);
  for (i = 1; i <= 32; i++)
  {
    compute = u32_mkmask(i);
    expect  = (u32) (0xffffffff << (32-i));
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#define _BIRD_BUFFER_H_

#include "lib/resource.h"
#include "sysdep/config.h"

#define BUFFER(type)		struct { type *data; uint used, size; }

+3 −2
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@

#include <stdlib.h>
#include "test/birdtest.h"
#include "sysdep/config.h"
#include "lib/resource.h"
#include "lib/buffer.h"

@@ -24,8 +25,8 @@ show_buf(buffer_int *b)
  int i;
  bt_debug(".used = %d, .size = %d\n", b->used, b->size);

  for (i = 0; i < b->size; i++)
    bt_debug("  .data[%3i] = %-16d  expected %-16d  %s\n", i, b->data[i], expected[i], (b->data[i] == expected[i] ? "OK" : "FAIL!"));
  for (i = 0; i < b->used; i++)
    bt_debug("  .data[%3d] = %-16d  expected %-16d  %s\n", i, b->data[i], expected[i], (b->data[i] == expected[i] ? "OK" : "FAIL!"));
}

static void
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ t_verify(void)

  a[MAX_NUM] = sum;

  bt_assert(ipsum_verify(a, sizeof(a) + sizeof(u32), NULL));
  bt_assert(ipsum_verify(a, sizeof(a), NULL));

  return BT_SUCCESS;
}
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
 */

#include "test/birdtest.h"
#include "sysdep/config.h"
#include "lib/heap.h"

#define MAX_NUM 1000
Loading