FOSSology  4.4.0
Open Source License Compliance by Open Source Software
testGetFieldValue.c File Reference

unit test for GetFieldValue function More...

#include <stdio.h>
#include "CUnit/CUnit.h"
#include <pkgagent.h>
Include dependency graph for testGetFieldValue.c:

Go to the source code of this file.

Functions

void test_GetFieldValue_normal ()
 test case for input parameter is normal More...
 
void test_GetFieldValue_sin_is_null ()
 test case for input parameter is NULL More...
 
void test_GetFieldValue_noseparator ()
 test case for don't set input separator More...
 

Variables

CU_TestInfo testcases_GetFieldValue []
 testcases for function GetFieldValue More...
 

Detailed Description

unit test for GetFieldValue function

Definition in file testGetFieldValue.c.

Function Documentation

◆ test_GetFieldValue_normal()

void test_GetFieldValue_normal ( )

test case for input parameter is normal

Test:
  1. Create a string with field=value format
  2. Call GetFieldValue() with a separator
  3. Check if the value string is parsed properly

Definition at line 26 of file testGetFieldValue.c.

◆ test_GetFieldValue_noseparator()

void test_GetFieldValue_noseparator ( )

test case for don't set input separator

Test:
  1. Create a string with field=value format
  2. Call GetFieldValue() with separator as NULL
  3. Check if field and value are not separated

Definition at line 68 of file testGetFieldValue.c.

◆ test_GetFieldValue_sin_is_null()

void test_GetFieldValue_sin_is_null ( )

test case for input parameter is NULL

Test:
  1. Create an empty string
  2. Pass to GetFieldValue()
  3. Check if value string returned is NULL

Definition at line 47 of file testGetFieldValue.c.

Variable Documentation

◆ testcases_GetFieldValue

CU_TestInfo testcases_GetFieldValue[]
Initial value:
= {
{"Testing GetFieldValue, paramters are normal:", test_GetFieldValue_normal},
{"Testing GetFieldValue, no separator:", test_GetFieldValue_noseparator},
{"Testing GetFieldValue,sin is null:", test_GetFieldValue_sin_is_null},
CU_TEST_INFO_NULL
}
void test_GetFieldValue_sin_is_null()
test case for input parameter is NULL
void test_GetFieldValue_noseparator()
test case for don't set input separator
void test_GetFieldValue_normal()
test case for input parameter is normal

testcases for function GetFieldValue

Definition at line 87 of file testGetFieldValue.c.