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

Unit test for Trim function. More...

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

Go to the source code of this file.

Functions

void test_Trim_normal ()
 Test case for input parameter is normal. More...
 
void test_Trim_str_is_null ()
 Test case for input parameter is null. More...
 
void test_Trim_allspace ()
 Test case for input parameter is all space. More...
 

Variables

CU_TestInfo testcases_Trim []
 testcases for function Trim More...
 

Detailed Description

Unit test for Trim function.

Definition in file testTrim.c.

Function Documentation

◆ test_Trim_allspace()

void test_Trim_allspace ( )

Test case for input parameter is all space.

Test:
  1. Create a string with only spaces
  2. Call trim()
  3. Check if empty string is returned

Definition at line 54 of file testTrim.c.

◆ test_Trim_normal()

void test_Trim_normal ( )

Test case for input parameter is normal.

Test:
  1. Create a string with extra spaces both ends
  2. Call trim()
  3. Check if the extra space were removed

Definition at line 23 of file testTrim.c.

◆ test_Trim_str_is_null()

void test_Trim_str_is_null ( )

Test case for input parameter is null.

Test:
  1. Create an empty string
  2. Call trim()
  3. Check if entry string is returned

Definition at line 39 of file testTrim.c.

Variable Documentation

◆ testcases_Trim

CU_TestInfo testcases_Trim[]
Initial value:
= {
{"Testing Trim, paramters are normal:", test_Trim_normal},
{"Testing Trim, paramter is null:", test_Trim_str_is_null},
{"Testing Trim, paramter is allspace:", test_Trim_allspace},
CU_TEST_INFO_NULL
}
void test_Trim_str_is_null()
Test case for input parameter is null.
Definition: testTrim.c:39
void test_Trim_normal()
Test case for input parameter is normal.
Definition: testTrim.c:23
void test_Trim_allspace()
Test case for input parameter is all space.
Definition: testTrim.c:54

testcases for function Trim

Definition at line 65 of file testTrim.c.