myxce/src/lib/testsuite/test_qobj.c
2026-03-02 12:14:30 +08:00

47 lines
934 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <rtti.h>
#include <unity/unity.h>
#include "qobj.h"
#include "utils.h"
#include "xstring.h"
#include "kvmgr.h"
static void test_queue_create(void)
{
int rc;
kvmgr_params_t params = { .key_type = KVMGR_KEY_STRING,
.nslots = 32,
.delta = 32,
.datakiller = destroy };
var qmgr;
xce_queue_t q1 = { 0 };
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(q);
destroy(qmgr);
xstring_table_fini();
}
void test_qobj(void)
{
printf("\n>> queue obj test\n\n");
RUN_TEST(test_queue_create);
}