Skip to content

Commit 15b7581

Browse files
pcloudsgitster
authored andcommitted
t/helper: merge test-prio-queue into test-tool
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b8d5cf4 commit 15b7581

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,14 +670,14 @@ TEST_BUILTINS_OBJS += test-mergesort.o
670670
TEST_BUILTINS_OBJS += test-mktemp.o
671671
TEST_BUILTINS_OBJS += test-online-cpus.o
672672
TEST_BUILTINS_OBJS += test-path-utils.o
673+
TEST_BUILTINS_OBJS += test-prio-queue.o
673674
TEST_BUILTINS_OBJS += test-sha1.o
674675

675676
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
676677
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
677678
TEST_PROGRAMS_NEED_X += test-fake-ssh
678679
TEST_PROGRAMS_NEED_X += test-line-buffer
679680
TEST_PROGRAMS_NEED_X += test-parse-options
680-
TEST_PROGRAMS_NEED_X += test-prio-queue
681681
TEST_PROGRAMS_NEED_X += test-read-cache
682682
TEST_PROGRAMS_NEED_X += test-write-cache
683683
TEST_PROGRAMS_NEED_X += test-ref-store

t/helper/test-prio-queue.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "test-tool.h"
12
#include "cache.h"
23
#include "prio-queue.h"
34

@@ -16,7 +17,7 @@ static void show(int *v)
1617
free(v);
1718
}
1819

19-
int cmd_main(int argc, const char **argv)
20+
int cmd__prio_queue(int argc, const char **argv)
2021
{
2122
struct prio_queue pq = { intcmp };
2223

t/helper/test-tool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ static struct test_cmd cmds[] = {
2525
{ "mktemp", cmd__mktemp },
2626
{ "online-cpus", cmd__online_cpus },
2727
{ "path-utils", cmd__path_utils },
28+
{ "prio-queue", cmd__prio_queue },
2829
{ "sha1", cmd__sha1 },
2930
};
3031

t/helper/test-tool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ int cmd__mergesort(int argc, const char **argv);
1919
int cmd__mktemp(int argc, const char **argv);
2020
int cmd__online_cpus(int argc, const char **argv);
2121
int cmd__path_utils(int argc, const char **argv);
22+
int cmd__prio_queue(int argc, const char **argv);
2223
int cmd__sha1(int argc, const char **argv);
2324

2425
#endif

t/t0009-prio-queue.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cat >expect <<'EOF'
1717
10
1818
EOF
1919
test_expect_success 'basic ordering' '
20-
test-prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
20+
test-tool prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
2121
test_cmp expect actual
2222
'
2323

@@ -30,7 +30,7 @@ cat >expect <<'EOF'
3030
6
3131
EOF
3232
test_expect_success 'mixed put and get' '
33-
test-prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&
33+
test-tool prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&
3434
test_cmp expect actual
3535
'
3636

@@ -43,7 +43,7 @@ NULL
4343
NULL
4444
EOF
4545
test_expect_success 'notice empty queue' '
46-
test-prio-queue 1 2 get get get 1 2 get get get >actual &&
46+
test-tool prio-queue 1 2 get get get 1 2 get get get >actual &&
4747
test_cmp expect actual
4848
'
4949

0 commit comments

Comments
 (0)