// File: /workspace/github_c_makefile_star2_O0/OpenKMIP[P]libkmip/tests/tests.c
// Function: test_deep_copy_text_string
int
test_deep_copy_text_string(TestTracker *tracker)
{
    TRACK_TEST(tracker);

    TextString expected = {0};
    expected.value = "example";
    expected.size = 7;
    TextString *observed = NULL;

    observed = kmip_deep_copy_text_string(NULL, NULL);
    if(observed != NULL)
        TEST_FAILED(tracker, __func__, __LINE__);

    KMIP ctx = {0};
    kmip_init(&ctx, NULL, 0, KMIP_1_0);

    observed = kmip_deep_copy_text_string(&ctx, NULL);
    if(observed != NULL)
    {
        kmip_destroy(&ctx);
        TEST_FAILED(tracker, __func__, __LINE__);
    }

    observed = kmip_deep_copy_text_string(&ctx, &expected);
    if(observed == NULL)
    {
        kmip_destroy(&ctx);
        TEST_FAILED(tracker, __func__, __LINE__);
    }
    if(!kmip_compare_text_string(&expected, observed))
    {
        kmip_print_text_string(stderr, 1, "Name Value", &expected);
        kmip_print_text_string(stderr, 1, "Name Value", observed);
        kmip_free_text_string(&ctx, observed);
        ctx.free_func(ctx.state, observed);
        kmip_destroy(&ctx);
        TEST_FAILED(tracker, __func__, __LINE__);
    }

    kmip_free_text_string(&ctx, observed);
    ctx.free_func(ctx.state, observed);
    kmip_destroy(&ctx);

    TEST_PASSED(tracker, __func__);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x8c0, %rsp            # imm = 0x8C0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x3a672(%rip), %rax     # 0x3f4a6
movq %rax, -0x20(%rbp)
movq $0x7, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x1fec0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x4e97
jmp 0x4e61
leaq 0x3a24d(%rip), %rdi     # 0x3f0b5
leaq 0x3a63f(%rip), %rsi     # 0x3f4ae
movl $0x579, %edx            # imm = 0x579
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x5080
leaq -0x8c0(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x8c0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
movq %rdx, %rsi
callq 0x1c6e0
leaq -0x8c0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1fec0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x4f1c
leaq -0x8c0(%rbp), %rdi
callq 0x1cab0
leaq 0x3a1c8(%rip), %rdi     # 0x3f0b5
leaq 0x3a5ba(%rip), %rsi     # 0x3f4ae
movl $0x582, %edx            # imm = 0x582
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x5080
leaq -0x8c0(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1fec0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x4f79
leaq -0x8c0(%rbp), %rdi
callq 0x1cab0
leaq 0x3a16b(%rip), %rdi     # 0x3f0b5
leaq 0x3a55d(%rip), %rsi     # 0x3f4ae
movl $0x589, %edx            # imm = 0x589
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x5080
movq -0x28(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x20ba0
cmpl $0x0, %eax
jne 0x502a
movq 0x4f062(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
movl $0x1, %esi
leaq 0x3a524(%rip), %rdx     # 0x3f4c9
leaq -0x20(%rbp), %rcx
callq 0x3b4c0
movq 0x4f043(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
movq -0x28(%rbp), %rcx
movl $0x1, %esi
leaq 0x3a501(%rip), %rdx     # 0x3f4c9
callq 0x3b4c0
movq -0x28(%rbp), %rsi
leaq -0x8c0(%rbp), %rdi
callq 0x1d690
movq -0x48(%rbp), %rax
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq *%rax
leaq -0x8c0(%rbp), %rdi
callq 0x1cab0
leaq 0x3a0b7(%rip), %rdi     # 0x3f0b5
leaq 0x3a4a9(%rip), %rsi     # 0x3f4ae
movl $0x592, %edx            # imm = 0x592
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x5080
movq -0x28(%rbp), %rsi
leaq -0x8c0(%rbp), %rdi
callq 0x1d690
movq -0x48(%rbp), %rax
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq *%rax
leaq -0x8c0(%rbp), %rdi
callq 0x1cab0
leaq 0x39ff0(%rip), %rdi     # 0x3f04b
leaq 0x3a44c(%rip), %rsi     # 0x3f4ae
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x4(%rax), %cx
addw $0x1, %cx
movw %cx, 0x4(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x8c0, %rsp            # imm = 0x8C0
popq %rbp
retq
nopl (%rax)