FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
testListFolders.c
Go to the documentation of this file.
1 /*********************************************************************
2 Copyright (C) 2011 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 
18 /* cunit includes */
19 #include <CUnit/CUnit.h>
20 #include "delagent.h"
21 #include <string.h>
22 
23 extern char *DBConfFile;
36 {
37  //char *DBConfFile = NULL; /* use default Db.conf */
38  char *ErrorBuf;
39  int rc;
40 
41  pgConn = fo_dbconnect(DBConfFile, &ErrorBuf);
43  rc = listFolders(3, 10);
44  PQfinish(pgConn);
45  CU_ASSERT_EQUAL(rc, 0);
46  CU_PASS("ListFolders PASS!");
47 }
55 {
56  //char *DBConfFile = NULL; /* use default Db.conf */
57  char *ErrorBuf;
58  int rc;
59 
60  pgConn = fo_dbconnect(DBConfFile, &ErrorBuf);
62  rc = listUploads(3, 10);
63 
64  PQfinish(pgConn);
65  CU_ASSERT_EQUAL(rc, 0);
66  CU_PASS("ListUploads PASS!");
67 }
68 
72 CU_TestInfo testcases_ListFolders[] =
73 {
74 #if 0
75 #endif
76 {"Testing the function ListFolders:", testListFolders},
77 {"Testing the function ListUploads:", testListUploads},
78  CU_TEST_INFO_NULL
79 };
80 
PGconn * pgConn
Database connection.
Definition: adj2nest.c:98
void testListFolders()
for function ListFolders
char * DBConfFile
DB conf file location.
Definition: testRun.c:33
void testListUploads()
for function ListUploads
CU_TestInfo testcases_ListFolders[]
testcases for function ListFolders
int listFolders(int userId, int userPerm)
List every folder.
Definition: util.c:843
int listUploads(int userId, int userPerm)
List every upload ID.
Definition: util.c:886
PGconn * fo_dbconnect(char *DBConfFile, char **ErrorBuf)
Connect to a database. The default is Db.conf.
Definition: libfossdb.c:40