FOSSology
4.4.0
Open Source License Compliance by Open Source Software
test_PathCheck.c
Go to the documentation of this file.
1
/*
2
SPDX-FileCopyrightText: © 2012 Hewlett-Packard Development Company, L.P.
3
4
SPDX-License-Identifier: GPL-2.0-only
5
*/
6
#include "run_tests.h"
17
void
testPathCheck
()
18
{
19
char
*DirPath =
"%H%R/!%U"
;
20
char
*NewPath = NULL;
21
char
HostName[1024];
22
char
TmpPath[1024];
23
char
*subs;
24
25
NewPath =
PathCheck
(DirPath);
26
subs = strstr(NewPath,
"!"
);
27
gethostname(HostName,
sizeof
(HostName));
28
29
snprintf(TmpPath,
sizeof
(TmpPath),
"%s%s%s%s"
, HostName,
fo_config_get
(
sysconfig
,
"FOSSOLOGY"
,
"path"
, NULL),
"/"
, subs);
30
FO_ASSERT_STRING_EQUAL(NewPath, TmpPath);
31
}
32
40
void
testUsage
()
41
{
42
Usage
(
"ununpack"
,
"2.0"
);
43
}
44
45
/* ************************************************************************** */
46
/* **** cunit test cases **************************************************** */
47
/* ************************************************************************** */
48
49
CU_TestInfo
PathCheck_testcases
[] =
50
{
51
{
"PathCheck:"
,
testPathCheck
},
52
{
"Usage:"
,
testUsage
},
53
CU_TEST_INFO_NULL
54
};
Usage
Usage()
Print Usage statement.
Definition:
fo_dbcheck.php:63
fo_config_get
char * fo_config_get(fo_conf *conf, const char *group, const char *key, GError **error)
Gets an element based on its group name and key name. If the group or key is not found,...
Definition:
fossconfig.c:336
sysconfig
fo_conf * sysconfig
Definition:
libfossscheduler.c:49
PathCheck_testcases
CU_TestInfo PathCheck_testcases[]
Pacth check test cases.
Definition:
test_PathCheck.c:49
testPathCheck
void testPathCheck()
function PathCheck
Definition:
test_PathCheck.c:17
testUsage
void testUsage()
function Usage
Definition:
test_PathCheck.c:40
PathCheck
char * PathCheck(char *DirPath)
Check if path contains a "%U" or "%H". If so, substitute a unique ID for U.
Definition:
utils.c:1662
src
ununpack
agent_tests
Unit
test_PathCheck.c
Generated on Mon Nov 18 2024 07:37:14 for FOSSology by
1.9.1