4 void test_u16(
struct aura_node *n)
6 slog(0, SLOG_INFO, __FUNCTION__);
9 ret =
aura_call(n,
"echo_u16", &retbuf, 0xdead);
11 BUG(n,
"Call failed");
14 BUG(n,
"Unexpected data from buffer");
18 void test_u32(
struct aura_node *n)
20 slog(0, SLOG_INFO, __FUNCTION__);
23 ret =
aura_call(n,
"echo_u32", &retbuf, 0xdeadb00b);
25 BUG(n,
"Call failed");
27 if (out != 0xdeadb00b)
28 BUG(n,
"Unexpected data from buffer");
32 void test_seq(
struct aura_node *n)
34 slog(0, SLOG_INFO, __FUNCTION__);
37 ret =
aura_call(n,
"echo_seq", &retbuf, 0xdeadb00b, 0xdead, 0xde);
39 BUG(n,
"Call failed");
43 if ((out32 != 0xdeadb00b) || (out16 != 0xdead) || (out8 != 0xde)) {
44 aura_hexdump(
"out buffer", retbuf->
data, retbuf->
size);
45 slog(0, SLOG_ERROR,
"===> 0x%x 0x%x 0x%x", out32, (uint32_t) out16, (uint32_t) out8);
46 BUG(n,
"Unexpected data from buffer");
52 void test_bin_32_32(
struct aura_node *n )
54 unsigned char src0[32];
55 unsigned char src1[32];
56 const unsigned char *dst;
60 slog(0, SLOG_INFO, __FUNCTION__);
62 memset(src0, 0xa, 32);
63 memset(src1, 0xb, 32);
65 ret =
aura_call(n,
"echo_bin", &retbuf, src0, src1);
67 BUG(n,
"Call failed!");
71 if (0 != memcmp(src0, dst, 32)) {
72 aura_hexdump(
"retbuf", retbuf->
data, retbuf->
size);
73 BUG(n,
"src0 mismatch");
77 if (0 != memcmp(src1, dst, 32)) {
78 aura_hexdump(
"retbuf", retbuf->
data, retbuf->
size);
79 BUG(n,
"src1 mismatch");
88 struct aura_node *n =
aura_open(
"dummy", NULL);
void aura_wait_status(struct aura_node *node, int status)
uint32_t aura_buffer_get_u32(struct aura_buffer *buf)
Get an unsigned 32 bit integer from aura buffer.
uint16_t aura_buffer_get_u16(struct aura_buffer *buf)
Get an unsigned 16 bit integer from aura buffer.
int aura_call(struct aura_node *node, const char *name, struct aura_buffer **retbuf,...)
uint8_t aura_buffer_get_u8(struct aura_buffer *buf)
Get an unsigned 8 bit integer from aura buffer.
struct aura_node * aura_open(const char *name, const char *opts)
const void * aura_buffer_get_bin(struct aura_buffer *buf, int len)
Get a pointer to the binary data block within buffer and advance internal pointer by len bytes...
void aura_buffer_release(struct aura_buffer *buf)
void aura_close(struct aura_node *node)