// File: /workspace/github_c_makefile_star2_O1/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       # 0x3e1c
xorl %esi, %esi
xorl %edx, %edx
callq 0x4830
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0x4abc
xorl %edi, %edi
testq %rbx, %rbx
setne %dil
leaq 0x14c6(%rip), %rsi      # 0x5318
leaq 0x166c(%rip), %rcx      # 0x54c5
leaq 0x14d0(%rip), %r8       # 0x5330
movl $0x25, %edx
xorl %eax, %eax
callq 0x25dc
testl %eax, %eax
je 0x403d
movq %rbx, %rdi
callq 0x48c6
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x148d(%rip), %rsi      # 0x5318
leaq 0x1633(%rip), %rcx      # 0x54c5
leaq 0x14a6(%rip), %r8       # 0x533f
movl $0x26, %edx
xorl %eax, %eax
callq 0x25dc
testl %eax, %eax
je 0x403d
movq %rbx, %rdi
callq 0x4ac5
xorl %edi, %edi
xorl %esi, %esi
callq 0x4ae8
movq %rax, %rbx
movl $0x4, %edi
callq 0x21a0
movl $0x0, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4bb9
movl $0x4, %edi
callq 0x21a0
movl $0x1, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4bb9
movl $0x4, %edi
callq 0x21a0
movl $0x2, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4bb9
movl $0x4, %edi
callq 0x21a0
movl $0x3, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4bb9
leaq -0x118(%rip), %rdi      # 0x3e1c
movq 0x4085(%rip), %rsi      # 0x7fc0
movq %rbx, %rdx
callq 0x4830
movq %rax, %r14
xorl %edi, %edi
testq %rax, %rax
setne %dil
leaq 0x13c2(%rip), %rsi      # 0x5318
leaq 0x1568(%rip), %rcx      # 0x54c5
leaq 0x13cc(%rip), %r8       # 0x5330
movl $0x32, %edx
xorl %eax, %eax
callq 0x25dc
testl %eax, %eax
je 0x403d
movq %r14, %rdi
callq 0x48c6
xorl %edi, %edi
cmpl $0x4, %eax
sete %dil
leaq 0x1388(%rip), %rsi      # 0x5318
leaq 0x152e(%rip), %rcx      # 0x54c5
leaq 0x13ba(%rip), %r8       # 0x5358
movl $0x33, %edx
xorl %eax, %eax
callq 0x25dc
testl %eax, %eax
je 0x403d
movq %r14, %rdi
callq 0x48ce
xorl %edi, %edi
cmpl $0x3, (%rax)
sete %dil
leaq 0x134e(%rip), %rsi      # 0x5318
leaq 0x14f4(%rip), %rcx      # 0x54c5
leaq 0x1399(%rip), %r8       # 0x5371
movl $0x35, %edx
xorl %eax, %eax
callq 0x25dc
testl %eax, %eax
je 0x403d
movq %r14, %rdi
callq 0x495f
movq %r14, %rdi
callq 0x48ce
xorl %edi, %edi
cmpl $0x2, (%rax)
sete %dil
leaq 0x1310(%rip), %rsi      # 0x5318
leaq 0x14b6(%rip), %rcx      # 0x54c5
leaq 0x137a(%rip), %r8       # 0x5390
movl $0x37, %edx
xorl %eax, %eax
callq 0x25dc
testl %eax, %eax
je 0x403d
movq %rbx, %rdi
callq 0x4cd2
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4ac5
callq 0x2e23