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

unit test for GetMetadata function More...

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

Go to the source code of this file.

Functions

void test_GetMetadata_normal ()
 Test pkgagent.c Function GetMetadata() Normal parameter. More...
 
void test_GetMetadata_wrong_testfile ()
 Test pkgagent.c Function GetMetadata() Wrong test file. More...
 
void test_GetMetadata_no_testfile ()
 Test pkgagent.c Function GetMetadata() with No test file. More...
 

Variables

char * DBConfFile
 DB conf file location.
 
CU_TestInfo testcases_GetMetadata []
 testcases for function GetMetadata More...
 

Detailed Description

unit test for GetMetadata function

Definition in file testGetMetadata.c.

Function Documentation

◆ test_GetMetadata_no_testfile()

void test_GetMetadata_no_testfile ( )

Test pkgagent.c Function GetMetadata() with No test file.

Test:
  1. Pass NULL to GetMetadata() for pkg
  2. Function should return -1

Definition at line 94 of file testGetMetadata.c.

◆ test_GetMetadata_normal()

void test_GetMetadata_normal ( )

Test pkgagent.c Function GetMetadata() Normal parameter.

Test:
  1. Load a known RPM package using GetMetadata()
  2. Check if the meta data are parsed properly

Definition at line 23 of file testGetMetadata.c.

◆ test_GetMetadata_wrong_testfile()

void test_GetMetadata_wrong_testfile ( )

Test pkgagent.c Function GetMetadata() Wrong test file.

Test:
  1. Load a Debian package using GetMetadata()
  2. The function should return -1

Definition at line 66 of file testGetMetadata.c.

Variable Documentation

◆ testcases_GetMetadata

CU_TestInfo testcases_GetMetadata[]
Initial value:
= {
{"Testing the function GetMetadata, paramters are normal", test_GetMetadata_normal},
{"Testing the function GetMetadata, test file is not rpm file", test_GetMetadata_wrong_testfile},
{"Testing the function GetMetadata, test file doesn't exist", test_GetMetadata_no_testfile},
CU_TEST_INFO_NULL
}
void test_GetMetadata_no_testfile()
Test pkgagent.c Function GetMetadata() with No test file.
void test_GetMetadata_wrong_testfile()
Test pkgagent.c Function GetMetadata() Wrong test file.
void test_GetMetadata_normal()
Test pkgagent.c Function GetMetadata() Normal parameter.

testcases for function GetMetadata

Definition at line 123 of file testGetMetadata.c.