From patchwork Sun Aug 31 08:43:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waldemar Brodkorb X-Patchwork-Id: 384528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 0E2E414017C for ; Sun, 31 Aug 2014 18:44:19 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0FE2891056; Sun, 31 Aug 2014 08:44:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id voFVWAX-q1Ul; Sun, 31 Aug 2014 08:44:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 9B54F8EA3B; Sun, 31 Aug 2014 08:44:14 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id E62A81C25C3 for ; Sun, 31 Aug 2014 08:44:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E20758BE77 for ; Sun, 31 Aug 2014 08:44:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 54F-s94nImiV for ; Sun, 31 Aug 2014 08:44:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from helium.waldemar-brodkorb.de (helium.waldemar-brodkorb.de [89.238.66.15]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 1F9788AF85 for ; Sun, 31 Aug 2014 08:44:11 +0000 (UTC) Received: by helium.waldemar-brodkorb.de (Postfix, from userid 1000) id 72EEC10530; Sun, 31 Aug 2014 10:44:10 +0200 (CEST) From: Waldemar Brodkorb To: uclibc@uclibc.org Subject: [PATCH 1/3] test: disable test when UCLIBC_HAS_XLOCALE is n Date: Sun, 31 Aug 2014 10:43:58 +0200 Message-Id: <1409474640-4870-1-git-send-email-wbx@openadk.org> X-Mailer: git-send-email 1.7.10.4 X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: uclibc-bounces@uclibc.org Sender: uclibc-bounces@uclibc.org wcsftime() is only implemented when locale support in uClibc is activated. So test will always fail when locale is deactivated by the user. Rename file name to be consistent with other test file names. Signed-off-by: Waldemar Brodkorb --- test/time/Makefile.in | 2 +- test/time/tst-wcsftime.c | 39 +++++++++++++++++++++++++++++++++++++++ test/time/tst_wcsftime.c | 39 --------------------------------------- 3 files changed, 40 insertions(+), 40 deletions(-) create mode 100644 test/time/tst-wcsftime.c delete mode 100644 test/time/tst_wcsftime.c diff --git a/test/time/Makefile.in b/test/time/Makefile.in index 05f73a4..3f1d1a1 100644 --- a/test/time/Makefile.in +++ b/test/time/Makefile.in @@ -5,7 +5,7 @@ TESTS_DISABLED := bug-asctime bug-asctime_r time tst-mktime2 tst-posixtz \ tst-strftime tst-strptime tst-timezone ifneq ($(UCLIBC_HAS_XLOCALE),y) -TESTS_DISABLED += tst-ftime_l +TESTS_DISABLED += tst-ftime_l tst-wcsftime endif CFLAGS_tst-strptime2 := -std=c99 diff --git a/test/time/tst-wcsftime.c b/test/time/tst-wcsftime.c new file mode 100644 index 0000000..6e35f1e --- /dev/null +++ b/test/time/tst-wcsftime.c @@ -0,0 +1,39 @@ +#include +#include +#include +#ifdef __UCLIBC_HAS_WCHAR__ +#include + +int +main (int argc, char *argv[]) +{ + wchar_t buf[200]; + time_t t; + struct tm *tp; + int result = 0; + size_t n; + + time (&t); + tp = gmtime (&t); + + n = wcsftime (buf, sizeof (buf) / sizeof (buf[0]), + L"%H:%M:%S %Y-%m-%d\n", tp); + if (n != 21) + result = 1; + + wprintf (L"It is now %ls", buf); + + wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%A\n", tp); + + wprintf (L"The weekday is %ls", buf); + + return result; +} + +#else +int main(void) +{ + puts("Test requires WCHAR support; skipping"); + return 0; +} +#endif diff --git a/test/time/tst_wcsftime.c b/test/time/tst_wcsftime.c deleted file mode 100644 index 6e35f1e..0000000 --- a/test/time/tst_wcsftime.c +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include -#ifdef __UCLIBC_HAS_WCHAR__ -#include - -int -main (int argc, char *argv[]) -{ - wchar_t buf[200]; - time_t t; - struct tm *tp; - int result = 0; - size_t n; - - time (&t); - tp = gmtime (&t); - - n = wcsftime (buf, sizeof (buf) / sizeof (buf[0]), - L"%H:%M:%S %Y-%m-%d\n", tp); - if (n != 21) - result = 1; - - wprintf (L"It is now %ls", buf); - - wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%A\n", tp); - - wprintf (L"The weekday is %ls", buf); - - return result; -} - -#else -int main(void) -{ - puts("Test requires WCHAR support; skipping"); - return 0; -} -#endif