myxce/src/lib/testsuite/test_qobj.c
2026-03-06 18:20:30 +08:00

49 lines
1.1 KiB
C

#include <rtti.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unity/unity.h>
#include "kvmgr.h"
#include "qobj.h"
#include "utils.h"
#include "xstring.h"
static void test_queue_create(void)
{
int rc;
kvmgr_params_t params = { .key_type = KVMGR_KEY_STRING,
.nslots = 32,
.delta = 32,
.datakiller = dereference };
var qmgr;
xce_queue_t q1 = { .queue = "xce",
.resreq = "type == any",
.pre_exec = NULL,
.post_exec = NULL,
.autopscaler = NULL };
queue_t* q = NULL;
rc = xstring_table_init(32);
TEST_ASSERT_TRUE(rc >= 0);
qmgr = makeInstance(&xkvmgr_type, &params);
TEST_ASSERT_TRUE(qmgr != NULL);
q = makeQueue(qmgr, &q1);
TEST_ASSERT_TRUE(q != NULL);
destroy(qmgr);
xstring_table_fini();
}
void test_qobj(void)
{
printf("\n>> queue obj test\n\n");
RUN_TEST(test_queue_create);
}