aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJason Woodward2007-06-16 06:41:11 +0000
committerJason Woodward2007-06-16 06:41:11 +0000
commit3faba5e19be6cea47ce315e4ee5aca032eea1090 (patch)
tree6febf3e1591b8067bf6913100d67bde979c2b91b /t
parent549fdf52b1b021c0f608e0a5285461f4e5f6d782 (diff)
downloadslapt-get-3faba5e19be6cea47ce315e4ee5aca032eea1090.tar.gz
* added GPG signature verification via gpgme (thanks Pat Volkerding for
adding gpgme to -current) * Updated downloading in libslapt for better notification. This also resulted in some simplification in code. Removed unused DEBUG ifdefs. Removed deprecated translation strings. Added error condition strings and slapt_strerror() function. New translation strings. Bumped to 0.9.12.
Diffstat (limited to 't')
-rw-r--r--t/Makefile3
-rw-r--r--t/test_curl.c24
2 files changed, 14 insertions, 13 deletions
diff --git a/t/Makefile b/t/Makefile
index 6ef5958..dd4df3f 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -1,9 +1,10 @@
TESTOBJS=test.o test_common.o test_configuration.o test_curl.o test_packages.o test_transaction.o
CC=gcc
CURLFLAGS=`curl-config --libs`
+GPGMEFLAGS=`gpgme-config --libs`
DEFINES=
CFLAGS=-W -Werror -Wall -O2 -ansi -pedantic $(DEFINES)
-LDFLAGS=$(CURLFLAGS) -lz
+LDFLAGS=$(CURLFLAGS) $(GPGMEFLAGS) -lz
CHECKFLAGS=`pkg-config --libs check`
test: $(TESTOBJS)
diff --git a/t/test_curl.c b/t/test_curl.c
index 8dd99bc..115c48b 100644
--- a/t/test_curl.c
+++ b/t/test_curl.c
@@ -16,7 +16,7 @@ static int _progress_cb(void *clientp, double dltotal, double dlnow,
START_TEST (test_slapt_get_mirror_data_from_source)
{
FILE *f = NULL;
- int r = -1;
+ const char *err = NULL;
slapt_rc_config *rc = slapt_read_rc_config("./data/rc1");
const char *url = "http://software.jaos.org/slackpacks/10.0/";
char *packages = "PACKAGES.TXT";
@@ -26,23 +26,23 @@ START_TEST (test_slapt_get_mirror_data_from_source)
rc->progress_cb = _progress_cb; /* silence */
f = slapt_open_file("data/PACKAGES.TXT","w+b");
- r = slapt_get_mirror_data_from_source(f, rc, url, packages);
- fail_unless (r == 0);
+ err = slapt_get_mirror_data_from_source(f, rc, url, packages);
+ fail_if (err);
fclose(f);
f = slapt_open_file("data/PACKAGES.TXT.gz","w+b");
- r = slapt_get_mirror_data_from_source(f, rc, url, packages_gz);
- fail_unless (r == 0);
+ err = slapt_get_mirror_data_from_source(f, rc, url, packages_gz);
+ fail_if (err);
fclose(f);
f = slapt_open_file("data/CHECKSUMS.md5","w+b");
- r = slapt_get_mirror_data_from_source(f, rc, url, checksums);
- fail_unless (r == 0);
+ err = slapt_get_mirror_data_from_source(f, rc, url, checksums);
+ fail_if (err);
fclose(f);
f = slapt_open_file("data/CHECKSUMS.md5.gz","w+b");
- r = slapt_get_mirror_data_from_source(f, rc, url, checksums_gz);
- fail_unless (r == 0);
+ err = slapt_get_mirror_data_from_source(f, rc, url, checksums_gz);
+ fail_if (err);
fclose(f);
unlink("data/PACKAGES.TXT");
@@ -57,13 +57,13 @@ END_TEST
START_TEST (test_slapt_download_pkg)
{
- int r = -1;
+ const char *err = NULL;
slapt_rc_config *rc = slapt_read_rc_config("./data/rc1");
rc->progress_cb = _progress_cb; /* silence */
slapt_working_dir_init(rc);
- r = slapt_download_pkg(rc, &pkg);
- fail_unless (r == 0);
+ err = slapt_download_pkg(rc, &pkg);
+ fail_if (err);
slapt_free_rc_config(rc);
}