aboutsummaryrefslogtreecommitdiffstats
path: root/tests/blogc-git-receiver/check_pre_receive_parser.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2020-05-30 21:08:16 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2020-05-30 21:08:16 +0200
commit9a3629921b250e7079be9abb5252381025c33354 (patch)
treeefba39ef18c690566e2bff423a1125d871d0e1f8 /tests/blogc-git-receiver/check_pre_receive_parser.c
parent30c3bd35de3b7c0f5dc22259fdef9194f10f74a4 (diff)
downloadblogc-9a3629921b250e7079be9abb5252381025c33354.tar.gz
blogc-9a3629921b250e7079be9abb5252381025c33354.tar.bz2
blogc-9a3629921b250e7079be9abb5252381025c33354.zip
git-receiver: pre-receive parser should accept len
Diffstat (limited to 'tests/blogc-git-receiver/check_pre_receive_parser.c')
-rw-r--r--tests/blogc-git-receiver/check_pre_receive_parser.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/blogc-git-receiver/check_pre_receive_parser.c b/tests/blogc-git-receiver/check_pre_receive_parser.c
index 68175f2..37c9486 100644
--- a/tests/blogc-git-receiver/check_pre_receive_parser.c
+++ b/tests/blogc-git-receiver/check_pre_receive_parser.c
@@ -13,46 +13,48 @@
#include <stdlib.h>
#include "../../src/blogc-git-receiver/pre-receive-parser.h"
+#define _bgr_pre_receive_parse(a) bgr_pre_receive_parse(a, strlen(a))
+
static void
test_pre_receive_parse(void **state)
{
- assert_null(bgr_pre_receive_parse(""));
- assert_null(bgr_pre_receive_parse(
+ assert_null(_bgr_pre_receive_parse(""));
+ assert_null(_bgr_pre_receive_parse(
"4f1f932f6ef6d6c9770266775c2db072964d7a62"));
- assert_null(bgr_pre_receive_parse(
+ assert_null(_bgr_pre_receive_parse(
"4f1f932f6ef6d6c9770266775c2db072964d7a62 "));
- assert_null(bgr_pre_receive_parse(
+ assert_null(_bgr_pre_receive_parse(
"4f1f932f6ef6d6c9770266775c2db072964d7a62 "
"3fff4bb3172f77b292b0c913749e81bedd3545f3"));
- assert_null(bgr_pre_receive_parse(
+ assert_null(_bgr_pre_receive_parse(
"4f1f932f6ef6d6c9770266775c2db072964d7a62 "
"3fff4bb3172f77b292b0c913749e81bedd3545f3 "));
- assert_null(bgr_pre_receive_parse(
+ assert_null(_bgr_pre_receive_parse(
"4f1f932f6ef6d6c9770266775c2db072964d7a62 "
"3fff4bb3172f77b292b0c913749e81bedd3545f3 "
"refs/heads/lol"));
- assert_null(bgr_pre_receive_parse(
+ assert_null(_bgr_pre_receive_parse(
"4f1f932f6ef6d6c9770266775c2db072964d7a62 "
"3fff4bb3172f77b292b0c913749e81bedd3545f3 "
"refs/heads/lol"));
- assert_null(bgr_pre_receive_parse(
+ assert_null(_bgr_pre_receive_parse(
"4f1f932f6ef6d6c9770266775c2db072964d7a62 "
"3fff4bb3172f77b292b0c913749e81bedd3545f3 "
"refs/heads/master"));
- assert_null(bgr_pre_receive_parse(
+ assert_null(_bgr_pre_receive_parse(
"4f1f932f6ef6d6c9770266775c2db072964d7a62 "
"3fff4bb3172f77b292b0c913749e81bedd3545f3 "
"refs/heads/master asd\n"));
char *t;
- t = bgr_pre_receive_parse(
+ t = _bgr_pre_receive_parse(
"4f1f932f6ef6d6c9770266775c2db072964d7a62 "
"3fff4bb3172f77b292b0c913749e81bedd3545f3 "
"refs/heads/master\n");
assert_non_null(t);
assert_string_equal(t, "3fff4bb3172f77b292b0c913749e81bedd3545f3");
free(t);
- t = bgr_pre_receive_parse(
+ t = _bgr_pre_receive_parse(
"4f1f932f6ef6d6c9770266775c2db072964d7a62 "
"3fff4bb3172f77b292b0c913749e81bedd3545fa "
"refs/heads/master\n"
@@ -63,7 +65,7 @@ test_pre_receive_parse(void **state)
assert_non_null(t);
assert_string_equal(t, "3fff4bb3172f77b292b0c913749e81bedd3545fa");
free(t);
- t = bgr_pre_receive_parse(
+ t = _bgr_pre_receive_parse(
"4f1f932f6ef6d6c9770266775c2db072964d7a63 "
"3fff4bb3172f77b292b0c913749e81bedd3545f4 "
"refs/heads/bola\n"
@@ -74,7 +76,7 @@ test_pre_receive_parse(void **state)
assert_non_null(t);
assert_string_equal(t, "3fff4bb3172f77b292b0c913749e81bedd3545fb");
free(t);
- t = bgr_pre_receive_parse(
+ t = _bgr_pre_receive_parse(
"4f1f932f6ef6d6c9770266775c2db072964d7a63 "
"3fff4bb3172f77b292b0c913749e81bedd3545f4 "
"refs/heads/bola\n"