Crinit -- Configurable Rootfs Init
utest-lexers-envset-inner.h File Reference

(2023-10-16, commit: 49337e0)

Header declaring the unit tests for crinitEnvVarInnerLex(). More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void crinitEnvVarInnerLexTestSuccess (void **state)
 
void crinitEnvVarInnerLexTestNullInput (void **state)
 
void crinitEnvVarInnerLexTestLexerError (void **state)
 

Detailed Description

Header declaring the unit tests for crinitEnvVarInnerLex().

Function Documentation

◆ crinitEnvVarInnerLexTestLexerError()

void crinitEnvVarInnerLexTestLexerError ( void **  state)

Tests cases leading to a lexer error (CRINIT_TK_ERR).

For crinitEnvVarInnerLex() that can only happen if the input string starts with a character not allowed in an environment key AND is not an opening double quote.

◆ crinitEnvVarInnerLexTestNullInput()

void crinitEnvVarInnerLexTestNullInput ( void **  state)

Tests detection of NULL pointer inputs.

crinitEnvVarInnerLex() shall fail if any pointer input parameter is NULL and/or the string in *s is NULL.

◆ crinitEnvVarInnerLexTestSuccess()

void crinitEnvVarInnerLexTestSuccess ( void **  state)

Tests successful lex-ing of valid inputs.

All possible return values of crinitEnvVarInnerLex() save for CRINIT_TK_ERR are triggered using accordingly built input strings.