#include "test/birdtest.h"
#include "bitops.h"
-#include "bitops.c" /* REMOVE ME */
#define MAX_NUM 1000
#define CHECK_BIT(var,pos) ((var) & (u32)(1<<(pos)))
*/
#include <stdlib.h>
+
#include "test/birdtest.h"
#include "sysdep/config.h"
#include "lib/resource.h"
static void
init_buffer(void)
{
- buffer_pool = NULL;
+ resource_init();
+ buffer_pool = &root_pool;
BUFFER_INIT(buffer, buffer_pool, MAX_NUM);
}
-static void
-free_buffer(void)
-{
- free(buffer_pool);
-}
-
static int
is_buffer_as_expected(buffer_int *b)
{
BUFFER_PUSH(buffer) = expected[i];
is_buffer_as_expected(&buffer);
- free_buffer();
return BT_SUCCESS;
}
BUFFER_PUSH(buffer) = expected[i];
is_buffer_as_expected(&buffer);
- free_buffer();
return BT_SUCCESS;
}
{
int i;
- buffer_pool = NULL;
+ init_buffer();
BUFFER_INIT(buffer, buffer_pool, 0);
fill_expected_array();
is_buffer_as_expected(&buffer);
bt_assert(buffer.size >= MAX_NUM);
- free_buffer();
return BT_SUCCESS;
}
BUFFER_FLUSH(buffer);
bt_assert(buffer.used == 0);
- free_buffer();
return BT_SUCCESS;
}
return bt_end();
}
-
-
-/* Mockup */
-void *
-mb_alloc(pool *UNUSED, uint size) {
- return (void *) malloc(size);
-};
-
-/* Mockup */
-#define STEP_UP(x) ((x) + (x)/2 + 4)
-#define MIN_(a,b) (((a)<(b))?(a):(b))
-#define MIN(a,b) MIN_(a,b)
-void
-buffer_realloc(void **buf, uint *size, uint need, uint item_size)
-{
- uint nsize = MIN(*size, need);
-
- while (nsize < need)
- nsize = STEP_UP(nsize);
-
- *buf = realloc(*buf, nsize * item_size);
- *size = nsize;
-}
#include "test/birdtest.h"
#include "sysdep/config.h"
#include "lib/null.h"
-
-void bug(const char *msg, ...);
#include "lib/checksum.h"
-#include "lib/checksum.c" /* REMOVE ME */
#define MAX_NUM 10000
return bt_end();
}
-
-/* Mockup */
-void
-bug(const char *msg, ...)
-{
- va_list argptr;
- va_start(argptr, msg);
- vfprintf(stderr, msg, argptr);
- va_end(argptr);
- abort();
-}
#include "test/birdtest.h"
-#include "test/birdtest_support.h" /* REMOVE ME */
-
#include "lib/event.h"
+#include "conf/conf.h"
+#include "nest/locks.h"
+#include "lib/unix.h"
+#include "nest/iface.h"
+#include "nest/route.h"
#define MAX_NUM 4
#define schedule_event(num) \
do { \
- struct event *event_##num = ev_new(pool); \
+ struct event *event_##num = ev_new(&root_pool); \
event_##num->hook = event_hook_##num; \
ev_schedule(event_##num); \
} while (0)
int i;
resource_init();
- init_list(&global_event_list);
- struct pool *pool = rp_new(&root_pool, "Test pool");
+ olock_init();
+ io_init();
+ rt_init();
+ if_init();
+ roa_init();
+ config_init();
+ config = config_alloc("");
+
init_event_check_points();
schedule_event(1);
/*
* BIRD Library -- Fletcher-16 checksum Tests
*
- * (c) 2015 Ondrej Zajicek <santiago@crfreenet.org>
* (c) 2015 CZ.NIC z.s.p.o.
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
#include "test/birdtest.h"
-#include "test/birdtest_support.h" /* REMOVE ME */
-
#include "lib/fletcher16.h"
struct in {
#undef LOCAL_DEBUG
#include "test/birdtest.h"
-#include "test/birdtest_support.h" /* REMOVE ME */
-
#include "lib/hash.h"
+#include "nest/bird.h"
struct test_node {
struct test_node *next; /* Hash chain */
*/
#include "test/birdtest.h"
-#include "test/birdtest_support.h" /* REMOVE ME */
-
#include "lib/ip.h"
#define IP4_MAX_LEN 16
#include "test/birdtest.h"
#include "sysdep/config.h"
#include "lib/md5.h"
-#include "lib/md5.c" /* REMOVE ME */
static void
get_md5(const char *str, char (*out_hash)[MD5_HEX_SIZE])
*/
#include "test/birdtest.h"
-#include "test/birdtest_support.h" /* REMOVE ME */
-
-#include "lib/patmatch.c" /* REMOVE ME */
+#include "lib/string.h"
#define MATCH 1
#define NOMATCH 0
#include <stdlib.h>
#include "test/birdtest.h"
-#include "test/birdtest_support.h"
#include "sysdep/config.h"
#include "lib/sha256.h"
-#include "lib/sha256.c" /* REMOVE ME */
static void
#include <stdlib.h>
#include "test/birdtest.h"
-#include "test/birdtest_support.h"
#include "sysdep/config.h"
#include "lib/sha512.h"
-#include "lib/sha512.c" /* REMOVE ME */
static void
byte_to_hex(char *out, const byte *in, uint len)
*/
#include "test/birdtest.h"
-#include "test/birdtest_support.h"
-
#include "lib/slists.h"
-#include "lib/slists.c"
+#include "lib/resource.h"
#define MAX_NUM 1000
+++ /dev/null
-#include "sysdep/config.h"
-#include "lib/event.c" /* REMOVE ME */
-#include "lib/ip.c" /* REMOVE ME */
-#include "lib/resource.c" /* REMOVE ME */
-#include "lib/printf.c" /* REMOVE ME */
-#include "lib/xmalloc.c" /* REMOVE ME */
-#include "lib/bitops.c" /* REMOVE ME */
-
-#define bug(msg, ...) debug("BUG: " msg, ##__VA_ARGS__)
-
-void
-debug(const char *msg, ...)
-{
- va_list argptr;
- va_start(argptr, msg);
- vfprintf(stderr, msg, argptr);
- va_end(argptr);
-};
-
-void
-die(const char *msg, ...)
-{
- va_list argptr;
- va_start(argptr, msg);
- vfprintf(stderr, msg, argptr);
- va_end(argptr);
- exit(3);
-};
-
-void
-io_log_event(void *hook, void *data)
-{
- bt_debug("This is io_log_event mockup. \n");
-};