Open Source Telephony
 help / color / mirror / Atom feed
From: Yang Gu <yang.gu@intel.com>
To: ofono@ofono.org
Subject: [PATCH 06/19] Replace check_text with check_common_text
Date: Mon, 10 May 2010 18:38:49 +0800	[thread overview]
Message-ID: <1273487942-27213-6-git-send-email-yang.gu@intel.com> (raw)
In-Reply-To: <1273487942-27213-1-git-send-email-yang.gu@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2862 bytes --]

---
 unit/test-stkutil.c |   31 +++++++++++++++----------------
 1 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index e1f6a3e..11b088b 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -52,6 +52,17 @@ static inline void check_common_bool(const ofono_bool_t command,
 	g_assert(command == test);
 }
 
+static inline void check_common_text(const char *command, const char *test)
+{
+	if (test == NULL) {
+		g_assert(command == NULL);
+		return;
+	}
+
+	g_assert(command != NULL);
+	g_assert(g_str_equal(command, test));
+}
+
 /* Defined in TS 102.223 Section 8.8 */
 static void check_duration(const struct stk_duration *command,
 					const struct stk_duration *test)
@@ -68,18 +79,6 @@ static void check_response_length(const struct stk_response_length *command,
 	g_assert(command->max == test->max);
 }
 
-/* Defined in TS 102.223 Section 8.15 */
-static inline void check_text(const char *command, const char *test)
-{
-	if (test == NULL) {
-		g_assert(command == NULL);
-		return;
-	}
-
-	g_assert(command != NULL);
-	g_assert(g_str_equal(command, test));
-}
-
 /* Defined in TS 102.223 Section 8.31 */
 static void check_icon_id(const struct stk_icon_id *command,
 					const struct stk_icon_id *test)
@@ -347,7 +346,7 @@ static void test_display_text(gconstpointer data)
 	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_DISPLAY);
 
 	g_assert(command->display_text.text);
-	check_text(command->display_text.text, test->text);
+	check_common_text(command->display_text.text, test->text);
 	check_icon_id(&command->display_text.icon_id, &test->icon_id);
 	check_common_bool(command->display_text.immediate_response,
 						test->immediate_response);
@@ -1284,7 +1283,7 @@ static void test_get_inkey(gconstpointer data)
 	g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
 
 	g_assert(command->get_inkey.text);
-	check_text(command->get_inkey.text, test->text);
+	check_common_text(command->get_inkey.text, test->text);
 	check_icon_id(&command->get_inkey.icon_id, &test->icon_id);
 	check_duration(&command->get_inkey.duration, &test->duration);
 	check_text_attr(&command->get_inkey.text_attr,
@@ -2590,9 +2589,9 @@ static void test_get_input(gconstpointer data)
 
 	if (test->text)
 		g_assert(command->get_input.text);
-	check_text(command->get_input.text, test->text);
+	check_common_text(command->get_input.text, test->text);
 	check_response_length(&command->get_input.resp_len, &test->resp_len);
-	check_text(command->get_input.default_text, test->default_text);
+	check_common_text(command->get_input.default_text, test->default_text);
 	check_icon_id(&command->get_input.icon_id, &test->icon_id);
 	check_text_attr(&command->get_input.text_attr,
 						&test->text_attr);
-- 
1.7.0.4


  parent reply	other threads:[~2010-05-10 10:38 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-10 10:38 [PATCH 01/19] stkutil: Free default text for get input parser Yang Gu
2010-05-10 10:38 ` [PATCH 02/19] test-stkutil: Add unit test " Yang Gu
2010-05-11 19:25   ` Denis Kenzior
2010-05-10 10:38 ` [PATCH 03/19] stk: Unify variable names to use abbreviation Yang Gu
2010-05-11 19:25   ` Denis Kenzior
2010-05-10 10:38 ` [PATCH 04/19] test-stkutil: Use enum for icon_id Yang Gu
2010-05-11 19:25   ` Denis Kenzior
2010-05-10 10:38 ` [PATCH 05/19] stkutil: Add play tone proactive command parser Yang Gu
2010-05-11 19:26   ` Denis Kenzior
2010-05-10 10:38 ` Yang Gu [this message]
2010-05-11 19:26   ` [PATCH 06/19] Replace check_text with check_common_text Denis Kenzior
2010-05-10 10:38 ` [PATCH 07/19] stkutil: Refactor parser for tone objects Yang Gu
2010-05-11 19:26   ` Denis Kenzior
2010-05-10 10:38 ` [PATCH 08/19] test-stkutil: Add unit test for play tone parser Yang Gu
2010-05-11 19:27   ` Denis Kenzior
2010-05-10 10:38 ` [PATCH 09/19] stkutil: Add poll interval proactive command parser Yang Gu
2010-05-11 19:23   ` Denis Kenzior
2010-05-12  9:03     ` Gu, Yang
2010-05-12 14:21       ` Denis Kenzior
2010-05-10 10:38 ` [PATCH 10/19] test-stkutil: Add unit test for poll interval parser Yang Gu
2010-05-10 10:38 ` [PATCH 11/19] stkutil: Add setup menu proactive command parser Yang Gu
2010-05-11 19:21   ` Denis Kenzior
2010-05-12  8:53     ` Gu, Yang
2010-05-12 14:43       ` Denis Kenzior
2010-05-10 10:38 ` [PATCH 12/19] test-stkutil: Add unit test for setup menu parser Yang Gu
2010-05-10 10:38 ` [PATCH 13/19] stkutil: Add select item proactive command parser Yang Gu
2010-05-10 10:38 ` [PATCH 14/19] test-stkutil: Add unit test for select item parser Yang Gu
2010-05-10 10:38 ` [PATCH 15/19] test-stkutil: Use dedicated functions to check Yang Gu
2010-05-10 10:38 ` [PATCH 16/19] stkutil: Parse cdma tpdu in send sms parser Yang Gu
2010-05-11 19:38   ` Denis Kenzior
2010-05-10 10:39 ` [PATCH 17/19] test-stkutil: Refactor test for " Yang Gu
2010-05-10 10:39 ` [PATCH 18/19] stkutil: Add setup call proactive command parser Yang Gu
2010-05-10 10:39 ` [PATCH 19/19] test-stkutil: Add unit test for setup call parser Yang Gu
2010-05-11 19:24 ` [PATCH 01/19] stkutil: Free default text for get input parser Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1273487942-27213-6-git-send-email-yang.gu@intel.com \
    --to=yang.gu@intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox