Additional test for mode ADJ_OFFSET_SINGLESHOT.
Signed-off-by: DAN LI <[email protected]>
---
testcases/kernel/syscalls/adjtimex/adjtimex01.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/testcases/kernel/syscalls/adjtimex/adjtimex01.c
b/testcases/kernel/syscalls/adjtimex/adjtimex01.c
index b995e8e..d16a5f3 100644
--- a/testcases/kernel/syscalls/adjtimex/adjtimex01.c
+++ b/testcases/kernel/syscalls/adjtimex/adjtimex01.c
@@ -42,7 +42,7 @@ static void setup(void);
static void cleanup(void);
char *TCID = "adjtimex01";
-int TST_TOTAL = 1;
+int TST_TOTAL = 2;
static struct timex tim_save;
@@ -66,10 +66,26 @@ int main(int ac, char **av)
TEST(adjtimex(&tim_save));
if ((TEST_RETURN >= 0) && (TEST_RETURN <= 5)) {
- tst_resm(TPASS, "adjtimex() returned %ld", TEST_RETURN);
+ tst_resm(TPASS, "adjtimex() with mode %u returned %ld",
+ SET_MODE, TEST_RETURN);
} else {
- tst_resm(TFAIL | TTERRNO, "Test Failed, adjtimex()"
- "returned %ld", TEST_RETURN);
+ tst_resm(TFAIL | TTERRNO,
+ "Test Failed, adjtimex() with mode %u "
+ "returned %ld", SET_MODE, TEST_RETURN);
+ }
+
+ /* Call adjtimex(2) */
+ tim_save.modes = ADJ_OFFSET_SINGLESHOT;
+
+ TEST(adjtimex(&tim_save));
+
+ if ((TEST_RETURN >= 0) && (TEST_RETURN <= 5)) {
+ tst_resm(TPASS, "adjtimex() with mode %u returned %ld",
+ ADJ_OFFSET_SINGLESHOT, TEST_RETURN);
+ } else {
+ tst_resm(TFAIL | TTERRNO,
+ "Test Failed, adjtimex() with mode %u returned "
+ "%ld", ADJ_OFFSET_SINGLESHOT, TEST_RETURN);
}
}
--
1.8.1
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list