/* * 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 * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc. */ /********************************************************** * * TEST IDENTIFIER : getpagesize01 * * TEST TITLE : Basic tests for getpagesize(2) * * TEST CASE TOTAL : 1 * * AUTHOR : jitwxs * <jitwxs@foxmail.com> * * DESCRIPTION * This is a Phase I test for the getpagesize(2) system call. * It is intended to provide a limited exposure of the system call. * **********************************************************/
#include<errno.h> #include"tst_test.h"
staticvoidtestGetpagesize(void) { int size, ret_sysconf;
TEST(getpagesize());
if (TEST_RETURN == -1) { tst_res(TFAIL | TTERRNO, "getpagesize failed"); } else { size = getpagesize(); tst_res(TINFO, "Page Size is %d", size); ret_sysconf = sysconf(_SC_PAGESIZE); if (size == ret_sysconf) tst_res(TPASS, "getpagesize - Page size returned %d", ret_sysconf); else tst_res(TFAIL, "getpagesize - Page size returned %d", ret_sysconf); } }
/* * 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 * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc. */ /********************************************************** * * TEST IDENTIFIER : getpid01 * * TEST TITLE : Basic tests for getpid(2) * * TEST CASE TOTAL : 1 * * AUTHOR : jitwxs * <jitwxs@foxmail.com> * * DESCRIPTION * Testcase to check the basic functionality of getpid(). * **********************************************************/
#include<errno.h> #include"tst_test.h"
staticvoidtest_getpid(void) { TEST(getpid());
if (TEST_RETURN == -1) tst_res(TFAIL | TTERRNO, "getpid failed"); else tst_res(TPASS, "getpid returned %ld", TEST_RETURN); }
/* * 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 * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc. */ /********************************************************** * * TEST IDENTIFIER : unlink05 * * TEST TITLE : Basic tests for unlink(1) * * TEST CASE TOTAL : 1 * * AUTHOR : jitwxs * <jitwxs@foxmail.com> * * DESCRIPTION * It should/will be extended when full functional tests are written for * unlink(2). * **********************************************************/
/* * 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 * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc. */ /********************************************************** * * TEST IDENTIFIER : getppid02 * * TEST TITLE : Basic tests for getppid(2) * * TEST CASE TOTAL : 1 * * AUTHOR : jitwxs * <jitwxs@foxmail.com> * * DESCRIPTION * Testcase to check the basic functionality of the getppid() syscall. * **********************************************************/