From c43b487246fdfd2ddc5c794763b18255ac6a318e Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Thu, 5 Apr 2018 22:35:25 +0200 Subject: *: use squareball yeah, changed my mind again :) --- tests/common/check_stdin.c | 54 ---------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 tests/common/check_stdin.c (limited to 'tests/common/check_stdin.c') diff --git a/tests/common/check_stdin.c b/tests/common/check_stdin.c deleted file mode 100644 index 64c4714..0000000 --- a/tests/common/check_stdin.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * blogc: A blog compiler. - * Copyright (C) 2014-2017 Rafael G. Martins - * - * This program can be distributed under the terms of the BSD License. - * See the file LICENSE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include "../../src/common/stdin.h" - - -int -__wrap_fgetc(FILE *stream) -{ - assert_int_equal(fileno(stream), fileno(stdin)); - return mock_type(int); -} - - -static void -test_read(void **state) -{ - will_return(__wrap_fgetc, EOF); - char *t = bc_stdin_read(); - assert_non_null(t); - assert_string_equal(t, ""); - free(t); - will_return(__wrap_fgetc, 'b'); - will_return(__wrap_fgetc, 'o'); - will_return(__wrap_fgetc, 'l'); - will_return(__wrap_fgetc, 'a'); - will_return(__wrap_fgetc, EOF); - t = bc_stdin_read(); - assert_non_null(t); - assert_string_equal(t, "bola"); - free(t); -} - - -int -main(void) -{ - const UnitTest tests[] = { - unit_test(test_read), - }; - return run_tests(tests); -} -- cgit v1.2.3-18-g5258