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:
@ -6,7 +6,6 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libcproject.h"
|
||||
#include "test.h"
|
||||
|
||||
void character_test();
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libcproject.h"
|
||||
#include "test.h"
|
||||
|
||||
void convert_test();
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include "libcproject.h"
|
||||
#include "test.h"
|
||||
|
||||
void date_test();
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libcproject.h"
|
||||
#include "test.h"
|
||||
|
||||
void string_test();
|
||||
|
||||
|
17
test/test.c
17
test/test.c
@ -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;
|
||||
}
|
14
test/test.h
14
test/test.h
@ -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
|
Reference in New Issue
Block a user