]> git.proxmox.com Git - libgit2.git/blob - tests/libgit2/core/useragent.c
New upstream version 1.5.0+ds
[libgit2.git] / tests / libgit2 / core / useragent.c
1 #include "clar_libgit2.h"
2 #include "settings.h"
3
4 void test_core_useragent__get(void)
5 {
6 const char *custom_name = "super duper git";
7 git_str buf = GIT_STR_INIT;
8
9 cl_assert_equal_p(NULL, git_libgit2__user_agent());
10 cl_git_pass(git_libgit2_opts(GIT_OPT_SET_USER_AGENT, custom_name));
11 cl_assert_equal_s(custom_name, git_libgit2__user_agent());
12
13 cl_git_pass(git_libgit2_opts(GIT_OPT_GET_USER_AGENT, &buf));
14 cl_assert_equal_s(custom_name, buf.ptr);
15
16 git_str_dispose(&buf);
17 }