[tor-commits] [tor/master] Merge remote-tracking branch 'public/bug13661_025'
nickm at torproject.org
nickm at torproject.org
Tue Jan 6 20:16:40 UTC 2015
commit ae9efa863e3cfcdf38a5b4e36570df9effe68dfd
Merge: 90b9e23 fc62721
Author: Nick Mathewson <nickm at torproject.org>
Date: Tue Jan 6 15:16:28 2015 -0500
Merge remote-tracking branch 'public/bug13661_025'
changes/bug13661 | 6 +++++
src/or/routerparse.c | 62 +++++++++++++++++++++++++++++---------------------
src/test/test_dir.c | 36 +++++++++++++++++++++++++++++
3 files changed, 78 insertions(+), 26 deletions(-)
diff --cc src/test/test_dir.c
index 6993389,61484f5..9da44ed
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@@ -805,46 -298,81 +805,82 @@@ test_dir_versions(void *arg
tor_version_t ver1;
/* Try out version parsing functionality */
- test_eq(0, tor_version_parse("0.3.4pre2-cvs", &ver1));
- test_eq(0, ver1.major);
- test_eq(3, ver1.minor);
- test_eq(4, ver1.micro);
- test_eq(VER_PRE, ver1.status);
- test_eq(2, ver1.patchlevel);
- test_eq(0, tor_version_parse("0.3.4rc1", &ver1));
- test_eq(0, ver1.major);
- test_eq(3, ver1.minor);
- test_eq(4, ver1.micro);
- test_eq(VER_RC, ver1.status);
- test_eq(1, ver1.patchlevel);
- test_eq(0, tor_version_parse("1.3.4", &ver1));
- test_eq(1, ver1.major);
- test_eq(3, ver1.minor);
- test_eq(4, ver1.micro);
- test_eq(VER_RELEASE, ver1.status);
- test_eq(0, ver1.patchlevel);
- test_eq(0, tor_version_parse("1.3.4.999", &ver1));
- test_eq(1, ver1.major);
- test_eq(3, ver1.minor);
- test_eq(4, ver1.micro);
- test_eq(VER_RELEASE, ver1.status);
- test_eq(999, ver1.patchlevel);
- test_eq(0, tor_version_parse("0.1.2.4-alpha", &ver1));
- test_eq(0, ver1.major);
- test_eq(1, ver1.minor);
- test_eq(2, ver1.micro);
- test_eq(4, ver1.patchlevel);
- test_eq(VER_RELEASE, ver1.status);
- test_streq("alpha", ver1.status_tag);
- test_eq(0, tor_version_parse("0.1.2.4", &ver1));
- test_eq(0, ver1.major);
- test_eq(1, ver1.minor);
- test_eq(2, ver1.micro);
- test_eq(4, ver1.patchlevel);
- test_eq(VER_RELEASE, ver1.status);
- test_streq("", ver1.status_tag);
+ (void)arg;
+ tt_int_op(0,OP_EQ, tor_version_parse("0.3.4pre2-cvs", &ver1));
+ tt_int_op(0,OP_EQ, ver1.major);
+ tt_int_op(3,OP_EQ, ver1.minor);
+ tt_int_op(4,OP_EQ, ver1.micro);
+ tt_int_op(VER_PRE,OP_EQ, ver1.status);
+ tt_int_op(2,OP_EQ, ver1.patchlevel);
+ tt_int_op(0,OP_EQ, tor_version_parse("0.3.4rc1", &ver1));
+ tt_int_op(0,OP_EQ, ver1.major);
+ tt_int_op(3,OP_EQ, ver1.minor);
+ tt_int_op(4,OP_EQ, ver1.micro);
+ tt_int_op(VER_RC,OP_EQ, ver1.status);
+ tt_int_op(1,OP_EQ, ver1.patchlevel);
+ tt_int_op(0,OP_EQ, tor_version_parse("1.3.4", &ver1));
+ tt_int_op(1,OP_EQ, ver1.major);
+ tt_int_op(3,OP_EQ, ver1.minor);
+ tt_int_op(4,OP_EQ, ver1.micro);
+ tt_int_op(VER_RELEASE,OP_EQ, ver1.status);
+ tt_int_op(0,OP_EQ, ver1.patchlevel);
+ tt_int_op(0,OP_EQ, tor_version_parse("1.3.4.999", &ver1));
+ tt_int_op(1,OP_EQ, ver1.major);
+ tt_int_op(3,OP_EQ, ver1.minor);
+ tt_int_op(4,OP_EQ, ver1.micro);
+ tt_int_op(VER_RELEASE,OP_EQ, ver1.status);
+ tt_int_op(999,OP_EQ, ver1.patchlevel);
+ tt_int_op(0,OP_EQ, tor_version_parse("0.1.2.4-alpha", &ver1));
+ tt_int_op(0,OP_EQ, ver1.major);
+ tt_int_op(1,OP_EQ, ver1.minor);
+ tt_int_op(2,OP_EQ, ver1.micro);
+ tt_int_op(4,OP_EQ, ver1.patchlevel);
+ tt_int_op(VER_RELEASE,OP_EQ, ver1.status);
+ tt_str_op("alpha",OP_EQ, ver1.status_tag);
+ tt_int_op(0,OP_EQ, tor_version_parse("0.1.2.4", &ver1));
+ tt_int_op(0,OP_EQ, ver1.major);
+ tt_int_op(1,OP_EQ, ver1.minor);
+ tt_int_op(2,OP_EQ, ver1.micro);
+ tt_int_op(4,OP_EQ, ver1.patchlevel);
+ tt_int_op(VER_RELEASE,OP_EQ, ver1.status);
+ tt_str_op("",OP_EQ, ver1.status_tag);
+ test_eq(0, tor_version_parse("10.1", &ver1));
+ test_eq(10, ver1.major);
+ test_eq(1, ver1.minor);
+ test_eq(0, ver1.micro);
+ test_eq(0, ver1.patchlevel);
+ test_eq(VER_RELEASE, ver1.status);
+ test_streq("", ver1.status_tag);
+ test_eq(0, tor_version_parse("5.99.999", &ver1));
+ test_eq(5, ver1.major);
+ test_eq(99, ver1.minor);
+ test_eq(999, ver1.micro);
+ test_eq(0, ver1.patchlevel);
+ test_eq(VER_RELEASE, ver1.status);
+ test_streq("", ver1.status_tag);
+ test_eq(0, tor_version_parse("10.1-alpha", &ver1));
+ test_eq(10, ver1.major);
+ test_eq(1, ver1.minor);
+ test_eq(0, ver1.micro);
+ test_eq(0, ver1.patchlevel);
+ test_eq(VER_RELEASE, ver1.status);
+ test_streq("alpha", ver1.status_tag);
+ test_eq(0, tor_version_parse("2.1.700-alpha", &ver1));
+ test_eq(2, ver1.major);
+ test_eq(1, ver1.minor);
+ test_eq(700, ver1.micro);
+ test_eq(0, ver1.patchlevel);
+ test_eq(VER_RELEASE, ver1.status);
+ test_streq("alpha", ver1.status_tag);
+ test_eq(0, tor_version_parse("1.6.8-alpha-dev", &ver1));
+ test_eq(1, ver1.major);
+ test_eq(6, ver1.minor);
+ test_eq(8, ver1.micro);
+ test_eq(0, ver1.patchlevel);
+ test_eq(VER_RELEASE, ver1.status);
+ test_streq("alpha-dev", ver1.status_tag);
+
#define tt_versionstatus_op(vs1, op, vs2) \
tt_assert_test_type(vs1,vs2,#vs1" "#op" "#vs2,version_status_t, \
(val1_ op val2_),"%d",TT_EXIT_TEST_FUNCTION)
More information about the tor-commits
mailing list