FOSSology  4.4.0
Open Source License Compliance by Open Source Software
testListFolders.c
Go to the documentation of this file.
1 /*
2  SPDX-FileCopyrightText: © 2011 Hewlett-Packard Development Company, L.P.
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
6 
7 /* cunit includes */
8 #include <CUnit/CUnit.h>
9 #include "delagent.h"
10 #include <string.h>
11 
12 extern char *DBConfFile;
25 {
26  //char *DBConfFile = NULL; /* use default Db.conf */
27  char *ErrorBuf;
28  int rc;
29 
30  pgConn = fo_dbconnect(DBConfFile, &ErrorBuf);
32  rc = listFolders(3, 10);
33  PQfinish(pgConn);
34  CU_ASSERT_EQUAL(rc, 0);
35  CU_PASS("ListFolders PASS!");
36 }
44 {
45  //char *DBConfFile = NULL; /* use default Db.conf */
46  char *ErrorBuf;
47  int rc;
48 
49  pgConn = fo_dbconnect(DBConfFile, &ErrorBuf);
51  rc = listUploads(3, 10);
52 
53  PQfinish(pgConn);
54  CU_ASSERT_EQUAL(rc, 0);
55  CU_PASS("ListUploads PASS!");
56 }
57 
61 CU_TestInfo testcases_ListFolders[] =
62 {
63 #if 0
64 #endif
65 {"Testing the function ListFolders:", testListFolders},
66 {"Testing the function ListUploads:", testListUploads},
67  CU_TEST_INFO_NULL
68 };
69 
PGconn * pgConn
Database connection.
Definition: adj2nest.c:86
int listUploads(int userId, int userPerm)
List every upload ID.
Definition: util.c:918
int listFolders(int userId, int userPerm)
List every folder.
Definition: util.c:875
PGconn * fo_dbconnect(char *DBConfFile, char **ErrorBuf)
Connect to a database. The default is Db.conf.
Definition: libfossdb.c:29
void testListUploads()
for function ListUploads
CU_TestInfo testcases_ListFolders[]
testcases for function ListFolders
void testListFolders()
for function ListFolders
char * DBConfFile
DB conf file location.
Definition: testRun.c:21