It is not a unit test so moved over to libtests.
<info>
<keywords>
unittest
-curl_strcasecompare
+curl_strequal
</keywords>
</info>
<server>
none
</server>
-<features>
-unittest
-</features>
<name>
-curl_strcasecompare unit tests
+curl_strequal tests
</name>
</client>
</testcase>
lib659 lib661 lib666 lib667 lib668 \
lib670 lib671 lib672 lib673 lib674 lib676 lib677 lib678 \
lib1156 \
+ lib1301 \
lib1500 lib1501 lib1502 lib1503 lib1504 lib1505 lib1506 lib1507 lib1508 \
lib1509 lib1510 lib1511 lib1512 lib1513 lib1514 lib1515 lib1517 \
lib1518 lib1520 lib1521 lib1522 lib1523 \
lib678_LDADD = $(TESTUTIL_LIBS)
lib678_CPPFLAGS = $(AM_CPPFLAGS)
+lib1301_SOURCES = lib1301.c $(SUPPORTFILES) $(TESTUTIL)
+lib1301_LDADD = $(TESTUTIL_LIBS)
+lib1301_CPPFLAGS = $(AM_CPPFLAGS)
+
lib1500_SOURCES = lib1500.c $(SUPPORTFILES) $(TESTUTIL)
lib1500_LDADD = $(TESTUTIL_LIBS)
lib1500_CPPFLAGS = $(AM_CPPFLAGS)
--- /dev/null
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ * SPDX-License-Identifier: curl
+ *
+ ***************************************************************************/
+#include "test.h"
+
+#define fail_unless(expr, msg) \
+ do { \
+ if(!(expr)) { \
+ fprintf(stderr, "%s:%d Assertion '%s' failed: %s\n", \
+ __FILE__, __LINE__, #expr, msg); \
+ return 1; \
+ } \
+ } while(0)
+
+int test(char *URL)
+{
+ int rc;
+ (void)URL;
+
+ rc = curl_strequal("iii", "III");
+ fail_unless(rc != 0, "return code should be non-zero");
+
+ rc = curl_strequal("iiia", "III");
+ fail_unless(rc == 0, "return code should be zero");
+
+ rc = curl_strequal("iii", "IIIa");
+ fail_unless(rc == 0, "return code should be zero");
+
+ rc = curl_strequal("iiiA", "IIIa");
+ fail_unless(rc != 0, "return code should be non-zero");
+
+ rc = curl_strnequal("iii", "III", 3);
+ fail_unless(rc != 0, "return code should be non-zero");
+
+ rc = curl_strnequal("iiiABC", "IIIcba", 3);
+ fail_unless(rc != 0, "return code should be non-zero");
+
+ rc = curl_strnequal("ii", "II", 3);
+ fail_unless(rc != 0, "return code should be non-zero");
+
+ return 0;
+}
../libtest/first.c
# These are all unit test programs
-UNITPROGS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307 \
+UNITPROGS = unit1300 unit1302 unit1303 unit1304 unit1305 unit1307 \
unit1308 unit1309 unit1323 \
unit1330 unit1394 unit1395 unit1396 unit1397 unit1398 \
unit1399 \
unit1300_SOURCES = unit1300.c $(UNITFILES)
unit1300_CPPFLAGS = $(AM_CPPFLAGS)
-unit1301_SOURCES = unit1301.c $(UNITFILES)
-unit1301_CPPFLAGS = $(AM_CPPFLAGS)
-
unit1302_SOURCES = unit1302.c $(UNITFILES)
unit1302_CPPFLAGS = $(AM_CPPFLAGS)
+++ /dev/null
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at https://curl.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * SPDX-License-Identifier: curl
- *
- ***************************************************************************/
-#include "curlcheck.h"
-
-#include "strcase.h"
-
-static CURLcode unit_setup(void) {return CURLE_OK;}
-static void unit_stop(void) {}
-
-UNITTEST_START
-
-int rc;
-
-rc = curl_strequal("iii", "III");
-fail_unless(rc != 0, "return code should be non-zero");
-
-rc = curl_strequal("iiia", "III");
-fail_unless(rc == 0, "return code should be zero");
-
-rc = curl_strequal("iii", "IIIa");
-fail_unless(rc == 0, "return code should be zero");
-
-rc = curl_strequal("iiiA", "IIIa");
-fail_unless(rc != 0, "return code should be non-zero");
-
-rc = curl_strnequal("iii", "III", 3);
-fail_unless(rc != 0, "return code should be non-zero");
-
-rc = curl_strnequal("iiiABC", "IIIcba", 3);
-fail_unless(rc != 0, "return code should be non-zero");
-
-rc = curl_strnequal("ii", "II", 3);
-fail_unless(rc != 0, "return code should be non-zero");
-
-UNITTEST_STOP