DTNMA Reference Tools v2.1.0 - 13.gc5c0bac
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
Loading...
Searching...
No Matches
test_ari_text_util.c File Reference

Test the ari_text_util.h interfaces. More...

#include <cace/ari/text_util.h>
#include <unity.h>
#include <string.h>
+ Include dependency graph for test_ari_text_util.c:

Macros

#define TEST_CASE(...)
 

Functions

void test_cace_ari_text_is_identity (const char *text, bool expect)
 
void test_cace_uri_percent_encode_valid (const char *text, const char *safe, const char *expect)
 
void test_cace_uri_percent_decode_valid (const char *text, const char *expect)
 
void test_cace_uri_percent_decode_invalid (const char *text)
 
void test_cace_slash_escape_valid (const char *text, const char quote, const char *expect)
 
void test_cace_slash_unescape_valid (const char *text, const char *expect)
 
void test_cace_slash_unescape_invalid (const char *text)
 
void test_cace_base16_encode (const char *data, size_t data_len, bool uppercase, const char *expect)
 
void test_cace_base16_decode_valid (const char *text, const char *expect, size_t expect_len)
 
void test_cace_base16_decode_invalid (const char *text)
 
 TEST_CASE ("\xc1\x04\xc4\xcf\xb7\x77\x0f\xf0\xbe\xba\xa2\xe9\x5f\xbc\x2c\x18", 16, false, true)
 
void test_cace_base64_decode_valid (const char *text, const char *expect, size_t expect_len)
 
void test_cace_base64_decode_invalid (const char *text)
 
void test_cace_date_encode_valid (int year, int mon, int mday, bool usesep, const char *expect)
 
void test_cace_date_decode_valid (const char *text, int expect_year, int expect_mon, int expect_mday)
 
void test_cace_date_decode_invalid (const char *text)
 
void test_cace_utctime_encode_valid (time_t in_sec, long in_nsec, bool usesep, const char *expect)
 
void test_cace_utctime_decode_valid (const char *text, time_t expect_sec, long expect_nsec)
 
void test_cace_utctime_decode_invalid (const char *text)
 
void test_cace_timeperiod_encode_valid (time_t in_sec, long in_nsec, const char *expect)
 
void test_cace_timeperiod_decode_valid (const char *text, time_t expect_sec, long expect_nsec)
 
void test_cace_timeperiod_decode_invalid (const char *text)
 
void test_cace_ari_float64_encode (double in, char form, const char *expect)
 
void test_cace_decfrac_encode_valid (time_t in_sec, long in_nsec, const char *expect)
 
void test_cace_decfrac_decode_valid (const char *text, time_t expect_sec, long expect_nsec)
 
void test_cace_decfrac_decode_invalid (const char *text)
 

Detailed Description

Test the ari_text_util.h interfaces.

Macro Definition Documentation

◆ TEST_CASE

#define TEST_CASE (   ...)

Function Documentation

◆ test_cace_ari_float64_encode()

void test_cace_ari_float64_encode ( double  in,
char  form,
const char *  expect 
)

◆ test_cace_ari_text_is_identity()

void test_cace_ari_text_is_identity ( const char *  text,
bool  expect 
)

◆ test_cace_base16_decode_invalid()

void test_cace_base16_decode_invalid ( const char *  text)

◆ test_cace_base16_decode_valid()

void test_cace_base16_decode_valid ( const char *  text,
const char *  expect,
size_t  expect_len 
)

◆ test_cace_base16_encode()

void test_cace_base16_encode ( const char *  data,
size_t  data_len,
bool  uppercase,
const char *  expect 
)

◆ test_cace_base64_decode_invalid()

void test_cace_base64_decode_invalid ( const char *  text)

◆ test_cace_base64_decode_valid()

void test_cace_base64_decode_valid ( const char *  text,
const char *  expect,
size_t  expect_len 
)

◆ test_cace_date_decode_invalid()

void test_cace_date_decode_invalid ( const char *  text)

◆ test_cace_date_decode_valid()

void test_cace_date_decode_valid ( const char *  text,
int  expect_year,
int  expect_mon,
int  expect_mday 
)

◆ test_cace_date_encode_valid()

void test_cace_date_encode_valid ( int  year,
int  mon,
int  mday,
bool  usesep,
const char *  expect 
)

References cace_date_encode().

◆ test_cace_decfrac_decode_invalid()

void test_cace_decfrac_decode_invalid ( const char *  text)

◆ test_cace_decfrac_decode_valid()

void test_cace_decfrac_decode_valid ( const char *  text,
time_t  expect_sec,
long  expect_nsec 
)

◆ test_cace_decfrac_encode_valid()

void test_cace_decfrac_encode_valid ( time_t  in_sec,
long  in_nsec,
const char *  expect 
)

References cace_decfrac_encode().

◆ test_cace_slash_escape_valid()

void test_cace_slash_escape_valid ( const char *  text,
const char  quote,
const char *  expect 
)

◆ test_cace_slash_unescape_invalid()

void test_cace_slash_unescape_invalid ( const char *  text)

◆ test_cace_slash_unescape_valid()

void test_cace_slash_unescape_valid ( const char *  text,
const char *  expect 
)

◆ test_cace_timeperiod_decode_invalid()

void test_cace_timeperiod_decode_invalid ( const char *  text)

◆ test_cace_timeperiod_decode_valid()

void test_cace_timeperiod_decode_valid ( const char *  text,
time_t  expect_sec,
long  expect_nsec 
)

◆ test_cace_timeperiod_encode_valid()

void test_cace_timeperiod_encode_valid ( time_t  in_sec,
long  in_nsec,
const char *  expect 
)

◆ test_cace_uri_percent_decode_invalid()

void test_cace_uri_percent_decode_invalid ( const char *  text)

◆ test_cace_uri_percent_decode_valid()

void test_cace_uri_percent_decode_valid ( const char *  text,
const char *  expect 
)

◆ test_cace_uri_percent_encode_valid()

void test_cace_uri_percent_encode_valid ( const char *  text,
const char *  safe,
const char *  expect 
)

◆ test_cace_utctime_decode_invalid()

void test_cace_utctime_decode_invalid ( const char *  text)

◆ test_cace_utctime_decode_valid()

void test_cace_utctime_decode_valid ( const char *  text,
time_t  expect_sec,
long  expect_nsec 
)

◆ test_cace_utctime_encode_valid()

void test_cace_utctime_encode_valid ( time_t  in_sec,
long  in_nsec,
bool  usesep,
const char *  expect 
)

References cace_utctime_encode().

◆ TEST_CASE()

TEST_CASE ( "\xc1\x04\xc4\xcf\xb7\x77\x0f\xf0\xbe\xba\xa2\xe9\x5f\xbc\x2c\x18"  ,
  16,
  false,
  true 
)