forked from irungentoo/toxcore
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove libcheck from the dependencies.
We're not gaining much from this library, and it's a burden, especially for windows development.
- Loading branch information
Showing
27 changed files
with
112 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,66 @@ | ||
#ifdef _MSC_VER | ||
#define pid_t int | ||
// #include <libcompat.h> | ||
#endif | ||
#include <check.h> | ||
#ifdef _MSC_VER | ||
#undef pid_t | ||
#endif | ||
#ifndef CHECK_COMPAT_H | ||
#define CHECK_COMPAT_H | ||
|
||
#include "../toxcore/ccompat.h" | ||
|
||
#include <stdbool.h> | ||
#include <stdio.h> | ||
|
||
#define START_TEST(name) static void name(void) | ||
#define END_TEST | ||
|
||
#define DEFTESTCASE(NAME) test_##NAME() | ||
#define DEFTESTCASE_SLOW(NAME, TIMEOUT) test_##NAME() | ||
|
||
typedef struct Suite Suite; | ||
typedef struct SRunner SRunner; | ||
enum SRunMode { CK_NORMAL }; | ||
|
||
Suite *suite_create(const char *title) | ||
{ | ||
printf("Running test suite: %s\n", title); | ||
return nullptr; | ||
} | ||
|
||
SRunner *srunner_create(Suite *s) | ||
{ | ||
return nullptr; | ||
} | ||
|
||
void srunner_free(SRunner *s) | ||
{ | ||
} | ||
|
||
void srunner_run_all(SRunner *r, int mode) | ||
{ | ||
} | ||
|
||
int srunner_ntests_failed(SRunner *r) | ||
{ | ||
return 0; | ||
} | ||
|
||
#define ck_assert(ok) do { \ | ||
if (!(ok)) { \ | ||
fprintf(stderr, "%s:%d: failed `%s'\n", __FILE__, __LINE__, #ok); \ | ||
exit(EXIT_FAILURE); \ | ||
} \ | ||
} while (0) | ||
|
||
#define ck_assert_msg(ok, ...) do { \ | ||
if (!(ok)) { \ | ||
fprintf(stderr, "%s:%d: failed `%s': ", __FILE__, __LINE__, #ok); \ | ||
fprintf(stderr, __VA_ARGS__); \ | ||
fprintf(stderr, "\n"); \ | ||
exit(EXIT_FAILURE); \ | ||
} \ | ||
} while (0) | ||
|
||
#define ck_abort_msg(...) do { \ | ||
fprintf(stderr, "%s:%d: ", __FILE__, __LINE__); \ | ||
fprintf(stderr, __VA_ARGS__); \ | ||
fprintf(stderr, "\n"); \ | ||
exit(EXIT_FAILURE); \ | ||
} while (0) | ||
|
||
#endif // CHECK_COMPAT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.