1
1
mirror of https://github.com/theoludwig/libcproject.git synced 2025-05-21 23:21:15 +02:00

feat: add assert module

This commit is contained in:
2024-09-25 14:57:34 +02:00
parent 1be12c2a97
commit 336bbf6197
12 changed files with 38 additions and 29 deletions

View File

@ -6,7 +6,6 @@
#include <stdlib.h>
#include "libcproject.h"
#include "test.h"
void character_test();

View File

@ -6,7 +6,6 @@
#include <stdlib.h>
#include "libcproject.h"
#include "test.h"
void convert_test();

View File

@ -4,7 +4,6 @@
#include <assert.h>
#include "libcproject.h"
#include "test.h"
void date_test();

View File

@ -6,7 +6,6 @@
#include <stdlib.h>
#include "libcproject.h"
#include "test.h"
void string_test();

View File

@ -1,17 +0,0 @@
#include "test.h"
bool assert_string_equal(const string_t actual, const string_t expected) {
if (strcmp(expected, actual) != 0) {
printf("FAIL: expected = \"%s\" ; actual = \"%s\"\n", expected, actual);
return false;
}
return true;
}
bool assert_string_not_equal(const string_t actual, const string_t expected) {
if (strcmp(expected, actual) == 0) {
printf("FAIL: expected = \"%s\" ; actual = \"%s\"\n", expected, actual);
return false;
}
return true;
}

View File

@ -1,14 +0,0 @@
#ifndef __TEST__
#define __TEST__
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include "libcproject.h"
bool assert_string_equal(const string_t actual, const string_t expected);
bool assert_string_not_equal(const string_t actual, const string_t expected);
#endif