public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] statvfs/statvfs01.c: cleanup
@ 2014-05-30  2:56 Zeng Linggang
  2014-05-30  2:57 ` [LTP] [PATCH 2/2] statvfs/statvfs02.c: add new errno testes Zeng Linggang
  0 siblings, 1 reply; 3+ messages in thread
From: Zeng Linggang @ 2014-05-30  2:56 UTC (permalink / raw)
  To: ltp-list

* Delete some useless commtents.

* Some cleanup.

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
---
 testcases/kernel/syscalls/statvfs/statvfs01.c | 49 +++++++--------------------
 1 file changed, 12 insertions(+), 37 deletions(-)

diff --git a/testcases/kernel/syscalls/statvfs/statvfs01.c b/testcases/kernel/syscalls/statvfs/statvfs01.c
index 306ca00..0ea882a 100644
--- a/testcases/kernel/syscalls/statvfs/statvfs01.c
+++ b/testcases/kernel/syscalls/statvfs/statvfs01.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) Wipro Technologies Ltd, 2005.  All Rights Reserved.
+ *    AUTHOR: Prashant P Yendigeri <prashant.yendigeri@wipro.com>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -14,25 +15,12 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
  */
-/**********************************************************
- *
- *    TEST IDENTIFIER   : statvfs01
- *
- *    EXECUTED BY       : root / superuser
- *
- *    TEST TITLE        : Basic tests for statvfs(2)
- *
- *    TEST CASE TOTAL   : 1
- *
- *    AUTHOR            : Prashant P Yendigeri
- *                        <prashant.yendigeri@wipro.com>
- *
+/*
  *    DESCRIPTION
  *      This is a Phase I test for the statvfs(2) system call.
  *      It is intended to provide a limited exposure of the system call.
  *	This call behaves similar to statfs.
- *
- **********************************************************/
+ */
 
 #include <stdio.h>
 #include <unistd.h>
@@ -43,15 +31,15 @@
 #include "test.h"
 #include "usctest.h"
 
-#define TEST_PATH "/"		/* Should be a mounted FS */
+#define TEST_PATH "/"
 
-void setup();
-void cleanup();
+static void setup(void);
+static void cleanup(void);
 
 char *TCID = "statvfs01";
 int TST_TOTAL = 1;
 
-int exp_enos[] = { 0 };		/* must be a 0 terminated list */
+int exp_enos[] = { 0 };
 
 int main(int ac, char **av)
 {
@@ -64,7 +52,6 @@ int main(int ac, char **av)
 
 	setup();
 
-	/* set the expected errnos... */
 	TEST_EXP_ENOS(exp_enos);
 
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
@@ -73,11 +60,12 @@ int main(int ac, char **av)
 
 		TEST(statvfs(TEST_PATH, &buf));
 
-		if (TEST_RETURN == -1)
+		if (TEST_RETURN == -1) {
 			tst_resm(TFAIL | TERRNO, "statvfs(%s, ...) failed",
 				 TEST_PATH);
-		else
+		} else {
 			tst_resm(TPASS, "statvfs(%s, ...) passed", TEST_PATH);
+		}
 
 	}
 
@@ -96,30 +84,17 @@ int main(int ac, char **av)
 	tst_resm(TINFO, "file system max filename length = %lu", buf.f_namemax);
 
 	cleanup();
-
 	tst_exit();
 }
 
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-void setup(void)
+static void setup(void)
 {
-
 	tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
 	TEST_PAUSE;
 }
 
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *              completion or premature exit.
- ***************************************************************/
-void cleanup(void)
+static void cleanup(void)
 {
-	/*
-	 * print timing stats if that option was specified.
-	 * print errno log if that option was specified.
-	 */
 	TEST_CLEANUP;
 }
-- 
1.8.4.2




------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2014-06-03 15:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-30  2:56 [LTP] [PATCH 1/2] statvfs/statvfs01.c: cleanup Zeng Linggang
2014-05-30  2:57 ` [LTP] [PATCH 2/2] statvfs/statvfs02.c: add new errno testes Zeng Linggang
2014-06-03 15:29   ` chrubis

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