summaryrefslogtreecommitdiff
path: root/tests/clar.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-06-27 15:29:36 +0200
committerPatrick Steinhardt <ps@pks.im>2019-07-05 11:31:52 +0200
commit77d7e5eb94f02bf50daf64834ece177b15a64302 (patch)
tree7c1043181c719a5a0a61d82b54f2e95e67e992b4 /tests/clar.c
parent2dea47362e007b9cbfbc218ad125202a248ed470 (diff)
downloadlibgit2-77d7e5eb94f02bf50daf64834ece177b15a64302.tar.gz
clar: use `size_t` to keep track of current line number
We use the `__LINE__` macro in several places throughout clar to allow easier traceability when e.g. a test fails. While `__LINE__` is of type `size_t`, the clar functions all accept an integer and thus may loose precision. While unlikely that any file in our codebase will exceed a linecount of `INT_MAX`, let's convert it anyway to silence any compiler warnings.
Diffstat (limited to 'tests/clar.c')
-rw-r--r--tests/clar.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/clar.c b/tests/clar.c
index 459ece0a1..7c308dd34 100644
--- a/tests/clar.c
+++ b/tests/clar.c
@@ -96,7 +96,7 @@ fixture_path(const char *base, const char *fixture_name);
struct clar_error {
const char *file;
- int line_number;
+ size_t line_number;
const char *error_msg;
char *description;
@@ -589,7 +589,7 @@ void clar__skip(void)
void clar__fail(
const char *file,
- int line,
+ size_t line,
const char *error_msg,
const char *description,
int should_abort)
@@ -621,7 +621,7 @@ void clar__fail(
void clar__assert(
int condition,
const char *file,
- int line,
+ size_t line,
const char *error_msg,
const char *description,
int should_abort)
@@ -634,7 +634,7 @@ void clar__assert(
void clar__assert_equal(
const char *file,
- int line,
+ size_t line,
const char *err,
int should_abort,
const char *fmt,