DTNMA Reference Tools v2.4.0 - 0.g737f35c
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
Loading...
Searching...
No Matches
test_ari_cbor.c File Reference

Test the cace_ari_cbor.h interfaces. More...

#include <cace/amm/typing.h>
#include <cace/ari/cbor.h>
#include <cace/ari/text.h>
#include <cace/ari/text_util.h>
#include <cace/util/logging.h>
#include <unity.h>
+ Include dependency graph for test_ari_cbor.c:

Macros

#define TEST_CASE(...)
 

Functions

void suiteSetUp (void)
 
int suiteTearDown (int failures)
 
void tearDown (void)
 
static void check_encoding (const cace_ari_t *ari, const char *expect_hex)
 
void test_cace_ari_cbor_encode_lit_prim_undef (void)
 
void test_cace_ari_cbor_encode_lit_prim_null (void)
 
void test_cace_ari_cbor_encode_lit_prim_uint (void)
 
void test_cace_ari_cbor_encode_lit_prim_text_nocopy (void)
 
void test_cace_ari_cbor_encode_lit_prim_text_copy (void)
 
void test_cace_ari_cbor_encode_lit_typed_tp (void)
 
void test_cace_ari_cbor_encode_lit_typed_td (void)
 
void test_cace_ari_cbor_encode_lit_typed_ac_empty (void)
 
void test_cace_ari_cbor_encode_lit_typed_ac_1item (void)
 
void test_cace_ari_cbor_encode_objref_path_text (const char *org_id, const char *model_id, const char *model_rev, bool has_type, cace_ari_type_t type_id, const char *obj_id, const char *expect_hex)
 
void test_cace_ari_cbor_encode_objref_path_int (bool has_org, cace_ari_int_id_t org_id, bool has_model, cace_ari_int_id_t model_id, bool has_type, cace_ari_type_t type_id, bool has_obj, cace_ari_int_id_t obj_id, const char *expect_hex)
 
static void check_decoding (cace_ari_t *ari, const char *inhex)
 
void test_cace_ari_cbor_decode_objref_path_text (const char *hexval, const char *org_id, const char *model_id, const char *model_rev, cace_ari_type_t type_id, const char *obj_id)
 
void test_cace_ari_cbor_decode_objref_path_int (const char *hexval, cace_ari_int_id_t org_id, cace_ari_int_id_t model_id, cace_ari_type_t type_id, cace_ari_int_id_t obj_id)
 
void test_cace_ari_cbor_decode_rptset (const char *hexval, int expect_nonce, time_t expect_tv_sec, long expect_tv_nsec, int expect_reports)
 
void test_cace_ari_cbor_encode_rptset (const char *expect_hexval, int nonce, time_t tv_sec, long tv_nsec)
 
void test_cace_ari_cbor_decode_lit_prim_undef (void)
 
void test_cace_ari_cbor_decode_lit_prim_null (void)
 
void test_cace_ari_cbor_decode_lit_prim_bool (const char *inhex, bool expect)
 
void test_cace_ari_cbor_decode_lit_prim_int64 (const char *inhex, int64_t expect)
 
void test_cace_ari_cbor_decode_lit_prim_uint64 (const char *inhex, uint64_t expect)
 
void test_cace_ari_cbor_decode_lit_prim_float32 (const char *inhex, cace_ari_real32 expect)
 
void test_cace_ari_cbor_decode_lit_prim_float64 (const char *inhex, cace_ari_real64 expect)
 
void test_cace_ari_cbor_decode_lit_prim_tstr (const char *inhex, const char *expect)
 
void test_cace_ari_cbor_decode_lit_prim_bstr (const char *inhex, const char *expect, size_t expect_len)
 
void test_cace_ari_cbor_decode_lit_typed_null (void)
 
void test_cace_ari_cbor_decode_lit_typed_bool (const char *inhex, bool expect)
 
void test_cace_ari_cbor_decode_lit_typed_int64 (const char *inhex, cace_ari_type_t typ, int64_t expect)
 
void test_cace_ari_cbor_decode_lit_typed_real64 (const char *inhex, bool expect)
 
void test_cace_ari_cbor_decode_tp (const char *inhex, time_t expect_sec, long expect_nsec)
 
void test_cace_ari_cbor_decode_failure (const char *inhex)
 
void test_cace_ari_cbor_decode_partial (const char *inhex)
 
void test_cace_ari_cbor_decode_invalid (const char *inhex)
 
void test_cace_ari_cbor_loopback (const char *inhex)
 

Variables

static char * errm = NULL
 Resource cleanup for failure messages.
 

Detailed Description

Test the cace_ari_cbor.h interfaces.

As a shortcut to producing expected binary contents, use commands similar to:

echo "42" | diag2cbor.rb | xxd -i

Macro Definition Documentation

◆ TEST_CASE

#define TEST_CASE (   ...)

Function Documentation

◆ check_decoding()

◆ check_encoding()

◆ suiteSetUp()

void suiteSetUp ( void  )

References cace_openlog().

◆ suiteTearDown()

int suiteTearDown ( int  failures)

References cace_closelog().

◆ tearDown()

void tearDown ( void  )

References CACE_FREE, and errm.

◆ test_cace_ari_cbor_decode_failure()

◆ test_cace_ari_cbor_decode_invalid()

◆ test_cace_ari_cbor_decode_lit_prim_bool()

◆ test_cace_ari_cbor_decode_lit_prim_bstr()

◆ test_cace_ari_cbor_decode_lit_prim_float32()

◆ test_cace_ari_cbor_decode_lit_prim_float64()

◆ test_cace_ari_cbor_decode_lit_prim_int64()

◆ test_cace_ari_cbor_decode_lit_prim_null()

◆ test_cace_ari_cbor_decode_lit_prim_tstr()

◆ test_cace_ari_cbor_decode_lit_prim_uint64()

◆ test_cace_ari_cbor_decode_lit_prim_undef()

◆ test_cace_ari_cbor_decode_lit_typed_bool()

◆ test_cace_ari_cbor_decode_lit_typed_int64()

◆ test_cace_ari_cbor_decode_lit_typed_null()

◆ test_cace_ari_cbor_decode_lit_typed_real64()

◆ test_cace_ari_cbor_decode_objref_path_int()

◆ test_cace_ari_cbor_decode_objref_path_text()

◆ test_cace_ari_cbor_decode_partial()

void test_cace_ari_cbor_decode_partial ( const char *  inhex)

◆ test_cace_ari_cbor_decode_rptset()

void test_cace_ari_cbor_decode_rptset ( const char *  hexval,
int  expect_nonce,
time_t  expect_tv_sec,
long  expect_tv_nsec,
int  expect_reports 
)

◆ test_cace_ari_cbor_decode_tp()

◆ test_cace_ari_cbor_encode_lit_prim_null()

void test_cace_ari_cbor_encode_lit_prim_null ( void  )

◆ test_cace_ari_cbor_encode_lit_prim_text_copy()

void test_cace_ari_cbor_encode_lit_prim_text_copy ( void  )

◆ test_cace_ari_cbor_encode_lit_prim_text_nocopy()

void test_cace_ari_cbor_encode_lit_prim_text_nocopy ( void  )

◆ test_cace_ari_cbor_encode_lit_prim_uint()

void test_cace_ari_cbor_encode_lit_prim_uint ( void  )

◆ test_cace_ari_cbor_encode_lit_prim_undef()

void test_cace_ari_cbor_encode_lit_prim_undef ( void  )

◆ test_cace_ari_cbor_encode_lit_typed_ac_1item()

void test_cace_ari_cbor_encode_lit_typed_ac_1item ( void  )

◆ test_cace_ari_cbor_encode_lit_typed_ac_empty()

void test_cace_ari_cbor_encode_lit_typed_ac_empty ( void  )

◆ test_cace_ari_cbor_encode_lit_typed_td()

void test_cace_ari_cbor_encode_lit_typed_td ( void  )

◆ test_cace_ari_cbor_encode_lit_typed_tp()

void test_cace_ari_cbor_encode_lit_typed_tp ( void  )

◆ test_cace_ari_cbor_encode_objref_path_int()

void test_cace_ari_cbor_encode_objref_path_int ( bool  has_org,
cace_ari_int_id_t  org_id,
bool  has_model,
cace_ari_int_id_t  model_id,
bool  has_type,
cace_ari_type_t  type_id,
bool  has_obj,
cace_ari_int_id_t  obj_id,
const char *  expect_hex 
)

◆ test_cace_ari_cbor_encode_objref_path_text()

void test_cace_ari_cbor_encode_objref_path_text ( const char *  org_id,
const char *  model_id,
const char *  model_rev,
bool  has_type,
cace_ari_type_t  type_id,
const char *  obj_id,
const char *  expect_hex 
)

◆ test_cace_ari_cbor_encode_rptset()

void test_cace_ari_cbor_encode_rptset ( const char *  expect_hexval,
int  nonce,
time_t  tv_sec,
long  tv_nsec 
)

◆ test_cace_ari_cbor_loopback()

Variable Documentation

◆ errm