Skip to content

Commit

Permalink
Merge pull request #1779 from vyskocilm/man
Browse files Browse the repository at this point in the history
Problem: zproxy_test does construct variables the hardest way
  • Loading branch information
bluca authored Oct 31, 2017
2 parents 0714722 + 628efab commit f5475cc
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions src/zproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,23 +484,6 @@ zproxy_test (bool verbose)
printf ("\n");

// @selftest

const char *SELFTEST_DIR_RW = "src/selftest-rw";

const char *testbasedir = ".test_zproxy";
const char *testpassfile = "password-file";
const char *testcertfile = "mycert.txt";
char *basedirpath = NULL; // subdir in a test, under SELFTEST_DIR_RW
char *passfilepath = NULL; // pathname to testfile in a test, in dirpath
char *certfilepath = NULL; // pathname to testfile in a test, in dirpath

basedirpath = zsys_sprintf ("%s/%s", SELFTEST_DIR_RW, testbasedir);
assert (basedirpath);
passfilepath = zsys_sprintf ("%s/%s", basedirpath, testpassfile);
assert (passfilepath);
certfilepath = zsys_sprintf ("%s/%s", basedirpath, testcertfile);
assert (certfilepath);

// Create and configure our proxy
zactor_t *proxy = zactor_new (zproxy, NULL);
assert (proxy);
Expand Down Expand Up @@ -600,6 +583,9 @@ zproxy_test (bool verbose)

#if (ZMQ_VERSION_MAJOR == 4)
// Test authentication functionality
const char *basedirpath = "src/selftest-rw/.test_zproxy";
const char *passfilepath = "src/selftest-rw/.test_zproxy/password-file";
const char *certfilepath = "src/selftest-rw/.test_zproxy/mycert.txt";

// Make sure old aborted tests do not hinder us
zdir_t *dir = zdir_new (basedirpath, NULL);
Expand Down Expand Up @@ -797,10 +783,6 @@ zproxy_test (bool verbose)
zsys_dir_delete (basedirpath);
#endif

zstr_free (&passfilepath);
zstr_free (&certfilepath);
zstr_free (&basedirpath);

#if defined (__WINDOWS__)
zsys_shutdown();
#endif
Expand Down

0 comments on commit f5475cc

Please sign in to comment.