useragent.c 477 Bytes
Newer Older
1
#include "clar_libgit2.h"
2
#include "settings.h"
3 4 5 6

void test_core_useragent__get(void)
{
	const char *custom_name = "super duper git";
7
	git_str buf = GIT_STR_INIT;
8 9 10 11

	cl_assert_equal_p(NULL, git_libgit2__user_agent());
	cl_git_pass(git_libgit2_opts(GIT_OPT_SET_USER_AGENT, custom_name));
	cl_assert_equal_s(custom_name, git_libgit2__user_agent());
12 13 14 15

	cl_git_pass(git_libgit2_opts(GIT_OPT_GET_USER_AGENT, &buf));
	cl_assert_equal_s(custom_name, buf.ptr);

16
	git_str_dispose(&buf);
17
}