Commit 798be87e by Etienne Samson

tests: rename remote creation test suite

parent b5ae83bf
#include "clar_libgit2.h" #include "clar_libgit2.h"
static git_remote *_remote;
static git_repository *_repo; static git_repository *_repo;
static git_config *_config; static git_config *_config;
static char url[] = "http://github.com/libgit2/libgit2.git"; static char url[] = "http://github.com/libgit2/libgit2.git";
void test_network_remote_createthenload__initialize(void) void test_remote_create__initialize(void)
{ {
cl_fixture_sandbox("testrepo.git"); cl_fixture_sandbox("testrepo.git");
cl_git_pass(git_repository_open(&_repo, "testrepo.git")); cl_git_pass(git_repository_open(&_repo, "testrepo.git"));
cl_git_pass(git_repository_config(&_config, _repo)); cl_git_pass(git_repository_config(&_config, _repo));
cl_git_pass(git_config_set_string(_config, "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*"));
cl_git_pass(git_config_set_string(_config, "remote.origin.url", url));
git_config_free(_config);
cl_git_pass(git_remote_lookup(&_remote, _repo, "origin"));
} }
void test_network_remote_createthenload__cleanup(void) void test_remote_create__cleanup(void)
{ {
git_remote_free(_remote); git_config_free(_config);
_remote = NULL;
git_repository_free(_repo); git_repository_free(_repo);
_repo = NULL; _repo = NULL;
...@@ -30,8 +23,15 @@ void test_network_remote_createthenload__cleanup(void) ...@@ -30,8 +23,15 @@ void test_network_remote_createthenload__cleanup(void)
cl_fixture_cleanup("testrepo.git"); cl_fixture_cleanup("testrepo.git");
} }
void test_network_remote_createthenload__parsing(void) void test_remote_create__manual(void)
{ {
cl_assert_equal_s(git_remote_name(_remote), "origin"); git_remote *remote;
cl_assert_equal_s(git_remote_url(_remote), url); cl_git_pass(git_config_set_string(_config, "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*"));
cl_git_pass(git_config_set_string(_config, "remote.origin.url", url));
cl_git_pass(git_remote_lookup(&remote, _repo, "origin"));
cl_assert_equal_s(git_remote_name(remote), "origin");
cl_assert_equal_s(git_remote_url(remote), url);
git_remote_free(remote);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment