FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
test_IsFunctions.c
Go to the documentation of this file.
1 /*********************************************************************
2 Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 version 2 as published by the Free Software Foundation.
7 
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along
14 with this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 *********************************************************************/
17 #include "run_tests.h"
18 
19 static int Result = 0;
31 {
32  char *Filename = "../testdata/test_1-1.dsc";
33  Result = IsDebianSourceFile(Filename);
34  FO_ASSERT_EQUAL(Result, 1);
35 }
36 
44 {
45  char *Filename = "../testdata/test_1.orig.tar.gz";
46  Result = IsDebianSourceFile(Filename);
47  FO_ASSERT_EQUAL(Result, 0);
48 }
49 
57 {
58  char *Filename = "../testdata/test.exe";
59  Result = IsExe(Filename, 1);
60  FO_ASSERT_EQUAL(Result, 1);
61 }
62 
70 {
71  char *Filename = "../testdata/test_1.orig.tar.gz";
72  Result = IsExe(Filename, 1);
73  FO_ASSERT_EQUAL(Result, 0);
74 }
75 
76 /* ************************************************************************** */
77 /* **** cunit test cases **************************************************** */
78 /* ************************************************************************** */
79 
80 CU_TestInfo IsFunctions_testcases[] =
81 {
82  {"IsDebianSourceFile:", testIsDebianSourceFile},
83  {"IsNotDebianSourceFile:", testIsNotDebianSourceFile},
85  {"IsNotExeFile:", testIsNotExeFile},
86  CU_TEST_INFO_NULL
87 };
static int Result
Result of calls.
Definition: test_CopyFile.c:28
int IsDebianSourceFile(char *Filename)
Read file to see if it is a Debian source file.
Definition: utils.c:743
CU_TestInfo IsFunctions_testcases[]
Isxxx() test cases.
int IsExe(char *Exe, int Quiet)
Check if the executable exists.
Definition: utils.c:404
void testIsNotExeFile()
function IsExe(char *Filename)
void testIsExeFile()
function IsExe(char *Filename)
void testIsDebianSourceFile()
function IsDebianSourceFile(char *Filename)
void testIsNotDebianSourceFile()
function IsDebianSourceFile(char *Filename)
char * Filename
Filename.
Definition: run_tests.c:28