mirror of
https://github.com/git/git
synced 2024-08-26 19:19:18 +00:00
t/helper: merge test-prio-queue into test-tool
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
b8d5cf4f96
commit
15b7581776
2
Makefile
2
Makefile
|
@ -670,6 +670,7 @@ TEST_BUILTINS_OBJS += test-mergesort.o
|
|||
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
|
||||
|
@ -677,7 +678,6 @@ TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
|
|||
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
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include "test-tool.h"
|
||||
#include "cache.h"
|
||||
#include "prio-queue.h"
|
||||
|
||||
|
@ -16,7 +17,7 @@ static void show(int *v)
|
|||
free(v);
|
||||
}
|
||||
|
||||
int cmd_main(int argc, const char **argv)
|
||||
int cmd__prio_queue(int argc, const char **argv)
|
||||
{
|
||||
struct prio_queue pq = { intcmp };
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ static struct test_cmd cmds[] = {
|
|||
{ "mktemp", cmd__mktemp },
|
||||
{ "online-cpus", cmd__online_cpus },
|
||||
{ "path-utils", cmd__path_utils },
|
||||
{ "prio-queue", cmd__prio_queue },
|
||||
{ "sha1", cmd__sha1 },
|
||||
};
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ int cmd__mergesort(int argc, const char **argv);
|
|||
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
|
||||
|
|
|
@ -17,7 +17,7 @@ cat >expect <<'EOF'
|
|||
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
|
||||
'
|
||||
|
||||
|
@ -30,7 +30,7 @@ cat >expect <<'EOF'
|
|||
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
|
||||
'
|
||||
|
||||
|
@ -43,7 +43,7 @@ NULL
|
|||
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
|
||||
'
|
||||
|
||||
|
|
Loading…
Reference in a new issue