Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_hex.c File Reference
#include "nilorea/n_common.h"
#include "nilorea/n_hex.h"
#include "nilorea/n_log.h"
#include "nilorea/n_str.h"
#include <stdio.h>
#include <string.h>
+ Include dependency graph for ex_hex.c:

Go to the source code of this file.

Functions

static void expect_encode (const unsigned char *data, size_t len, const char *want)
 
int main (int argc, char **argv)
 
void process_args (int argc, char **argv)
 
static void test_decode_errors (void)
 
static void test_decode_roundtrip (void)
 
static void test_encode (void)
 

Variables

static int failures = 0
 

Function Documentation

◆ expect_encode()

static void expect_encode ( const unsigned char *  data,
size_t  len,
const char *  want 
)
static
Examples
ex_hex.c.

Definition at line 69 of file ex_hex.c.

References N_STR::data, failures, free_nstr, LOG_ERR, n_hex_encode(), n_log, and N_STR::written.

Referenced by test_encode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 165 of file ex_hex.c.

References failures, LOG_ERR, LOG_NOTICE, n_log, process_args(), set_log_level(), test_decode_errors(), test_decode_roundtrip(), and test_encode().

+ Here is the call graph for this function:

◆ process_args()

void process_args ( int  argc,
char **  argv 
)

Definition at line 38 of file ex_hex.c.

References LOG_DEBUG, LOG_ERR, LOG_INFO, LOG_NOTICE, LOG_NULL, and set_log_level().

+ Here is the call graph for this function:

◆ test_decode_errors()

static void test_decode_errors ( void  )
static
Examples
ex_hex.c.

Definition at line 135 of file ex_hex.c.

References failures, Free, LOG_ERR, n_hex_decode(), and n_log.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_decode_roundtrip()

static void test_decode_roundtrip ( void  )
static
Examples
ex_hex.c.

Definition at line 96 of file ex_hex.c.

References N_STR::data, failures, Free, free_nstr, LOG_ERR, n_hex_decode(), n_hex_encode(), and n_log.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_encode()

static void test_encode ( void  )
static
Examples
ex_hex.c.

Definition at line 83 of file ex_hex.c.

References expect_encode().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ failures

int failures = 0
static

Definition at line 35 of file ex_hex.c.