]> git.proxmox.com Git - libgit2.git/blame - tests/remote/list.c
New upstream version 1.4.3+dfsg.1
[libgit2.git] / tests / remote / list.c
CommitLineData
22a2d3d5
UG
1#include "clar_libgit2.h"
2#include "config/config_helpers.h"
3
4static git_repository *_repo;
5
6#define TEST_URL "http://github.com/libgit2/libgit2.git"
7
8void test_remote_list__initialize(void)
9{
10 _repo = cl_git_sandbox_init("testrepo");
11}
12
13void test_remote_list__cleanup(void)
14{
15 cl_git_sandbox_cleanup();
16}
17
18void test_remote_list__always_checks_disk_config(void)
19{
20 git_repository *repo;
21 git_strarray remotes;
22 git_remote *remote;
23
24 cl_git_pass(git_repository_open(&repo, git_repository_path(_repo)));
25
26 cl_git_pass(git_remote_list(&remotes, _repo));
27 cl_assert_equal_sz(remotes.count, 1);
28 git_strarray_dispose(&remotes);
29
30 cl_git_pass(git_remote_create(&remote, _repo, "valid-name", TEST_URL));
31
32 cl_git_pass(git_remote_list(&remotes, _repo));
33 cl_assert_equal_sz(remotes.count, 2);
34 git_strarray_dispose(&remotes);
35
36 cl_git_pass(git_remote_list(&remotes, repo));
37 cl_assert_equal_sz(remotes.count, 2);
38 git_strarray_dispose(&remotes);
39
40 git_repository_free(repo);
41 git_remote_free(remote);
42}
43