diff options
| author | Fuwn <[email protected]> | 2022-06-19 19:26:54 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-06-19 19:26:54 -0700 |
| commit | 91ec072a82f0e0bb442997e558acfbec6b6952f2 (patch) | |
| tree | e4496130497b19984314480d9c9e4fc7b82b92f1 | |
| parent | fix(set): free previous tag on set (diff) | |
| download | tatl-91ec072a82f0e0bb442997e558acfbec6b6952f2.tar.xz tatl-91ec072a82f0e0bb442997e558acfbec6b6952f2.zip | |
refactor(get): return pointer to string
| -rw-r--r-- | include/tatl/context/get.h | 2 | ||||
| -rw-r--r-- | src/context/get.c | 4 | ||||
| -rw-r--r-- | tests/tatl/test.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/include/tatl/context/get.h b/include/tatl/context/get.h index 67296fd..0d26285 100644 --- a/include/tatl/context/get.h +++ b/include/tatl/context/get.h @@ -34,7 +34,7 @@ size_t *tatl_context_get_passed(struct tatl_context *); /* Get a Tatl context's total number of failing tests */ size_t *tatl_context_get_failed(struct tatl_context *); /* Get a Tatl context's tag */ -char *tatl_context_get_tag(struct tatl_context *); +char **tatl_context_get_tag(struct tatl_context *); /* Get a Tatl context's mute status */ int *tatl_context_get_mute(struct tatl_context *); /* Get a Tatl context's exit code */ diff --git a/src/context/get.c b/src/context/get.c index a1bcc83..a42eba9 100644 --- a/src/context/get.c +++ b/src/context/get.c @@ -32,8 +32,8 @@ size_t *tatl_context_get_failed(struct tatl_context *context) { return &context->_failed; } -char *tatl_context_get_tag(struct tatl_context *context) { - return context->_tag; +char **tatl_context_get_tag(struct tatl_context *context) { + return &context->_tag; } int *tatl_context_get_mute(struct tatl_context *context) { diff --git a/tests/tatl/test.c b/tests/tatl/test.c index b02b871..76ff812 100644 --- a/tests/tatl/test.c +++ b/tests/tatl/test.c @@ -38,7 +38,7 @@ TATL_TEST(tatl_context_get_failed_works) { return *tatl_context_get_failed(&context) == 1; } TATL_TEST(tatl_context_get_tag_works) { - return !strcmp(tatl_context_get_tag(&context), "hi"); + return !strcmp(*tatl_context_get_tag(&context), "hi"); } TATL_TEST(tatl_context_get_mute_works) { return *tatl_context_get_mute(&context) == 1; |