// File: /workspace/github_c_makefile_star2_O3/chatziko-k08[P]lecture-code/tests/ADTPriorityQueue_test.c
// Function: test_create
void test_create(void) {
	PriorityQueue pqueue = pqueue_create(compare_ints, NULL, NULL);
	pqueue_set_destroy_value(pqueue, NULL);

	TEST_ASSERT(pqueue != NULL);
	TEST_ASSERT(pqueue_size(pqueue) == 0);

	pqueue_destroy(pqueue);

	// create με αρχικά στοιχεία
	Vector values = vector_create(0, NULL);			// χωρίς destroy function, το destroy θα το κάνει η ουρά!
	vector_insert_last(values, create_int(0));
	vector_insert_last(values, create_int(1));
	vector_insert_last(values, create_int(2));
	vector_insert_last(values, create_int(3));

	pqueue = pqueue_create(compare_ints, free, values);
	TEST_ASSERT(pqueue != NULL);
	TEST_ASSERT(pqueue_size(pqueue) == 4);

	TEST_ASSERT(*(int*)pqueue_max(pqueue) == 3);
	pqueue_remove_max(pqueue);
	TEST_ASSERT(*(int*)pqueue_max(pqueue) == 2);

	vector_destroy(values);
	pqueue_destroy(pqueue);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq -0x10(%rip), %rdi       # 0x3d14
xorl %esi, %esi
xorl %edx, %edx
callq 0x471c
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0x49bc
xorl %edi, %edi
testq %rbx, %rbx
setne %dil
leaq 0x15ce(%rip), %rsi      # 0x5318
leaq 0x1771(%rip), %rcx      # 0x54c2
leaq 0x15d8(%rip), %r8       # 0x5330
movl $0x25, %edx
xorl %eax, %eax
callq 0x25dc
testl %eax, %eax
je 0x3f35
movq %rbx, %rdi
callq 0x47b2
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x1595(%rip), %rsi      # 0x5318
leaq 0x1738(%rip), %rcx      # 0x54c2
leaq 0x15ae(%rip), %r8       # 0x533f
movl $0x26, %edx
xorl %eax, %eax
callq 0x25dc
testl %eax, %eax
je 0x3f35
movq %rbx, %rdi
callq 0x49c5
xorl %edi, %edi
xorl %esi, %esi
callq 0x49e8
movq %rax, %rbx
movl $0x4, %edi
callq 0x21a0
movl $0x0, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4ab9
movl $0x4, %edi
callq 0x21a0
movl $0x1, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4ab9
movl $0x4, %edi
callq 0x21a0
movl $0x2, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4ab9
movl $0x4, %edi
callq 0x21a0
movl $0x3, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4ab9
leaq -0x118(%rip), %rdi      # 0x3d14
movq 0x418d(%rip), %rsi      # 0x7fc0
movq %rbx, %rdx
callq 0x471c
movq %rax, %r14
xorl %edi, %edi
testq %rax, %rax
setne %dil
leaq 0x14ca(%rip), %rsi      # 0x5318
leaq 0x166d(%rip), %rcx      # 0x54c2
leaq 0x14d4(%rip), %r8       # 0x5330
movl $0x32, %edx
xorl %eax, %eax
callq 0x25dc
testl %eax, %eax
je 0x3f35
movq %r14, %rdi
callq 0x47b2
xorl %edi, %edi
cmpl $0x4, %eax
sete %dil
leaq 0x1490(%rip), %rsi      # 0x5318
leaq 0x1633(%rip), %rcx      # 0x54c2
leaq 0x14c2(%rip), %r8       # 0x5358
movl $0x33, %edx
xorl %eax, %eax
callq 0x25dc
testl %eax, %eax
je 0x3f35
movq %r14, %rdi
callq 0x47ba
xorl %edi, %edi
cmpl $0x3, (%rax)
sete %dil
leaq 0x1456(%rip), %rsi      # 0x5318
leaq 0x15f9(%rip), %rcx      # 0x54c2
leaq 0x14a1(%rip), %r8       # 0x5371
movl $0x35, %edx
xorl %eax, %eax
callq 0x25dc
testl %eax, %eax
je 0x3f35
movq %r14, %rdi
callq 0x4846
movq %r14, %rdi
callq 0x47ba
xorl %edi, %edi
cmpl $0x2, (%rax)
sete %dil
leaq 0x1418(%rip), %rsi      # 0x5318
leaq 0x15bb(%rip), %rcx      # 0x54c2
leaq 0x1482(%rip), %r8       # 0x5390
movl $0x37, %edx
xorl %eax, %eax
callq 0x25dc
testl %eax, %eax
je 0x3f35
movq %rbx, %rdi
callq 0x4bd5
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x49c5
callq 0x2e3b