diff options
author | Ben Straub <bs@github.com> | 2012-11-29 20:47:37 -0800 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2012-11-30 13:12:15 -0800 |
commit | 10711769000d009189f83e468f25b719fa303086 (patch) | |
tree | c34600b31228933e86623e0428ada6436cd5c2f1 /tests-clar/network | |
parent | 79cfa20d60cfdaf578da59cfb4d17551cf1b6256 (diff) | |
download | libgit2-10711769000d009189f83e468f25b719fa303086.tar.gz |
Deploy versioned git_transport structure
Diffstat (limited to 'tests-clar/network')
-rw-r--r-- | tests-clar/network/remotes.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests-clar/network/remotes.c b/tests-clar/network/remotes.c index 14fda1670..17f070470 100644 --- a/tests-clar/network/remotes.c +++ b/tests-clar/network/remotes.c @@ -279,3 +279,23 @@ void test_network_remotes__cannot_load_with_an_empty_url(void) cl_git_fail(git_remote_load(&remote, _repo, "empty-remote-url")); cl_assert(giterr_last()->klass == GITERR_INVALID); } + +void test_network_remotes__check_structure_version(void) +{ + git_transport transport = GIT_TRANSPORT_INIT; + const git_error *err; + + git_remote_free(_remote); + cl_git_pass(git_remote_new(&_remote, _repo, NULL, "test-protocol://localhost", NULL)); + + transport.version = 0; + cl_git_fail(git_remote_set_transport(_remote, &transport)); + err = giterr_last(); + cl_assert_equal_i(GITERR_INVALID, err->klass); + + giterr_clear(); + transport.version = 1024; + cl_git_fail(git_remote_set_transport(_remote, &transport)); + err = giterr_last(); + cl_assert_equal_i(GITERR_INVALID, err->klass); +} |