File: useragent.c

package info (click to toggle)
libgit2 0.27.7%2Bdfsg.1-0.2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 31,400 kB
  • sloc: ansic: 157,824; sh: 406; python: 182; php: 65; makefile: 61
file content (17 lines) | stat: -rw-r--r-- 472 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "clar_libgit2.h"
#include "global.h"

void test_core_useragent__get(void)
{
	const char *custom_name = "super duper git";
	git_buf buf = GIT_BUF_INIT;

	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());

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

	git_buf_free(&buf);
}