TEST_BUILTINS_OBJS += test-mktemp.o
TEST_BUILTINS_OBJS += test-online-cpus.o
TEST_BUILTINS_OBJS += test-path-utils.o
+TEST_BUILTINS_OBJS += test-prio-queue.o
TEST_BUILTINS_OBJS += test-sha1.o
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
TEST_PROGRAMS_NEED_X += test-fake-ssh
TEST_PROGRAMS_NEED_X += test-line-buffer
TEST_PROGRAMS_NEED_X += test-parse-options
-TEST_PROGRAMS_NEED_X += test-prio-queue
TEST_PROGRAMS_NEED_X += test-read-cache
TEST_PROGRAMS_NEED_X += test-write-cache
TEST_PROGRAMS_NEED_X += test-ref-store
+#include "test-tool.h"
#include "cache.h"
#include "prio-queue.h"
free(v);
}
-int cmd_main(int argc, const char **argv)
+int cmd__prio_queue(int argc, const char **argv)
{
struct prio_queue pq = { intcmp };
{ "mktemp", cmd__mktemp },
{ "online-cpus", cmd__online_cpus },
{ "path-utils", cmd__path_utils },
+ { "prio-queue", cmd__prio_queue },
{ "sha1", cmd__sha1 },
};
int cmd__mktemp(int argc, const char **argv);
int cmd__online_cpus(int argc, const char **argv);
int cmd__path_utils(int argc, const char **argv);
+int cmd__prio_queue(int argc, const char **argv);
int cmd__sha1(int argc, const char **argv);
#endif
10
EOF
test_expect_success 'basic ordering' '
- test-prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
+ test-tool prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
test_cmp expect actual
'
6
EOF
test_expect_success 'mixed put and get' '
- test-prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&
+ test-tool prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&
test_cmp expect actual
'
NULL
EOF
test_expect_success 'notice empty queue' '
- test-prio-queue 1 2 get get get 1 2 get get get >actual &&
+ test-tool prio-queue 1 2 get get get 1 2 get get get >actual &&
test_cmp expect actual
'