diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-06-12 13:38:37 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-08-21 12:31:13 -0400 |
commit | daa0326aaaa85a760be94ee2360cfa61a9fb5be2 (patch) | |
tree | db6484f8eb65fd7cfc02af66f681b21f9cff41b4 /src/or/test.c | |
parent | 978571587a85bebb37ec3cb9c2ea1fde1cecd6d7 (diff) | |
download | tor-daa0326aaaa85a760be94ee2360cfa61a9fb5be2.tar.gz tor-daa0326aaaa85a760be94ee2360cfa61a9fb5be2.zip |
Add the first 8 bytes of the git commit digest to our versions.
Note that unlike subversion revision numbers, it isn't meaningful to
compare these for anything but equality. We define a sort-order anyway,
in case one of these accidentally slips into a recommended-versions
list.
Diffstat (limited to 'src/or/test.c')
-rw-r--r-- | src/or/test.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/or/test.c b/src/or/test.c index db4b6784f4..0f121a84bb 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -5,7 +5,7 @@ /* Ordinarily defined in tor_main.c; this bit is just here to provide one * since we're not linking to tor_main.c */ -const char tor_svn_revision[] = ""; +const char tor_git_revision[] = ""; /** * \file test.c @@ -3212,6 +3212,19 @@ test_dir_format(void) "Tor 0.2.1.0-dev (r99)")); test_eq(1, tor_version_as_new_as("Tor 0.2.1.1", "Tor 0.2.1.0-dev (r99)")); + + /* Now try git revisions */ + test_eq(0, tor_version_parse("0.5.6.7 (git-ff00ff)", &ver1)); + test_eq(0, ver1.major); + test_eq(5, ver1.minor); + test_eq(6, ver1.micro); + test_eq(7, ver1.patchlevel); + test_eq(3, ver1.git_tag_len); + test_memeq(ver1.git_tag, "\xff\x00\xff", 3); + test_eq(-1, tor_version_parse("0.5.6.7 (git-ff00xx)", &ver1)); + test_eq(-1, tor_version_parse("0.5.6.7 (git-ff00fff)", &ver1)); + test_eq(0, tor_version_parse("0.5.6.7 (git ff00fff)", &ver1)); + done: if (r1) routerinfo_free(r1); |