Github User Fetcher 1.0.0
C Application with Server and GUI
|
Redirect functions and file asserts. More...
Go to the source code of this file.
Macros | |
#define | cr_assert_file_contents_eq_str(File, ExpectedContents, FormatString, ...) internal |
#define | cr_expect_file_contents_eq_str(File, ExpectedContents, FormatString, ...) internal |
#define | cr_assert_file_contents_neq_str(File, UnexpectedContents, FormatString, ...) internal |
#define | cr_expect_file_contents_neq_str(File, UnexpectedContents, FormatString, ...) internal |
#define | cr_assert_file_contents_eq(File, RefFile, FormatString, ...) internal |
#define | cr_expect_file_contents_eq(File, RefFile, FormatString, ...) internal |
#define | cr_assert_file_contents_neq(File, RefFile, FormatString, ...) internal |
#define | cr_expect_file_contents_neq(File, RefFile, FormatString, ...) internal |
#define | cr_assert_stdout_eq_str(ExpectedContents, FormatString, ...) internal |
#define | cr_expect_stdout_eq_str(ExpectedContents, FormatString, ...) internal |
#define | cr_assert_stdout_neq_str(UnexpectedContents, FormatString, ...) internal |
#define | cr_expect_stdout_neq_str(UnexpectedContents, FormatString, ...) internal |
#define | cr_assert_stderr_eq_str(ExpectedContents, FormatString, ...) internal |
#define | cr_expect_stderr_eq_str(ExpectedContents, FormatString, ...) internal |
#define | cr_assert_stderr_neq_str(UnexpectedContents, FormatString, ...) internal |
#define | cr_expect_stderr_neq_str(UnexpectedContents, FormatString, ...) internal |
#define | cr_assert_stdout_eq(RefFile, FormatString, ...) internal |
#define | cr_expect_stdout_eq(RefFile, FormatString, ...) internal |
#define | cr_assert_stdout_neq(RefFile, FormatString, ...) internal |
#define | cr_expect_stdout_neq(RefFile, FormatString, ...) internal |
#define | cr_assert_stderr_eq(RefFile, FormatString, ...) internal |
#define | cr_expect_stderr_eq(RefFile, FormatString, ...) internal |
#define | cr_assert_stderr_neq(RefFile, FormatString, ...) internal |
#define | cr_expect_stderr_neq(RefFile, FormatString, ...) internal |
Functions | |
CR_BEGIN_C_API CR_API void | cr_redirect_stdout (void) |
CR_API void | cr_redirect_stderr (void) |
CR_API void | cr_redirect_stdin (void) |
CR_API CR_STDN FILE * | cr_get_redirected_stdout (void) |
CR_API CR_STDN FILE * | cr_get_redirected_stderr (void) |
CR_API CR_STDN FILE * | cr_get_redirected_stdin (void) |
CR_API int | cr_file_match_str (CR_STDN FILE *f, const char *str) |
CR_API int | cr_file_match_file (CR_STDN FILE *f, CR_STDN FILE *ref) |
CR_API CR_STDN FILE * | cr_mock_file_size (size_t max_size) |
Redirect functions and file asserts.
Definition in file redirect.h.
Compare the contents of a file with the contents of another file.
[in] | f | The first file to compare the contents to. |
[in] | ref | The second file to compare the contents to. |
Compare the contents of a file with a string.
[in] | f | The file to compare the contents to. |
[in] | str | The string to compare the contents to. |
Get a file handle representing the read-end of the redirected stderr.
Get a file handle representing the write-end of the redirected stdin.
Get a file handle representing the read-end of the redirected stdout.
Create a file mock.
[in] | max_size | The maximum size in bytes of the file mock. |
CR_API void cr_redirect_stderr | ( | void | ) |
Redirect stderr for testing.
CR_API void cr_redirect_stdin | ( | void | ) |
Redirect stdin for testing. This is implicitely called before each test.
CR_BEGIN_C_API CR_API void cr_redirect_stdout | ( | void | ) |
Redirect stdout for testing.