aboutsummaryrefslogtreecommitdiff
path: root/example.c
diff options
context:
space:
mode:
authorCamil Staps2015-12-02 20:02:11 +0100
committerCamil Staps2015-12-02 20:04:46 +0100
commit2f564f6fdc21a4f851db2f85cf5416fee5c7d339 (patch)
tree42a6aef3e95d91ce1c2eeb2a4b5ffff0a5d6288a /example.c
parentInitial commit (diff)
First version
Diffstat (limited to 'example.c')
-rw-r--r--example.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/example.c b/example.c
new file mode 100644
index 0000000..ffd155a
--- /dev/null
+++ b/example.c
@@ -0,0 +1,33 @@
+/**
+ * CSTest - Minimalistic C unit test framework
+ * Copyright (C) 2015 Camil Staps
+
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#include <stddef.h>
+#include "cstest.h"
+
+int main(void) {
+ cstester* tester = test_initialize();
+ tester->show_pass = false;
+
+ test_true(tester, 1 == 1, "1 = 1");
+ test_true(tester, 42 == 6 * 7, "42 = 6*7");
+ test_true(tester, !NULL, "NULL is false");
+ test_true(tester, -10 > 10, "Negative is greater than positive");
+
+ test_wrapup(tester);
+ test_exit(tester);
+}
+