aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-03-01 16:11:17 +0100
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-03-01 16:11:17 +0100
commit8d81ffef00f5cf2c267fb855715b76cdf004bc52 (patch)
treed1ffe2485627e8f64d6b1a908fad2ae872d1eee6 /test
parent2392a52c10fdb32e504cb76d5f1989df7a643655 (diff)
downloadstring2-8d81ffef00f5cf2c267fb855715b76cdf004bc52.tar.gz
string2-8d81ffef00f5cf2c267fb855715b76cdf004bc52.zip
Keep it simple
Diffstat (limited to 'test')
-rw-r--r--test/Makefile21
-rw-r--r--test/main.c13
-rw-r--r--test/test.c14
-rw-r--r--test/test.h8
-rw-r--r--test/test1.c39
-rw-r--r--test/test1.h10
6 files changed, 0 insertions, 105 deletions
diff --git a/test/Makefile b/test/Makefile
deleted file mode 100644
index 6b65bb0..0000000
--- a/test/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-# See LICENSE file for copyright and license details.
-
-CC = cc
-SRC != find * -name '*.c'
-OBJ = ${SRC:.c=.o}
-
-CFLAGS = -Wall -ansi --std=c89 -pedantic\
- -I../src/
-LDFLAGS = -L../ -l:libstr.a
-
-tests: test-app
- ./test-app
-
-.c.o:
- ${CC} ${CFLAGS} -c $< -o $@
-
-test-app: ${OBJ}
- ${CC} ${LDFLAGS} -o $@ ${OBJ}
-
-clean:
- rm -f test-app ${OBJ} *.core
diff --git a/test/main.c b/test/main.c
deleted file mode 100644
index 25e1993..0000000
--- a/test/main.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#include "test1.h"
-
-int
-main(int argc, char **argv)
-{
- test1();
- test2();
- test3();
-
- return 0;
-}
diff --git a/test/test.c b/test/test.c
deleted file mode 100644
index a47adb6..0000000
--- a/test/test.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-/* See LICENSE file for copyright and license details. */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-void
-asserti(int expected, int value)
-{
- if (expected != value) {
- exit(1);
- }
-}
diff --git a/test/test.h b/test/test.h
deleted file mode 100644
index cbd0a84..0000000
--- a/test/test.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#ifndef __TEST_H__
-#define __TEST_H__
-
-void asserti(int, int);
-
-#endif /* __TEST_H__ */
diff --git a/test/test1.c b/test/test1.c
deleted file mode 100644
index 586be35..0000000
--- a/test/test1.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#include <string2.h>
-#include <stdio.h>
-
-#include "test.h"
-
-void
-test1(void)
-{
- printf("executing test1... ");
- asserti(0, strrgt("alexander", "xander"));
- asserti(1, strrgt("alexander", "dander"));
- asserti(1, strrgt("alexander", "alex"));
- asserti(0, strrgt("alexander", "alexander"));
- asserti(1, strrgt("dwm", "dwmdwm"));
-
- printf("OK\n");
-}
-
-void
-test2(void)
-{
- printf("executing test2... ");
- asserti(0, strlft("alexander", "alex"));
- asserti(1, strlft("alexander", "dalex"));
- asserti(1, strlft("alexander", "xander"));
- asserti(0, strlft("alexander", "alexander"));
- asserti(1, strlft("dwm", "dwmdwm"));
-
- printf("OK\n");
-}
-
-void
-test3()
-{
- printf("executing %s... OK\n", __func__);
- printf("%s\n", string2ver());
-}
diff --git a/test/test1.h b/test/test1.h
deleted file mode 100644
index 79bab4c..0000000
--- a/test/test1.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#ifndef __TEST1_H__
-#define __TEST1_H__
-
-void test1(void);
-void test2(void);
-void test3(void);
-
-#endif /* __TEST1_H__ */