summaryrefslogtreecommitdiffstats
path: root/tests/unit/ist.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:11:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:11:11 +0000
commit669c3ea68099b330943d5c3215f0cf381880c3ad (patch)
treeb5fbb97171c91fb994c2c3744dd33073f8f07407 /tests/unit/ist.c
parentReleasing progress-linux version 2.9.7-1~progress7.99u1. (diff)
downloadhaproxy-669c3ea68099b330943d5c3215f0cf381880c3ad.tar.xz
haproxy-669c3ea68099b330943d5c3215f0cf381880c3ad.zip
Merging upstream version 3.0.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/unit/ist.c')
-rw-r--r--tests/unit/ist.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/unit/ist.c b/tests/unit/ist.c
index 43b3438..e0d2b00 100644
--- a/tests/unit/ist.c
+++ b/tests/unit/ist.c
@@ -129,6 +129,30 @@ int test_istzero()
return 0;
}
+struct ist f_iststrip(struct ist ist) { return iststrip(ist); }
+int test_iststrip()
+{
+ if (iststrip(ist("foo")).len != 3)
+ return __LINE__;
+
+ if (iststrip(ist("foo\n")).len != 3)
+ return __LINE__;
+
+ if (iststrip(ist("foo\r")).len != 3)
+ return __LINE__;
+
+ if (iststrip(ist("foo\r\n")).len != 3)
+ return __LINE__;
+
+ if (iststrip(ist("")).len != 0)
+ return __LINE__;
+
+ if (iststrip(ist("\n")).len != 0)
+ return __LINE__;
+
+ return 0;
+}
+
int f_istdiff(const struct ist ist1, const struct ist ist2) { return istdiff(ist1, ist2); }
int test_istdiff()
{
@@ -682,6 +706,7 @@ int main(void)
printf("%4d istpad()\n", test_istpad());
printf("%4d isttrim()\n", test_isttrim());
printf("%4d istzero()\n", test_istzero());
+ printf("%4d iststrip()\n", test_iststrip());
printf("%4d istdiff()\n", test_istdiff());
printf("%4d istmatch()\n", test_istmatch());
printf("%4d istnmatch()\n", test_istnmatch());