public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] lib: Introduce tst_strttype()
@ 2018-11-08 12:55 Xiao Yang
  2018-11-08 12:55 ` [LTP] [PATCH 2/2] lib/tst_test.c: Restrict that tst_brk() only works with TBROK/TCONF Xiao Yang
  0 siblings, 1 reply; 24+ messages in thread
From: Xiao Yang @ 2018-11-08 12:55 UTC (permalink / raw)
  To: ltp

Rename strttype() to tst_strttype() and introduce the function
for old and new library.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 include/old/test.h | 2 +-
 include/tst_test.h | 3 +++
 lib/tst_res.c      | 4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/old/test.h b/include/old/test.h
index 0738237..3dce395 100644
--- a/include/old/test.h
+++ b/include/old/test.h
@@ -113,7 +113,7 @@ void tst_parse_opts(int argc, char *argv[], const option_t *user_optarg,
                     void (*user_help)(void));
 
 /* lib/tst_res.c */
-const char *strttype(int ttype);
+const char *tst_strttype(int ttype);
 
 void tst_resm_(const char *file, const int lineno, int ttype,
 	const char *arg_fmt, ...)
diff --git a/include/tst_test.h b/include/tst_test.h
index 2ebf746..5982638 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -222,6 +222,9 @@ extern void *TST_RET_PTR;
  */
 const char *tst_strerrno(int err);
 const char *tst_strsig(int sig);
+
+// Function to convert ttype to its name.
+const char *tst_strttype(int ttype);
 /*
  * Returns string describing status as returned by wait().
  *
diff --git a/lib/tst_res.c b/lib/tst_res.c
index c35f41b..8c69b75 100644
--- a/lib/tst_res.c
+++ b/lib/tst_res.c
@@ -139,7 +139,7 @@ struct pair {
 	return pair_arr[idx].name;                            \
 } while (0)
 
-const char *strttype(int ttype)
+const char *tst_strttype(int ttype)
 {
 	static const struct pair ttype_pairs[] = {
 		PAIR(TPASS)
@@ -296,7 +296,7 @@ static void tst_print(const char *tcid, int tnum, int ttype, const char *tmesg)
 	/*
 	 * Build the result line and print it.
 	 */
-	type = strttype(ttype);
+	type = tst_strttype(ttype);
 
 	if (T_mode == VERBOSE) {
 		size += snprintf(message + size, sizeof(message) - size,
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2019-01-08 13:11 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-08 12:55 [LTP] [PATCH 1/2] lib: Introduce tst_strttype() Xiao Yang
2018-11-08 12:55 ` [LTP] [PATCH 2/2] lib/tst_test.c: Restrict that tst_brk() only works with TBROK/TCONF Xiao Yang
2018-11-08 17:53   ` Jan Stancek
2018-11-09  2:46     ` Xiao Yang
2018-11-09  3:12       ` Xiao Yang
2018-11-09  7:54       ` Jan Stancek
2018-11-09  8:17         ` Xiao Yang
2018-11-09 17:52           ` Jan Stancek
2018-11-12  2:29             ` Xiao Yang
2018-12-11 15:17               ` Cyril Hrubis
2018-12-12  7:14                 ` Xiao Yang
2019-01-07 13:30                   ` Cyril Hrubis
2018-12-13  8:35                 ` [LTP] [PATCH v3 1/3] lib: Introduce tst_strttype() Xiao Yang
2018-12-13  8:35                   ` [LTP] [PATCH v3 2/3] lib/tst_test.c: Update result counters when calling tst_brk() Xiao Yang
2019-01-07 15:06                     ` Cyril Hrubis
2019-01-07 17:39                       ` Jan Stancek
2019-01-07 18:29                         ` Cyril Hrubis
2019-01-08 13:11                         ` Cyril Hrubis
2019-01-08  9:08                       ` Xiao Yang
2018-12-13  8:36                   ` [LTP] [PATCH v3 3/3] lib/tst_test.c: Convert TFAIL to TWARN in test cleanup Xiao Yang
2019-01-07 13:34                     ` Cyril Hrubis
2019-01-07 14:28                       ` Jan Stancek
2018-11-09  7:06     ` [LTP] [PATCH v2 1/2] lib: Introduce tst_strttype() Xiao Yang
2018-11-09  7:06       ` [LTP] [PATCH v2 2/2] lib/tst_test.c: Update result counters when calling tst_brk() Xiao Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox