20 #include "CUnit/CUnit.h" 36 char *pkg =
"../testdata/fossology-1.2.0-1.el5.i386.rpm";
44 rpmReadConfigFiles(NULL, NULL);
49 CU_ASSERT_STRING_EQUAL(pi->
pkgName,
"fossology");
50 CU_ASSERT_STRING_EQUAL(pi->
pkgArch,
"i386");
51 CU_ASSERT_STRING_EQUAL(pi->
version,
"1.2.0");
52 CU_ASSERT_STRING_EQUAL(pi->
license,
"GPLv2");
53 CU_ASSERT_STRING_EQUAL(pi->
group,
"Applications/Engineering");
54 CU_ASSERT_STRING_EQUAL(pi->
release,
"1.el5");
55 CU_ASSERT_STRING_EQUAL(pi->
buildDate,
"Mon Jul 12 03:30:32 2010");
56 CU_ASSERT_STRING_EQUAL(pi->
url,
"http://www.fossology.org");
57 CU_ASSERT_STRING_EQUAL(pi->
sourceRPM,
"fossology-1.2.0-1.el5.src.rpm");
68 CU_ASSERT_EQUAL(Result, predictValue);
79 char *pkg =
"../testdata/fossology_1.4.1.dsc";
83 int predictValue = -1;
87 rpmReadConfigFiles(NULL, NULL);
96 CU_ASSERT_EQUAL(Result, predictValue);
114 int predictValue = -1;
115 rpmReadConfigFiles(NULL, NULL);
128 CU_ASSERT_EQUAL(Result, predictValue);
static int Result
Result of calls.
int GetMetadata(char *pkg, struct rpmpkginfo *pi)
Get RPM package info.
char license[512]
RPM licenses.
char buildDate[128]
Package build date.
char sourceRPM[256]
Package source.
char pkgName[256]
RPM package name.
Holds meta info of rpm packages.
char version[64]
Package version.
char ** requires
Package dependency list.
char pkgArch[64]
Package architecture.
PGconn * db_conn
The connection to Database.
char group[128]
Package group.
char release[64]
Package release.
char url[256]
Package link.
int req_size
Package dependency list size.
PGconn * fo_dbconnect(char *DBConfFile, char **ErrorBuf)
Connect to a database. The default is Db.conf.