Skip to content

Commit

Permalink
Working in something
Browse files Browse the repository at this point in the history
  • Loading branch information
alecksandr26 committed May 22, 2024
1 parent 31f3ad3 commit 17d4ef8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

# Move to the build directory
pkgname=unittest-c
pkgver=1.3.1
pkgrel=8
pkgver=1.3.2
pkgrel=9
epoch=
pkgdesc="unittest c is a fast and simple macro-based unit testing framework for C.
It's inspired by the Python unittest module and designed to reduce boilerplate code.
Expand Down
3 changes: 2 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@
---- URGENT 2024/01/278 ----
- Solve the bug of include testcases and paths from other files [X]
- Solve the bug of redefinition in recompilation time [X]

- Solve the warning bug [X]

12 changes: 6 additions & 6 deletions include/unittest_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ typedef struct {
#define LOG_ERR(M, ...) dprintf(UNITTEST_STD_ERR, M __VA_OPT__(, ) __VA_ARGS__)

/* ABORT: Abort the program and prints the error. */
#define ABORT(M, ...) \
do { \
#define ABORT(M, ...) \
do { \
LOG_ERR("Traceback...\n"); \
LOG_ERR("\tFile \"%s\", in line %i, in func \"%s\"\n", __FILE__, \
__LINE__, __func__); \
LOG_ERR("[ERROR]:\t " M, __VA_ARGS__); \
LOG_ERR("\nAborting...\n"); \
abort(); \
__LINE__, __func__); \
LOG_ERR("[ERROR]:\t " M __VA_OPT__(,) __VA_ARGS__); \
LOG_ERR("\nAborting...\n"); \
abort(); \
} while (0)

/* The file descriptor to know where to send the information. */
Expand Down
2 changes: 1 addition & 1 deletion include/unittest_tcase.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ typedef struct {
UnitTestCaseFrame unitframe; \
unitframe.state = stackjmp(&unitframe.buf); \
if (unitframe.state > 1) LOG("%c", unitcase->res); \
if (unitframe.state > unitcase->amount) return; \
if ((size_t) unitframe.state > unitcase->amount) return; \
unitframe.counter = 0; \
do

Expand Down
4 changes: 2 additions & 2 deletions test/src/test_assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ TESTCASE(Checking)
int var1 = 1, var2 = 2;

TEST(NormalAssertion) { ASSERT(var1 != var2, "Testing the message"); }

TEST(ComparisonAssertion) { ASSERT_EQ(var1, 3, "This is a message"); }

struct person {
Expand Down Expand Up @@ -86,7 +86,7 @@ TESTCASE(Checking)
int main(void)
{
MUTE_ACTIVE(true);

RUN(Checking);

/* It supouse to have an failed assertion */
Expand Down

0 comments on commit 17d4ef8

Please sign in to comment.