Blame tests/core/useragent.c

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