// File: /workspace/github_c_makefile_star2_O2/DeforaOS[P]libSystem/tests/config.c
// Function: test
static int _test(char const * progname, String const * filename,
		String const * variable, String const * expected)
{
	int ret = 0;
	Config * config;
	String const * value;

	if((config = config_new()) == NULL)
		return -error_print(progname);
	/* config_load */
	printf("%s: Testing %s \"%s\"\n", progname, "config_load()", filename);
	fflush(stdout);
	if(config_load(config, filename) != 0)
	{
		config_delete(config);
		return -error_print(progname);
	}
	/* config_get */
	printf("%s: Testing %s\n", progname, "config_get()");
	fflush(stdout);
	if(config_get(config, NULL, "nonexistent") != NULL)
		ret = -error_set_print(progname, 1, "%s",
				"Unknown variable returned");
	if((value = config_get(config, NULL, variable)) == NULL)
		ret = -error_print(progname);
	else if(string_compare(expected, value) != 0)
		ret = -error_set_print(progname, 1, "%s: %s (\"%s\")", expected,
				"Invalid variable returned", value);
	/* config_set */
	printf("%s: Testing %s\n", progname, "config_set()");
	/* config_set: remove the variable */
	if(config_set(config, NULL, variable, NULL) != 0)
		ret = -error_print(progname);
	if((value = config_get(config, NULL, variable)) != NULL)
		ret = -error_set_print(progname, 1, "%s: %s (\"%s\")", "NULL",
				"Invalid variable returned", value);
	/* config_set: restore the variable */
	if(config_set(config, NULL, variable, expected) != 0)
		ret = -error_print(progname);
	if((value = config_get(config, NULL, variable)) == NULL)
		ret = -error_print(progname);
	else if(string_compare(expected, value) != 0)
		ret = -error_set_print(progname, 1, "%s: %s (\"%s\")", expected,
				"Invalid variable returned", value);
	/* config_set: empty the variable */
	if(config_set(config, NULL, variable, "") != 0)
		ret = -error_print(progname);
	if((value = config_get(config, NULL, variable)) == NULL
			|| string_get_length(value) != 0)
		ret = -error_set_print(progname, 1, "%s (\"%s\")",
				"Invalid variable returned", value);
	/* config_set: restore the variable */
	if(config_set(config, NULL, variable, expected) != 0)
		ret = -error_print(progname);
	if((value = config_get(config, NULL, variable)) == NULL)
		ret = -error_print(progname);
	else if(string_compare(expected, value) != 0)
		ret = -error_set_print(progname, 1, "%s: %s (\"%s\")", expected,
				"Invalid variable returned", value);
	config_delete(config);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %r14
callq 0x1120
testq %rax, %rax
je 0x14bd
movq %rax, %rbx
movq %r12, (%rsp)
movq %r15, %r12
leaq 0xc07(%rip), %rdi       # 0x2087
leaq 0xc15(%rip), %rdx       # 0x209c
xorl %r13d, %r13d
movq %r14, %rsi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1080
movq 0x2b42(%rip), %r15      # 0x3fe0
movq (%r15), %rdi
callq 0x10e0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1060
testl %eax, %eax
je 0x14d0
movq %rbx, %rdi
callq 0x10b0
movq %r14, %rdi
callq 0x1110
movl %eax, %r13d
negl %r13d
jmp 0x175c
leaq 0xbd3(%rip), %rdi       # 0x20aa
leaq 0xbdc(%rip), %rdx       # 0x20ba
movq %r14, %rsi
xorl %eax, %eax
callq 0x1080
movq (%r15), %rdi
callq 0x10e0
leaq 0xbd0(%rip), %rdx       # 0x20c7
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10c0
testq %rax, %rax
je 0x1527
leaq 0xc39(%rip), %rdx       # 0x2146
leaq 0xbbf(%rip), %rcx       # 0x20d3
pushq $0x1
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1050
movl %eax, %r13d
negl %r13d
movq %rbx, %rdi
xorl %esi, %esi
movq (%rsp), %rdx
callq 0x10c0
testq %rax, %rax
movq %r12, %r15
je 0x1572
movq %rax, %rbp
movq %r15, %rdi
movq %rax, %rsi
callq 0x1070
testl %eax, %eax
je 0x1580
leaq 0xb97(%rip), %rdx       # 0x20ed
leaq 0xb9e(%rip), %r8        # 0x20fb
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %r15, %rcx
movq %rbp, %r9
xorl %eax, %eax
callq 0x1050
jmp 0x157a
movq %r14, %rdi
callq 0x1110
movl %eax, %r13d
negl %r13d
leaq 0xb23(%rip), %rdi       # 0x20aa
leaq 0xb87(%rip), %rdx       # 0x2115
movq %r14, %rsi
xorl %eax, %eax
callq 0x1080
movq %rbx, %rdi
xorl %esi, %esi
movq (%rsp), %r12
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x1140
testl %eax, %eax
je 0x15bd
movq %r14, %rdi
callq 0x1110
movl %eax, %r13d
negl %r13d
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x10c0
testq %rax, %rax
je 0x15fa
leaq 0xb17(%rip), %rdx       # 0x20ed
leaq 0xb45(%rip), %rcx       # 0x2122
leaq 0xb17(%rip), %r8        # 0x20fb
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %rax, %r9
xorl %eax, %eax
callq 0x1050
movl %eax, %r13d
negl %r13d
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
callq 0x1140
testl %eax, %eax
je 0x161c
movq %r14, %rdi
callq 0x1110
movl %eax, %r13d
negl %r13d
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x10c0
testq %rax, %rax
je 0x1663
movq %rax, %rbp
movq %r15, %rdi
movq %rax, %rsi
callq 0x1070
testl %eax, %eax
je 0x1671
leaq 0xaa6(%rip), %rdx       # 0x20ed
leaq 0xaad(%rip), %r8        # 0x20fb
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %r15, %rcx
movq %rbp, %r9
xorl %eax, %eax
callq 0x1050
jmp 0x166b
movq %r14, %rdi
callq 0x1110
movl %eax, %r13d
negl %r13d
leaq 0xa23(%rip), %rcx       # 0x209b
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x1140
testl %eax, %eax
je 0x1697
movq %r14, %rdi
callq 0x1110
movl %eax, %r13d
negl %r13d
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x10c0
movq %rax, %rbp
testq %rax, %rax
je 0x16b9
movq %rbp, %rdi
callq 0x1090
testq %rax, %rax
je 0x16dd
leaq 0xa31(%rip), %rdx       # 0x20f1
leaq 0xa34(%rip), %rcx       # 0x20fb
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %rbp, %r8
xorl %eax, %eax
callq 0x1050
movl %eax, %r13d
negl %r13d
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
callq 0x1140
testl %eax, %eax
je 0x16ff
movq %r14, %rdi
callq 0x1110
movl %eax, %r13d
negl %r13d
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x10c0
testq %rax, %rax
je 0x1746
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
callq 0x1070
testl %eax, %eax
je 0x1754
leaq 0x9c3(%rip), %rdx       # 0x20ed
leaq 0x9ca(%rip), %r8        # 0x20fb
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %r15, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x1050
jmp 0x174e
movq %r14, %rdi
callq 0x1110
movl %eax, %r13d
negl %r13d
movq %rbx, %rdi
callq 0x10b0
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq