Blame tests/core/useragent.c

Packit ae9e2a
#include "clar_libgit2.h"
Packit ae9e2a
#include "global.h"
Packit ae9e2a
Packit ae9e2a
void test_core_useragent__get(void)
Packit ae9e2a
{
Packit ae9e2a
	const char *custom_name = "super duper git";
Packit ae9e2a
	git_buf buf = GIT_BUF_INIT;
Packit ae9e2a
Packit ae9e2a
	cl_assert_equal_p(NULL, git_libgit2__user_agent());
Packit ae9e2a
	cl_git_pass(git_libgit2_opts(GIT_OPT_SET_USER_AGENT, custom_name));
Packit ae9e2a
	cl_assert_equal_s(custom_name, git_libgit2__user_agent());
Packit ae9e2a
Packit ae9e2a
	cl_git_pass(git_libgit2_opts(GIT_OPT_GET_USER_AGENT, &buf));
Packit ae9e2a
	cl_assert_equal_s(custom_name, buf.ptr);
Packit ae9e2a
Packit ae9e2a
	git_buf_free(&buf;;
Packit ae9e2a
}