summaryrefslogtreecommitdiff
path: root/src/test/test_dir.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-01-06 15:16:28 -0500
committerNick Mathewson <nickm@torproject.org>2015-01-06 15:16:28 -0500
commitae9efa863e3cfcdf38a5b4e36570df9effe68dfd (patch)
treed905b823a986b1948aa57680387912ff410c6589 /src/test/test_dir.c
parent90b9e23bec4687962a999c2575909b9230bd425a (diff)
parentfc62721b06e3ac231b570741e21dba03b5cadaca (diff)
downloadtor-ae9efa863e3cfcdf38a5b4e36570df9effe68dfd.tar.gz
tor-ae9efa863e3cfcdf38a5b4e36570df9effe68dfd.zip
Merge remote-tracking branch 'public/bug13661_025'
Diffstat (limited to 'src/test/test_dir.c')
-rw-r--r--src/test/test_dir.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index 69933896dd..9da44ed546 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -845,6 +845,42 @@ test_dir_versions(void *arg)
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)