aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-09-23 17:11:20 +0000
committerNick Mathewson <nickm@torproject.org>2005-09-23 17:11:20 +0000
commit90504803393cfee080e32b2a5fee44b411b57aaa (patch)
treef5301b829bf543cc24b84c919246a2c2df2a8c93
parentfaa4f420de579ca288b8f3134ab76c7e8cd8977d (diff)
downloadtor-90504803393cfee080e32b2a5fee44b411b57aaa.tar
tor-90504803393cfee080e32b2a5fee44b411b57aaa.tar.gz
Fix some compiler warnings
svn:r5124
-rw-r--r--src/or/dirserv.c2
-rw-r--r--src/or/routerlist.c1
-rw-r--r--src/or/test.c34
3 files changed, 20 insertions, 17 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index a52935757..0a9b9ab78 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -364,10 +364,10 @@ int
authdir_wants_to_reject_router(routerinfo_t *ri,
const char **msg)
{
- tor_assert(msg);
/* Okay. Now check whether the fingerprint is recognized. */
router_status_t status = dirserv_router_get_status(ri, msg);
time_t now;
+ tor_assert(msg);
if (status == FP_REJECT)
return -1; /* msg is already set. */
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 79161a4dd..2b5b5fae4 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2553,3 +2553,4 @@ router_reset_descriptor_download_failures(void)
rs->next_attempt_at = 0;
});
}
+
diff --git a/src/or/test.c b/src/or/test.c
index 560bf6ed0..04c269fa1 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -1367,34 +1367,36 @@ test_dir_format(void)
test_eq(IS_NOT_CVS, ver1.cvs);
test_streq("", ver1.status_tag);
+#define test_eq_vs(vs1, vs2) test_eq_type(version_status_t, "%d", (vs1), (vs2))
+
/* make sure tor_version_is_obsolete() works */
- test_eq(VS_OLD, tor_version_is_obsolete("0.0.1", "Tor 0.0.2"));
- test_eq(VS_OLD, tor_version_is_obsolete("0.0.1", "0.0.2, Tor 0.0.3"));
- test_eq(VS_OLD, tor_version_is_obsolete("0.0.1", "0.0.2,Tor 0.0.3"));
- test_eq(VS_OLD, tor_version_is_obsolete("0.0.1", "0.0.3,BetterTor 0.0.1"));
- test_eq(VS_RECOMMENDED,tor_version_is_obsolete("0.0.2", "Tor 0.0.2,Tor 0.0.3"));
- test_eq(VS_NEW_IN_SERIES,
+ test_eq_vs(VS_OLD, tor_version_is_obsolete("0.0.1", "Tor 0.0.2"));
+ test_eq_vs(VS_OLD, tor_version_is_obsolete("0.0.1", "0.0.2, Tor 0.0.3"));
+ test_eq_vs(VS_OLD, tor_version_is_obsolete("0.0.1", "0.0.2,Tor 0.0.3"));
+ test_eq_vs(VS_OLD, tor_version_is_obsolete("0.0.1", "0.0.3,BetterTor 0.0.1"));
+ test_eq_vs(VS_RECOMMENDED,tor_version_is_obsolete("0.0.2", "Tor 0.0.2,Tor 0.0.3"));
+ test_eq_vs(VS_NEW_IN_SERIES,
tor_version_is_obsolete("0.0.2", "Tor 0.0.2pre1,Tor 0.0.3"));
- test_eq(VS_OLD, tor_version_is_obsolete("0.0.2", "Tor 0.0.2.1,Tor 0.0.3"));
- test_eq(VS_NEW, tor_version_is_obsolete("0.1.0", "Tor 0.0.2,Tor 0.0.3"));
- test_eq(VS_RECOMMENDED,
+ test_eq_vs(VS_OLD, tor_version_is_obsolete("0.0.2", "Tor 0.0.2.1,Tor 0.0.3"));
+ test_eq_vs(VS_NEW, tor_version_is_obsolete("0.1.0", "Tor 0.0.2,Tor 0.0.3"));
+ test_eq_vs(VS_RECOMMENDED,
tor_version_is_obsolete("0.0.7rc2", "0.0.7,Tor 0.0.7rc2,Tor 0.0.8"));
- test_eq(VS_OLD, tor_version_is_obsolete("0.0.5.0", "0.0.5.1-cvs"));
- test_eq(VS_NEW_IN_SERIES, tor_version_is_obsolete("0.0.5.1-cvs", "0.0.5"));
+ test_eq_vs(VS_OLD, tor_version_is_obsolete("0.0.5.0", "0.0.5.1-cvs"));
+ test_eq_vs(VS_NEW_IN_SERIES, tor_version_is_obsolete("0.0.5.1-cvs", "0.0.5"));
/* Not on list, but newer than any in same series. */
- test_eq(VS_NEW_IN_SERIES,
+ test_eq_vs(VS_NEW_IN_SERIES,
tor_version_is_obsolete("0.1.0.3", "Tor 0.1.0.2,Tor 0.0.9.5,Tor 0.1.1.0"));
/* Series newer than any on list. */
- test_eq(VS_NEW,
+ test_eq_vs(VS_NEW,
tor_version_is_obsolete("0.1.2.3", "Tor 0.1.0.2,Tor 0.0.9.5,Tor 0.1.1.0"));
/* Series older than any on list. */
- test_eq(VS_OLD,
+ test_eq_vs(VS_OLD,
tor_version_is_obsolete("0.0.1.3", "Tor 0.1.0.2,Tor 0.0.9.5,Tor 0.1.1.0"));
/* Not on list, not newer than any on same series. */
- test_eq(VS_UNRECOMMENDED,
+ test_eq_vs(VS_UNRECOMMENDED,
tor_version_is_obsolete("0.1.0.1", "Tor 0.1.0.2,Tor 0.0.9.5,Tor 0.1.1.0"));
/* On list, not newer than any on same series. */
- test_eq(VS_UNRECOMMENDED,
+ test_eq_vs(VS_UNRECOMMENDED,
tor_version_is_obsolete("0.1.0.1", "Tor 0.1.0.2,Tor 0.0.9.5,Tor 0.1.1.0"));
test_eq(0, tor_version_as_new_as("Tor 0.0.5", "0.0.9pre1-cvs"));