From 91ec072a82f0e0bb442997e558acfbec6b6952f2 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 19 Jun 2022 19:26:54 -0700 Subject: refactor(get): return pointer to string --- include/tatl/context/get.h | 2 +- src/context/get.c | 4 ++-- 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; -- cgit v1.2.3