// File: /workspace/github_c_makefile_star2_O1/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 0x14cd
movq %rax, %rbx
movq %r12, (%rsp)
movq %r15, %r12
leaq 0xbf7(%rip), %rdi       # 0x2087
leaq 0xc05(%rip), %rdx       # 0x209c
xorl %r13d, %r13d
movq %r14, %rsi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1080
movq 0x2b32(%rip), %r15      # 0x3fe0
movq (%r15), %rdi
callq 0x10e0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1060
testl %eax, %eax
je 0x14e0
movq %rbx, %rdi
callq 0x10b0
movq %r14, %rdi
callq 0x1110
movl %eax, %r13d
negl %r13d
jmp 0x1778
leaq 0xbc3(%rip), %rdi       # 0x20aa
leaq 0xbcc(%rip), %rdx       # 0x20ba
movq %r14, %rsi
xorl %eax, %eax
callq 0x1080
movq (%r15), %rdi
callq 0x10e0
leaq 0xbc0(%rip), %rdx       # 0x20c7
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10c0
testq %rax, %rax
je 0x1539
leaq 0xc29(%rip), %rdx       # 0x2146
leaq 0xbaf(%rip), %rcx       # 0x20d3
movq %r14, %rdi
movl $0x1, %esi
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 0x1586
movq %rax, %rbp
movq %r15, %rdi
movq %rax, %rsi
callq 0x1070
testl %eax, %eax
je 0x1594
leaq 0xb85(%rip), %rdx       # 0x20ed
leaq 0xb8c(%rip), %r8        # 0x20fb
movq %r14, %rdi
movl $0x1, %esi
movq %r15, %rcx
movq %rbp, %r9
xorl %eax, %eax
callq 0x1050
jmp 0x158e
movq %r14, %rdi
callq 0x1110
movl %eax, %r13d
negl %r13d
leaq 0xb0f(%rip), %rdi       # 0x20aa
leaq 0xb73(%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 0x15d1
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 0x1610
leaq 0xb03(%rip), %rdx       # 0x20ed
leaq 0xb31(%rip), %rcx       # 0x2122
leaq 0xb03(%rip), %r8        # 0x20fb
movq %r14, %rdi
movl $0x1, %esi
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 0x1632
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 0x167b
movq %rax, %rbp
movq %r15, %rdi
movq %rax, %rsi
callq 0x1070
testl %eax, %eax
je 0x1689
leaq 0xa90(%rip), %rdx       # 0x20ed
leaq 0xa97(%rip), %r8        # 0x20fb
movq %r14, %rdi
movl $0x1, %esi
movq %r15, %rcx
movq %rbp, %r9
xorl %eax, %eax
callq 0x1050
jmp 0x1683
movq %r14, %rdi
callq 0x1110
movl %eax, %r13d
negl %r13d
leaq 0xa0b(%rip), %rcx       # 0x209b
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x1140
testl %eax, %eax
je 0x16af
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 0x16d1
movq %rbp, %rdi
callq 0x1090
testq %rax, %rax
je 0x16f7
leaq 0xa19(%rip), %rdx       # 0x20f1
leaq 0xa1c(%rip), %rcx       # 0x20fb
movq %r14, %rdi
movl $0x1, %esi
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 0x1719
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 0x1762
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
callq 0x1070
testl %eax, %eax
je 0x1770
leaq 0x9a9(%rip), %rdx       # 0x20ed
leaq 0x9b0(%rip), %r8        # 0x20fb
movq %r14, %rdi
movl $0x1, %esi
movq %r15, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x1050
jmp 0x176a
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