plateform stringclasses 1
value | repo_name stringclasses 2
values | name stringlengths 1 78 | ext stringclasses 2
values | path stringlengths 15 1.11k | size int64 1 8.55M | source_encoding stringclasses 11
values | md5 stringlengths 32 32 | text stringlengths 0 8.49M |
|---|---|---|---|---|---|---|---|---|
google | android | tst_epoll | .c | platform/external/ltp/lib/tst_epoll.c | 1,506 | utf_8 | 1061e4d09a4404dd98d501a45adb5590 | */
#define _GNU_SOURCE
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_epoll.h"
int safe_epoll_create1(const char *const file, const int lineno,
const int flags)
{
const char *flags_str;
int ret = epoll_create1(flags);
switch (flags) {
case EPOLL_CLOEXEC:
flags_str = "EPOLL_CLOEXEC";
b... |
google | android | tst_checksum | .c | platform/external/ltp/lib/tst_checksum.c | 3,507 | utf_8 | 9e1f07926881602558c4b93357bae223 | #include "tst_checksum.h"
static const uint32_t crc32c_table[] = {
0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4,
0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb,
0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b,
0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24,
0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b,
0xd7c45... |
google | android | tst_safe_macros | .c | platform/external/ltp/lib/tst_safe_macros.c | 12,498 | utf_8 | 1e5cca15cec7cb4553e214cf9f32396c | */
#define _GNU_SOURCE
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <sched.h>
#include <sys/ptrace.h>
#include "config.h"
#ifdef HAVE_SYS_FANOTIFY_H
# include <sys/fanotify.h>
#endif
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "lapi/setns.h"
#include "tst_safe_macros.h"
#include "... |
google | android | tst_get_bad_addr | .c | platform/external/ltp/lib/tst_get_bad_addr.c | 1,051 | utf_8 | a5be525386022b55626efcc315fccf10 | /*
*/
#include <sys/mman.h>
#include "test.h"
#include "tst_get_bad_addr.h"
void *tst_get_bad_addr(void (*cleanup_fn) (void))
{
void *bad_addr;
bad_addr = mmap(0, 1, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
if (bad_addr == MAP_FAILED)
tst_brkm(TBROK, cleanup_fn, "mmap() failed to get bad address");
return ... |
google | android | tst_res | .c | platform/external/ltp/lib/tst_res.c | 15,294 | utf_8 | 8d24ccd27ed6dc2307e54c84737e771a | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/NoticeExplan/
*/
#de... |
google | android | tst_status | .c | platform/external/ltp/lib/tst_status.c | 1,239 | utf_8 | bd2fa05f4537c169c8021fc19985d49c | */
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
static char buf[32];
const char *exited(int status)
{
snprintf(buf, sizeof(buf), "exited with %i", WEXITSTATUS(status));
return buf;
}
const char *signaled(int status)
{
snprintf(buf, sizeof(buf), "k... |
google | android | tst_test | .c | platform/external/ltp/lib/tst_test.c | 37,136 | utf_8 | 95449b062923ad8f6eb4ef9f7c6940f4 | */
#include <limits.h>
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <math.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_device.h"
#include "lapi/abi... |
google | android | self_exec | .c | platform/external/ltp/lib/self_exec.c | 4,839 | utf_8 | eedcc454b6cffb799bbf178bb3c8e48d | /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: t -*- */
/*
* self_exec.c: self_exec magic required to run child functions on uClinux
*
* 55 Byward Market Square, 2nd Floor North, Ottawa, ON K1N 9C3, Canada
*/
#define _GNU_SOURCE /* for asprintf */
#include "config.h"
#ifdef UCLINUX
#include <stdarg.h>
#inclu... |
google | android | tst_buffers | .c | platform/external/ltp/lib/tst_buffers.c | 2,605 | utf_8 | f7585acf3e357325b42691bd91783dd4 | */
#include <sys/mman.h>
#include <stdlib.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
struct map {
void *addr;
size_t size;
size_t buf_shift;
struct map *next;
};
static struct map *maps;
static void setup_canary(struct map *map)
{
size_t i;
char *buf = map->addr;
for (i = 0; i < map->buf_shift/2; i++)... |
google | android | tst_checkpoint | .c | platform/external/ltp/lib/tst_checkpoint.c | 4,569 | utf_8 | d3e661b65e98e188e03ebcb87ed73f1e | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdint.h>
#include <limits.h>
#include <errno.h>
#include <sys/syscall.h>
#include "test.h"
#include "safe_macros.h"
#include "lapi/futex.h"
#define DEFAULT_MSEC_TIMEOUT 10000
futex_t *tst_futexes;
unsigned int tst_max_futexes;
void tst_che... |
google | android | tst_timer | .c | platform/external/ltp/lib/tst_timer.c | 1,254 | utf_8 | 5a3d3147863c5699b3211bf4cd0beed2 | */
#include <errno.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_timer.h"
#include "tst_clocks.h"
#include "lapi/posix_clocks.h"
static struct timespec start_time, stop_time;
static clockid_t clock_id;
void tst_timer_check(clockid_t clk_id)
{
if (tst_clock_gettime(clk_id, &start_time)) {
if (er... |
google | android | parse_opts | .c | platform/external/ltp/lib/parse_opts.c | 16,434 | utf_8 | 1caeebf1c2bb3950f6aa3e042f3c7507 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/NoticeExplan/
*/
#in... |
google | android | tst_af_alg | .c | platform/external/ltp/lib/tst_af_alg.c | 5,917 | utf_8 | 8a4412d1a9756619855b9733e928ab9e | */
#include <errno.h>
#include <stdlib.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_af_alg.h"
#include "lapi/socket.h"
int tst_alg_create(void)
{
const long ret = socket(AF_ALG, SOCK_SEQPACKET, 0);
if (ret >= 0)
return ret;
if (errno == EAFNOSUPPORT)
tst_brk(TCONF, "kernel doesn't support ... |
google | android | tst_cmd | .c | platform/external/ltp/lib/tst_cmd.c | 8,412 | utf_8 | 0536a2264718d0b6f1d8c0916912d411 | /*
*/
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include "test.h"
#include "tst_cmd.h"
#include "tst_private.h"
#define OPEN_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
#define OPEN_FLAGS (O_WRONL... |
google | android | safe_stdio | .c | platform/external/ltp/lib/safe_stdio.c | 2,584 | utf_8 | 42a96ee83c383e133d4edcbb75ab6e9e | /*
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define _GNU_SOURCE
#include <stdarg.h>
#include <stdio.h>
#include <errno.h>
#include "test.h"
#include "safe_stdio_fn.h"
FILE *safe_fopen(const char *file, const int lineno, void (cleanup_fn)(void),
const char *path, const char... |
google | android | tst_kconfig | .c | platform/external/ltp/lib/tst_kconfig.c | 10,241 | utf_8 | 8c434b9b219671f79d76adfa7d77eb0d | */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <sys/utsname.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_private.h"
#include "tst_kconfig.h"
#include "tst_bool_expr.h"
static int kconfig_skip_check(void)
{
char *skipped = getenv("KCONFIG_SKIP_CHECK");
... |
google | android | tst_sig_proc | .c | platform/external/ltp/lib/tst_sig_proc.c | 471 | utf_8 | 68c7c7758909bf83173e68982e845fdb | */
#include <stdlib.h>
#include <sys/types.h>
#include "tst_sig_proc.h"
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
pid_t create_sig_proc(int sig, int count, unsigned int usec)
{
pid_t pid, cpid;
pid = getpid();
cpid = SAFE_FORK();
if (cpid == 0) {
while (count-- > 0) {
usleep(usec);
if (kill(pid, si... |
google | android | tst_rtctime | .c | platform/external/ltp/lib/tst_rtctime.c | 2,939 | utf_8 | ee074bb82f63942dc874d0d4011428b5 | *
* This file is a implementation for rtc set read,covert to tm functions
*/
#include <stdbool.h>
#include <limits.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_rtctime.h"
#define LEAPS_THRU_END_OF(y) ((y) / 4 - (y) / 100 + (y) / 400)
static const unsigned char rtc_days_in_month[] = {
31, 28, 3... |
google | android | tst_ioctl | .c | platform/external/ltp/lib/tst_ioctl.c | 728 | utf_8 | f7bec9eaab4198050ffa3b1ed11ee057 | #include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <linux/fs.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
int tst_fibmap(const char *filename)
{
/* test if FIBMAP ioctl is supported */
int fd, block = 0;
fd = open(filename, O_RDWR | O_CREAT, 0666);
if (fd < 0) {
tst_... |
google | android | tst_wallclock | .c | platform/external/ltp/lib/tst_wallclock.c | 3,160 | utf_8 | 1ba4e123a1c9a19b0aa6d30200e22f93 | */
#include <errno.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_timer.h"
#include "tst_clocks.h"
#include "tst_rtctime.h"
#include "tst_wallclock.h"
#include "lapi/posix_clocks.h"
static struct timespec real_begin, mono_begin;
static struct rtc_time rtc_begin;
static int clock_saved;
void tst_wal... |
google | android | tst_clocks | .c | platform/external/ltp/lib/tst_clocks.c | 3,516 | utf_8 | b4734c6cf8b89a6637ffe9fb9761990c | */
#include <time.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_timer.h"
#include "tst_clocks.h"
#include "lapi/syscalls.h"
#include "lapi/posix_clocks.h"
typedef int (*mysyscall)(clockid_t clk_id, void *ts);
int syscall_supported_by_kernel(long sysnr)
{
int ret;
ret = syscall(sysnr, 0, NULL);
... |
google | android | tst_process_state | .c | platform/external/ltp/lib/tst_process_state.c | 1,659 | utf_8 | 7b436eb97f3592962719637a41a5a8fb | */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "test.h"
#include "tst_process_state.h"
int tst_process_state_wait(const char *file, const int lineno,
void (*cleanup_fn)(void), pid_t pid,
const char state, unsigned int msec_timeout)
{
char proc_path[128], cur_state;
unsigned int mse... |
google | android | tst_rand_data | .c | platform/external/ltp/lib/tst_rand_data.c | 17,143 | utf_8 | 5f4e2f8e9e2e7cc7a92c56afda1a5e74 | #include "tst_rand_data.h"
const size_t tst_rand_data_len = 4096;
const char *const tst_rand_data =
"\xa5\xf8\xde\x82\x8a\x94\x8d\xa0\x02\x67\x79\x53\xf9\x77\x34\x69\x8d\xdb\xe6\xfc"
"\xa2\xca\x15\xd0\x6d\x0c\xc2\x53\x88\xef\x2c\xd9\x9c\x03\x9c\xff\x3f\xff\x43\x87"
"\x32\x33\x72\x4a\x8b\xc1\xb9\x32\xcc\x63\x3d\xe6\x60\... |
google | android | tst_sys_conf | .c | platform/external/ltp/lib/tst_sys_conf.c | 3,104 | utf_8 | 02ef22eaccab2bf77a0bc71ed59aec88 | */
#include <limits.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_sys_conf.h"
struct tst_sys_conf {
char path[PATH_MAX];
char value[PATH_MAX];
struct tst_sys_conf *next;
};
static struct tst_sys_conf *save_restore_data;
static void prin... |
google | android | tst_crypto | .c | platform/external/ltp/lib/tst_crypto.c | 2,595 | utf_8 | c0ebf5eb853a9f3d0c847257f01926ca | */
#include <errno.h>
#include <stdio.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_crypto.h"
#include "tst_netlink.h"
void tst_crypto_open(struct tst_crypto_session *ses)
{
const long ret = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_CRYPTO);
if (ret < 0 && errno == EPROTONOSUPPORT)
tst_brk(TCONF ... |
google | android | tst_timer_test | .c | platform/external/ltp/lib/tst_timer_test.c | 11,135 | utf_8 | c07645ee6c75ef9d1cd4097d7432484a | */
#include <sys/prctl.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_clocks.h"
#include "tst_timer_test.h"
#define MAX_SAMPLES 500
static const char *scall;
static void (*setup)(void);
static void (*cleanup)(void);
stat... |
google | android | tst_parse_opts | .c | platform/external/ltp/lib/tst_parse_opts.c | 1,376 | utf_8 | 0b2f76d1509516a5fbcff8f88c9e2087 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "test.h"
#include "ltp_priv.h"
void tst_parse_opts(int argc, char *argv[], const option_t *user_optarg,
void (*user_help)(void))
{
const char *msg;
msg = parse_opts(argc, argv, user_optarg, user_help);
if (msg)
tst_b... |
google | android | tst_fs_link_count | .c | platform/external/ltp/lib/tst_fs_link_count.c | 4,876 | utf_8 | 64af5befe730862a545e79c4839043a0 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "test.h"
#include "usctest.h"
#include "safe_macros.h"
#define MAX_SANE_HARD_LINKS 65535
/*
* filesystems whose subdir limit is less tha... |
google | android | tst_thread_state | .c | platform/external/ltp/lib/tst_thread_state.c | 734 | utf_8 | 7e7b7451b5f8c2f14c08679fad498c6d | */
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include "tst_safe_file_ops.h"
#include "tst_process_state.h"
int tst_thread_state_wait(pid_t tid, const char state,
unsigned int msec_timeout)
{
char proc_path[128], cur_state;
unsigned int msecs = 0;
snprintf(proc_path, sizeof(p... |
google | android | tst_fs_setup | .c | platform/external/ltp/lib/tst_fs_setup.c | 1,094 | utf_8 | 8b2c283c2c76a6654a83f7b086232bd2 | #include <dirent.h>
#include <errno.h>
#include <sys/mount.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_fs.h"
#define TST_FS_SETUP_OVERLAYFS_MSG "overlayfs is not configured in this kernel"
#define TST_FS_SETUP_OVERLAYFS_CONFIG "lowerdir="OVL_LOWER",upperdir="OVL_UPPER",workdir="OVL_WORK
void crea... |
google | android | tst_fs_type | .c | platform/external/ltp/lib/tst_fs_type.c | 1,575 | utf_8 | a4e53e0665f54a34e9d365eb53ebc7dc | */
#include <sys/vfs.h>
#include "test.h"
#include "tst_fs.h"
long tst_fs_type_(void (*cleanup)(void), const char *path)
{
struct statfs sbuf;
if (statfs(path, &sbuf)) {
tst_brkm(TBROK | TERRNO, cleanup,
"tst_fs_type: Failed to statfs(%s)", path);
return 0;
}
return sbuf.f_type;
}
const char *tst_fs... |
google | android | tst_safe_file_at | .c | platform/external/ltp/lib/tst_safe_file_at.c | 4,987 | utf_8 | 2d659c38d971e1332790b9b68cb2d215 | */
#define _GNU_SOURCE
#include <stdio.h>
#include "lapi/fcntl.h"
#include "tst_safe_file_at.h"
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
static char fd_path[PATH_MAX];
const char *tst_decode_fd(const int fd)
{
ssize_t ret;
char proc_path[32];
if (fd < 0)
return "!";
sprintf(proc_path, "/proc/self/fd/%d"... |
google | android | tst_fill_fs | .c | platform/external/ltp/lib/tst_fill_fs.c | 2,494 | utf_8 | 45d3ba2e18d7542ea76f837432281aa2 | */
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/statvfs.h>
#include <sys/uio.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "lapi/fcntl.h"
#include "tst_fs.h"
#include "tst_rand_data.h"
#include "tst_safe_file_at.h"
void fill_random(const char *path, int verbose)
{
int i = 0;... |
google | android | tst_kernel | .c | platform/external/ltp/lib/tst_kernel.c | 4,539 | utf_8 | 061c235ac95fee8722fa55088cec5484 | /*
*/
#include <sys/personality.h>
#include <sys/utsname.h>
#include <limits.h>
#include "test.h"
#include "tst_kernel.h"
#include "old_safe_stdio.h"
static int get_kernel_bits_from_uname(struct utsname *buf)
{
if (uname(buf)) {
tst_brkm(TBROK | TERRNO, NULL, "uname()");
return -1;
}
return strstr(buf->machine,... |
google | android | random_range | .c | platform/external/ltp/lib/random_range.c | 22,073 | utf_8 | 7c6757e94f7a0b32992fdb5858d747a7 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/NoticeExplan/
*/
#in... |
google | android | tst_safe_timerfd | .c | platform/external/ltp/lib/tst_safe_timerfd.c | 1,557 | utf_8 | 339a4f6a7fe41d58a90d389cf44d19e0 | */
#include "tst_safe_timerfd.h"
#include "lapi/timerfd.h"
#include "tst_clocks.h"
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#define TTYPE (errno == ENOTSUP ? TCONF : TBROK)
int safe_timerfd_create(const char *file, const int lineno,
int clockid, int flags)
{
int fd;
fd = timerfd_create(clockid, fl... |
google | android | tst_taint | .c | platform/external/ltp/lib/tst_taint.c | 2,698 | utf_8 | 7d75aaeb9490218c946bbb02db4a1fc5 | */
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_taint.h"
#include "tst_safe_stdio.h"
#define TAINT_FILE "/proc/sys/kernel/tainted"
static unsigned int taint_mask = -1;
static const char *const taint_strings[] = {
"G (Propriety module loaded)",
"F (Module force loaded)",
"S (Running on out of spec... |
google | android | safe_file_ops | .c | platform/external/ltp/lib/safe_file_ops.c | 9,703 | utf_8 | e0f18ecb97098d745fb7745cf6f727a4 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <utime.h>
#include "test.h"
#include "safe_file_ops_fn.h"
int tst_count_scan... |
google | android | tst_module | .c | platform/external/ltp/lib/tst_module.c | 3,045 | utf_8 | e6ffb73e13ef91e30b7f516642d0df2c | /*
*
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "test.h"
#include "ltp_priv.h"
#include "old_module.h"
void tst_module_exists_(void (cleanup_fn)(void),
const char *mod_name, char **mod_path)
{
/* check current working directory */
if (access(mod_name, F_OK) == 0) {
... |
google | android | tst_resource | .c | platform/external/ltp/lib/tst_resource.c | 3,798 | utf_8 | 0e18872e77be4678156e7bf0b6d45687 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <pthread.h>
#include "test.h"
#include "old_resource.h"
#include "ltp_priv.h"
#ifndef PATH_MAX
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 1024
#endif
#endif
static pthread_mutex_t tmutex = PTHREAD_MUTEX_INITIALIZER;... |
google | android | tst_pid | .c | platform/external/ltp/lib/tst_pid.c | 4,067 | utf_8 | 3a2c47d15e29ebcfc62601dc18fdfdef | /*
*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include "test.h"
#include "tst_pid.h"
#include "old_safe_file_ops.h"
#include "tst_safe... |
google | android | tst_fips | .c | platform/external/ltp/lib/tst_fips.c | 452 | utf_8 | b17cdb30f30bec3e8680c5fd41c5c034 | */
#define TST_NO_DEFAULT_MAIN
#define PATH_FIPS "/proc/sys/crypto/fips_enabled"
#include "tst_test.h"
#include "tst_safe_macros.h"
#include "tst_fips.h"
int tst_fips_enabled(void)
{
int fips = 0;
if (access(PATH_FIPS, R_OK) == 0) {
SAFE_FILE_SCANF(PATH_FIPS, "%d", &fips);
}
tst_res(TINFO, "FIPS: %s", fips ? "on... |
google | android | tst_netdevice | .c | platform/external/ltp/lib/tst_netdevice.c | 13,162 | utf_8 | 5d36426c260cd07cd44edd8c99e56d7c | */
#include <asm/types.h>
#include <linux/veth.h>
#include <sys/socket.h>
#include <net/if.h>
#include "lapi/rtnetlink.h"
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_rtnetlink.h"
#include "tst_netdevice.h"
static struct tst_rtnl_context *create_request(const char *file,
const int lineno, unsigned ... |
google | android | tst_ansi_color | .c | platform/external/ltp/lib/tst_ansi_color.c | 966 | utf_8 | 09452109d5d945de3199e1312fd3467b | */
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include "tst_res_flags.h"
#include "tst_ansi_color.h"
char* tst_ttype2color(int ttype)
{
switch (TTYPE_RESULT(ttype)) {
case TPASS:
return ANSI_COLOR_GREEN;
break;
case TFAIL:
return ANSI_COLOR_RED;
break;
case TBROK:
return ANSI_COLOR_RED;
b... |
google | android | get_path | .c | platform/external/ltp/lib/get_path.c | 2,772 | utf_8 | 95666e86f9972a58bcc669610df28a5f | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* Looks for binary prog_name in $PATH.
*
* If such file exists and if you are able at least to read it, zero is
* returned and absolute path to the file is filled into buf. In case buf is
* too short to hold the absolute path + prog_nam... |
google | android | tst_supported_fs_types | .c | platform/external/ltp/lib/tst_supported_fs_types.c | 3,573 | utf_8 | e56d50a0e57f36c722707e697a8d0d5a | */
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/wait.h>
#include <sys/quota.h>
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_fs.h"
/*
* NOTE: new filesystem should be also added to
* lib/newlib_tests/shell/tst_{all_filesystems_skip,skip_filesystems}... |
google | android | cloner | .c | platform/external/ltp/lib/cloner.c | 4,637 | utf_8 | eca7aa5762ad97853e6f536ee18a2622 | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sched.h>
#include <stdarg.h>
#include "config.h"
#include "tst_clone.h"
#unde... |
google | android | tst_dir_is_empty | .c | platform/external/ltp/lib/tst_dir_is_empty.c | 1,353 | utf_8 | 7ad2b008c8457b7dd4d8a6b7ff2c1eb0 | /*
*
*/
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
#include "test.h"
#include "safe_macros.h"
int tst_dir_is_empty_(void (cleanup_fn)(void), const char *name, int verbose)
{
struct dirent *entry;
DIR *dir = SAFE_OPENDIR(cleanup_fn, name);
int ret = 1;
while ((entry = SAFE_READDIR(cleanup_fn, d... |
google | android | tst_bool_expr | .c | platform/external/ltp/lib/tst_bool_expr.c | 8,275 | utf_8 | 44f0b3daf232a17a678bfc708caf008c | */
/*
* Boolean expression is evaluated in three steps.
*
* First of all the string containing the expression is tokenized. The
* tokenizer runs twice and we only count number of tokens in the first pass in
* order to simplify the memory allocation.
*
* Secondly the the expression is transformed to a postfix (R... |
google | android | tst_cpu | .c | platform/external/ltp/lib/tst_cpu.c | 2,878 | utf_8 | 7a708c8ebffb2edb90911935c41d5473 | /*
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "lapi/cpuset.h"
#include <stdlib.h>
#include <unistd.h>
#include "test.h"
#include "safe_macros.h"
long tst_ncpus(void)
{
long ncpus = -1;
#ifdef _SC_NPROCESSORS_ONLN
ncpus = SAFE_SYSCONF(NULL, _SC_NPROCESSORS_ONLN);
#el... |
google | android | tst_record_childstatus | .c | platform/external/ltp/lib/tests/tst_record_childstatus.c | 1,534 | utf_8 | 15995d21ea308ef92a63a24488d8aa3f | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "test.h"
char *TCID = "tst_record_childstatus";
int TST_TOTAL = 1;
int main(void)
{
int pid;
pid = tst_fork();
switch (pid) {
case 0:
tst_resm(TFAIL, "Child reports failure");
/* Uncomment to get child killed by signal */
//alarm(1... |
google | android | tst_device | .c | platform/external/ltp/lib/tests/tst_device.c | 1,497 | utf_8 | fec9d1faa229ac3acae3ed8c4eb311d8 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "test.h"
char *TCID = "tst_device";
int TST_TOTAL = 1;
static const char *dev;
static void cleanup(void)
{
if (dev)
tst_release_device(dev);
tst_rmdir();
}
int main(void)
{
tst_tmpdir();
dev = tst_acquire_device(cleanup);
if (!dev)
... |
google | android | tst_cleanup_once | .c | platform/external/ltp/lib/tests/tst_cleanup_once.c | 1,345 | utf_8 | c9ac2a6843ed65805b66eb9793387f24 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <pthread.h>
#include "test.h"
char *TCID = "tst_cleanup_once";
int TST_TOTAL = 1;
/*
* This is called exactly once
*/
static void do_cleanup(void)
{
printf("Cleanup\n");
}
TST_DECLARE_ONCE_FN(cleanup, do_cleanup);
int main(void)
{
cleanu... |
google | android | tst_tmpdir_test | .c | platform/external/ltp/lib/tests/tst_tmpdir_test.c | 2,335 | utf_8 | b570e02a2389a156f68e2f7240148fd6 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* Test program for the tst_tmpdir program in /lib
*
* This program creates and deletes a temporary file in order to test
* the functionality of the tst_tmpdir functionality.
* On successfull completion it prints the message:
* "Test complete... |
google | android | tst_safe_macros | .c | platform/external/ltp/lib/tests/tst_safe_macros.c | 879 | utf_8 | 5d271cfa2880efe791ed573ae8399744 | #include "test.h"
#include "safe_macros.h"
char *TCID = "test_safe_macros";
int TST_TOTAL = 1;
int fd = -1;
void cleanup(void)
{
SAFE_CLOSE(NULL, fd);
SAFE_UNLINK(NULL, __FILE__ "~");
tst_resm(TINFO, "got here");
}
int main(int argc LTP_ATTRIBUTE_UNUSED, char **argv)
{
char buf[10];
int fds[2];
buf[9] = '\0'... |
google | android | tst_fs_fill_hardlinks | .c | platform/external/ltp/lib/tests/tst_fs_fill_hardlinks.c | 1,345 | utf_8 | a3e19fd7a07e809eb46dbad21ddbfad0 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "test.h"
char *TCID = "tst_fs_fill_hardlinks";
int TST_TOTAL = 1;
static void cleanup(void)
{
tst_rmdir();
}
int main(void)
{
tst_tmpdir();
fprintf(stderr, "Max hardlinks = %i\n",
tst_fs_fill_hardlinks(NULL, "subdirs"));
cleanup... |
google | android | tst_checkpoint | .c | platform/external/ltp/lib/tests/tst_checkpoint.c | 1,618 | utf_8 | 1d6f2260820bd2a9c6aa5e78a7ab6934 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <sys/wait.h>
#include "test.h"
char *TCID = "tst_checkpoint";
int TST_TOTAL = 1;
int main(void)
{
int pid;
tst_tmpdir();
TST_CHECKPOINT_INIT(tst_rmdir);
pid = fork();
switch (pid) {
case -1:
tst_brkm(TBROK | TERRNO, NULL, "Fork faile... |
google | android | tst_strerrno | .c | platform/external/ltp/lib/tests/tst_strerrno.c | 1,292 | utf_8 | 289120320046e892f5210e2c70733a4f | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <errno.h>
#include "test.h"
char *TCID = "tst_strerrno";
int TST_TOTAL = 1;
int main(void)
{
fprintf(stderr, "0 = %s\n", tst_strerrno(0));
fprintf(stderr, "EINVAL = %s\n", tst_strerrno(EINVAL));
return 0;
} |
google | android | tst_strsig | .c | platform/external/ltp/lib/tests/tst_strsig.c | 1,301 | utf_8 | 5bd6fc10e8244738e06c6a72008dbe62 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <signal.h>
#include "test.h"
char *TCID = "tst_strsig";
int TST_TOTAL = 1;
int main(void)
{
fprintf(stderr, "SIGKILL = %s\n", tst_strsig(SIGKILL));
fprintf(stderr, "SIGALRM = %s\n", tst_strsig(SIGALRM));
return 0;
} |
google | android | tst_checkpoint_wake_timeout | .c | platform/external/ltp/lib/tests/tst_checkpoint_wake_timeout.c | 1,389 | utf_8 | 6ad421c3e0cb119365982b61a2fcd3f4 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <sys/wait.h>
#include "test.h"
char *TCID = "tst_checkpoint_wake_timeout";
int TST_TOTAL = 1;
int main(void)
{
tst_tmpdir();
TST_CHECKPOINT_INIT(tst_rmdir);
TST_SAFE_CHECKPOINT_WAKE(tst_rmdir, 0);
fprintf(stderr, "Parent: checkpoint reac... |
google | android | tst_process_state | .c | platform/external/ltp/lib/tests/tst_process_state.c | 1,934 | utf_8 | 7da729e73c03a439d06fe699c90bb416 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <sys/wait.h>
#include "test.h"
char *TCID = "tst_checkpoint_child";
int TST_TOTAL = 1;
void handler(int sig LTP_ATTRIBUTE_UNUSED)
{
if (write(2, "Child in sighandler\n", 20)) {
/* silence build time warnings */
}
}
int main(void)
{
int ... |
google | android | tst_dataroot01 | .c | platform/external/ltp/lib/tests/tst_dataroot01.c | 1,564 | utf_8 | 3b756e85a35e4510bd9bf6abd017408b | /*
*/
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include "test.h"
#include "safe_macros.h"
#define OUTPUT_FNAME "output"
#define LTPROOT "/opt/ltp"
char *TCID = "dataroot";
int TST_TOTAL = 1;
static void cmp_paths(const char *p1, const char *p2, const char *s)
{
if (strncmp(p1, p2, PATH_MAX) == 0)
t... |
google | android | tst_dataroot02 | .c | platform/external/ltp/lib/tests/tst_dataroot02.c | 1,634 | utf_8 | dd229aabb1026b0cc95b504659a5132e | /*
*/
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include "test.h"
#include "safe_macros.h"
#define OUTPUT_FNAME "output"
#define LTPROOT "/opt/ltp"
char *TCID = "dataroot";
int TST_TOTAL = 1;
static void cmp_paths(const char *p1, const char *p2, const char *s)
{
if (strncmp(p1, p2, PATH_MAX) == 0)
t... |
google | android | tst_checkpoint_wait_timeout | .c | platform/external/ltp/lib/tests/tst_checkpoint_wait_timeout.c | 1,593 | utf_8 | 3897a0cad86e8d5bb619c44fd977e951 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <sys/wait.h>
#include "test.h"
char *TCID = "tst_checkpoint_wait_timeout";
int TST_TOTAL = 1;
int main(void)
{
int pid;
tst_tmpdir();
TST_CHECKPOINT_INIT(tst_rmdir);
pid = fork();
switch (pid) {
case -1:
tst_brkm(TBROK | TERRNO, NULL... |
google | android | tst_dataroot03 | .c | platform/external/ltp/lib/tests/tst_dataroot03.c | 1,639 | utf_8 | a46fac32c85cc8b9545d47fff66d8047 | /*
*/
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include "test.h"
#include "safe_macros.h"
#define OUTPUT_FNAME "output"
#define LTPROOT "/opt/ltp"
char *TCID = "dataroot";
int TST_TOTAL = 1;
static void cmp_paths(const char *p1, const char *p2, const char *s)
{
if (strncmp(p1, p2, PATH_MAX) == 0)
t... |
google | android | tst_fs_fill_subdirs | .c | platform/external/ltp/lib/tests/tst_fs_fill_subdirs.c | 1,340 | utf_8 | a92d7034b93fbc180a5f4d8a045b9db6 | /*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "test.h"
char *TCID = "tst_fs_fill_subdirs";
int TST_TOTAL = 1;
static void cleanup(void)
{
tst_rmdir();
}
int main(void)
{
tst_tmpdir();
fprintf(stderr, "Max dir elements = %i\n",
tst_fs_fill_subdirs(NULL, "dir"));
cleanup();
... |
google | android | trerrno | .c | platform/external/ltp/lib/tests/trerrno.c | 2,285 | utf_8 | 66cd44315fea080e5f2eb4db6cfca0a6 | /*
*/
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include "test.h"
#include "safe_macros.h"
#define OUTPUT_FNAME "output"
char *TCID = "trerrno";
int TST_TOTAL = 1;
static void setup(void)
{
tst_tmpdir();
}
static void cleanup(void)
{
tst_rmdir();
}
int main(void)
{
int fd, stdout_fd;
char msg[4096]... |
google | android | test05 | .c | platform/external/ltp/lib/newlib_tests/test05.c | 714 | utf_8 | 778f01590d7a67649ac82dc8dda8cfc9 | */
/*
* Test that child process that returns to test library code is reported.
*/
#include "tst_test.h"
static void setup(void)
{
tst_res(TINFO, "setup() executed by pid %i", getpid());
}
static void cleanup(void)
{
tst_res(TINFO, "cleanup() executed by pid %i", getpid());
}
static void do_test(void)
{
pid_t pid ... |
google | android | test_exec_child | .c | platform/external/ltp/lib/newlib_tests/test_exec_child.c | 236 | utf_8 | d93212c4c4cec42871ef7aa74b875519 | */
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
int main(void)
{
tst_reinit();
tst_res(TPASS, "Child passed!");
return 0;
} |
google | android | test_zero_hugepage | .c | platform/external/ltp/lib/newlib_tests/test_zero_hugepage.c | 841 | utf_8 | 092e9c8853d15997ccb117ff13cdfb58 | */
/*
* Tests .hugepages = {TST_NO_HUGEPAGES}
*/
#include "tst_test.h"
#include "tst_hugepage.h"
#include "tst_sys_conf.h"
static void do_test(void)
{
unsigned long val, hpages;
SAFE_FILE_SCANF(PATH_NR_HPAGES, "%lu", &val);
if (val != 0)
tst_brk(TBROK, "nr_hugepages = %lu, but expect 0", val);
else
tst_res(T... |
google | android | test_macros05 | .c | platform/external/ltp/lib/newlib_tests/test_macros05.c | 1,096 | utf_8 | 1979dbce4d9c2a26414c505ebfb928fa | */
/*
* Tests various corner conditions:
*
* - default message, i.e. first argument stringification
* - macro indirection, i.e. we have to stringify early
*
* The output should include the MACRO_FAIL() as the either fail of pass
* message. If it's missing or if it has been replaced by the function name
* there... |
google | android | tst_fuzzy_sync02 | .c | platform/external/ltp/lib/newlib_tests/tst_fuzzy_sync02.c | 4,732 | utf_8 | 4c03eb4ce05286e64f0e6621a7ad743a | */
/*\
* [Description]
*
* This verifies Fuzzy Sync's ability to reproduce a particular
* outcome to a data race when multiple races are present.
*
* We make the simplifying assumptions that:
* - There is one data race we want to hit and one to avoid.
* - Each thread contains two contiguous critical sections. ... |
google | android | test_assert | .c | platform/external/ltp/lib/newlib_tests/test_assert.c | 463 | utf_8 | 3233986b778e30edd60d1b7dac1c4b98 | */
#include <stdio.h>
#include "tst_test.h"
static void do_test(void)
{
TST_ASSERT_INT("/proc/self/oom_score", 0);
TST_ASSERT_STR("/proc/self/comm", "test_assert");
TST_ASSERT_FILE_INT("/proc/self/io", "read_bytes:", 0);
TST_ASSERT_FILE_STR("/proc/self/status1", "State", "unexpected");
}
static struct tst_test tes... |
google | android | tst_strstatus | .c | platform/external/ltp/lib/newlib_tests/tst_strstatus.c | 802 | utf_8 | 8aa51d4b97d2930c59f314a93c67e0f7 | */
/*
* Basic unit test for the tst_strstatus() function.
*/
#include <string.h>
#include "tst_test.h"
static struct tcase {
int status;
const char *str;
} tcases[] = {
{0x0100, "exited with 1"},
{0x0001, "killed by SIGHUP"},
{0x137f, "is stopped"},
{0xffff, "is resumed"},
{0x1ff, "invalid status 0x1ff"},
};
... |
google | android | tst_device | .c | platform/external/ltp/lib/newlib_tests/tst_device.c | 2,356 | utf_8 | 2fa8abedd84664536e8c95dc55ac35b0 | */
#define _GNU_SOURCE
#include <stdlib.h>
#include <sys/mount.h>
#include <stdint.h>
#include <stdio.h>
#include <lapi/loop.h>
#include <time.h>
#include "tst_test.h"
#define DEVBLOCKSIZE 2048
#define DEV_MIN_SIZE 310
static char *mntpoint;
static uint64_t ltp_dev_size;
static int set_block_size(int fd)
{
return ioc... |
google | android | tst_print_result | .c | platform/external/ltp/lib/newlib_tests/tst_print_result.c | 1,802 | utf_8 | 0c9f2f760c95e4ce279712d50f690911 | */
/*
* Test for cecbd0cb3 ("Fix buffer overflow in print_result() function")
*/
#include <stdlib.h>
#include "tst_test.h"
#define TEXT "The only purpose of this text si to try to overflow the buffers "\
"in test library, other than that it does not include any useful "\
"information. Whoever decides to ... |
google | android | test_guarded_buf | .c | platform/external/ltp/lib/newlib_tests/test_guarded_buf.c | 1,473 | utf_8 | fff60bb4d8e69875400da3115e58011c | */
/*
* Test that acces after guarded buffer causes segfault.
*/
#include <stdlib.h>
#include <sys/wait.h>
#include "tst_test.h"
#define BUF1_LEN 10
#define BUF2_LEN 4096
#define BUF3_LEN 12004
static char *buf1;
static char *buf2;
static char *buf3;
static void do_test(unsigned int n)
{
int pid;
int status;
if (... |
google | android | tst_needs_cmds04 | .c | platform/external/ltp/lib/newlib_tests/tst_needs_cmds04.c | 399 | utf_8 | ab0db5d5a33754aa27a260fe7e6897d9 | */
/*
* Test Illegal format by using incomplete version.
*/
#include "tst_test.h"
static void do_test(void)
{
tst_res(TFAIL, "Incomplete version was parsed!");
}
static struct tst_test test = {
.test_all = do_test,
.needs_cmds = (const char *[]) {
"mkfs.ext4 > 1.43",
NULL
}
}; |
google | android | test02 | .c | platform/external/ltp/lib/newlib_tests/test02.c | 679 | utf_8 | 72a0b52e0a94c0c476248e3a441389ce | */
/*
* The tst_resm() and tst_brkm() should be rerouted to the new lib.
*/
#include "tst_test.h"
void tst_resm_(char *, int, int, char *);
void tst_brkm__(char *, int, int, void (*)(void), char *);
static void cleanup(void)
{
}
static void do_test(unsigned int i)
{
switch (i) {
case 0:
tst_resm_(__FILE__, __LIN... |
google | android | test19 | .c | platform/external/ltp/lib/newlib_tests/test19.c | 654 | utf_8 | f0af7e7586805f19ef4f5ccdb50a2e6a | */
#include <stdlib.h>
#include <unistd.h>
#include "tst_test.h"
#include "tst_sys_conf.h"
static void setup(void)
{
SAFE_FILE_PRINTF("/proc/sys/kernel/core_pattern", "changed");
tst_sys_conf_dump();
}
static void run(void)
{
tst_res(TPASS, "OK");
}
static struct tst_test test = {
.needs_root = 1,
.test_all = run... |
google | android | test_timer | .c | platform/external/ltp/lib/newlib_tests/test_timer.c | 2,222 | utf_8 | a7d9ca8230eecc657b710bdb6c05b43b | */
/*
* Tests for include/tst_timer.h
*/
#include "tst_test.h"
#include "tst_timer.h"
#define VAL_MS 1001
#define VAL_US 1001000
static void test_diff(enum tst_ts_type type)
{
struct tst_ts ts1, ts2;
long long diff;
ts1 = tst_ts_from_ms(type, VAL_MS);
ts2 = tst_ts_from_us(type, VAL_US);
diff = tst_ts_diff_ns(ts... |
google | android | test_kconfig02 | .c | platform/external/ltp/lib/newlib_tests/test_kconfig02.c | 548 | utf_8 | d31b36d877a401b393bb5df3d69a542f | *
* Invalid boolean expression test.
*/
#include "tst_test.h"
static void do_test(void)
{
tst_res(TPASS, "Test passed!");
}
static const char *kconfigs[] = {
"\"CONFIG_FOO=val\"",
"CONFIG_a=1",
"CONFIG_FOO=",
"CONFIG_DEFAULT_HOSTNAME=\"(none",
"CONFIG_DEFAULT_HOSTNAME=\"(none)\"a",
"CONFIG_BROKEN=a\" | CONFIG... |
google | android | tst_capability02 | .c | platform/external/ltp/lib/newlib_tests/tst_capability02.c | 736 | utf_8 | 7803550cad5a0e42172a1e8ecf1e88fb | */
#include <unistd.h>
#include <sys/types.h>
#include "tst_test.h"
#include "tst_capability.h"
#include "tst_safe_net.h"
#include "lapi/socket.h"
static void run(void)
{
TEST(socket(AF_INET, SOCK_RAW, 1));
if (TST_RET > -1) {
tst_res(TPASS, "Created raw socket");
SAFE_CLOSE(TST_RET);
} else {
tst_res(TFAIL |... |
google | android | tst_needs_cmds03 | .c | platform/external/ltp/lib/newlib_tests/tst_needs_cmds03.c | 399 | utf_8 | 4c2f389d09158429fdb48ff1a0a73a9b | */
/*
* Test Illegal format by using Illegal operation.
*/
#include "tst_test.h"
static void do_test(void)
{
tst_res(TFAIL, "Wrong operator was evaluated!");
}
static struct tst_test test = {
.test_all = do_test,
.needs_cmds = (const char *[]) {
"mkfs.ext4 ! 1.43.0",
NULL
}
}; |
google | android | test22 | .c | platform/external/ltp/lib/newlib_tests/test22.c | 620 | utf_8 | 4cbba239cde934615d4a6a8bb3cd44dd | */
/*
* Test that TBROK is propagated correctly to the results even if we wait on
* child and throw away the status.
*/
#include "tst_test.h"
static void do_test(void)
{
int pid = SAFE_FORK();
if (pid) {
tst_res(TPASS, "Test main pid");
SAFE_WAITPID(pid, NULL, 0);
return;
}
if (tst_variant == 1)
tst_brk... |
google | android | tst_needs_cmds01 | .c | platform/external/ltp/lib/newlib_tests/tst_needs_cmds01.c | 461 | utf_8 | 1e54204561394fb38dffa3946236dbaf | */
#include "tst_test.h"
static void do_test(void)
{
tst_res(TPASS, "Testing tst_check_cmd() functionality OK.");
}
static struct tst_test test = {
.test_all = do_test,
.needs_cmds = (const char *[]) {
"mkfs.ext4",
"mkfs.ext4 >= 1.0.0",
"mkfs.ext4 <= 2.0.0",
"mkfs.ext4 != 2.0.0",
"mkfs.ext4 > 1.0.0",
"m... |
google | android | test07 | .c | platform/external/ltp/lib/newlib_tests/test07.c | 624 | utf_8 | a6e17ed8e5233758fb123594689bf6c2 | */
/*
* Test for result propagation.
*/
#include "tst_test.h"
static void setup(void)
{
tst_res(TINFO, "setup() executed by pid %i", getpid());
}
static void cleanup(void)
{
tst_res(TINFO, "cleanup() executed by pid %i", getpid());
}
static void do_test(void)
{
unsigned int i;
for (i = 0; i < 100; i++) {
if (S... |
google | android | tst_cgroup02 | .c | platform/external/ltp/lib/newlib_tests/tst_cgroup02.c | 2,169 | utf_8 | ca31b7c24b8824a7b49798ecaa31a635 | #include <stdlib.h>
#include <stdio.h>
#include "tst_test.h"
static char *only_mount_v1;
static char *no_cleanup;
static struct tst_option opts[] = {
{"v", &only_mount_v1, "-v\tOnly try to mount CGroups V1"},
{"n", &no_cleanup, "-n\tLeave CGroups created by test"},
{NULL, NULL, NULL},
};
static struct tst_cg_opts cg... |
google | android | test_macros04 | .c | platform/external/ltp/lib/newlib_tests/test_macros04.c | 1,358 | utf_8 | 34f717c9dc265c5be86a8a72f2ce07f0 | */
/*
* Test TST_EXP_PID and TST_EXP_PID_SILENT macro.
*/
#include "tst_test.h"
static int fail_pid(void)
{
errno = EINVAL;
return -1;
}
static int pass_pid(void)
{
return 42;
}
static int inval_val(void)
{
return -42;
}
static int zero_val(void)
{
return 0;
}
static void do_test(void)
{
tst_res(TINFO, "Testin... |
google | android | test_macros01 | .c | platform/external/ltp/lib/newlib_tests/test_macros01.c | 1,328 | utf_8 | 6579f42fde204c5c53ff3cef5260edda | */
/*
* Test TST_EXP_FD and TST_EXP_FD_SILENT macro.
*/
#include "tst_test.h"
static int fail_fd(void)
{
errno = EINVAL;
return -1;
}
static int pass_fd(void)
{
return 42;
}
static int inval_val(void)
{
return -42;
}
static int zero_val(void)
{
return 0;
}
static void do_test(void)
{
tst_res(TINFO, "Testing TS... |
google | android | test_macros03 | .c | platform/external/ltp/lib/newlib_tests/test_macros03.c | 1,104 | utf_8 | 5862d0c824795de5c971c3d205d8ed9a | */
/*
* Test TST_EXP_PASS and TST_EXP_PASS_SILENT macro.
*/
#include "tst_test.h"
static int fail_fn(void)
{
errno = EINVAL;
return -1;
}
static int pass_fn(void)
{
return 0;
}
static int inval_ret_fn(void)
{
return 42;
}
static void do_test(void)
{
tst_res(TINFO, "Testing TST_EXP_PASS macro");
TST_EXP_PASS(fa... |
google | android | test15 | .c | platform/external/ltp/lib/newlib_tests/test15.c | 3,351 | utf_8 | 5a856cae264d1104a0e931a81e8c2977 | */
/*
* A basic regression test for tst_atomic_{load,store}. Also provides a
* limited check that atomic stores and loads order non-atomic memory
* accesses. That is, we are checking that they implement memory fences or
* barriers.
*
* Many architectures/machines will still pass the test even if you remove the
... |
google | android | test03 | .c | platform/external/ltp/lib/newlib_tests/test03.c | 310 | utf_8 | 28e48669c8b550ac7b4ac47bb09719b0 | */
/*
* tst_brkm() from SAFE_MACROS() is redirected to newlib
*/
#include "tst_test.h"
static void do_test(void)
{
SAFE_CHDIR("nonexistent");
}
static struct tst_test test = {
.test_all = do_test,
}; |
google | android | test_kconfig01 | .c | platform/external/ltp/lib/newlib_tests/test_kconfig01.c | 397 | utf_8 | 5215423e952dc2f0046236e4f0e34c52 | *
* Invalid boolean expression test.
*/
#include "tst_test.h"
static void do_test(void)
{
tst_res(TPASS, "Test passed!");
}
static const char *kconfigs[] = {
"CONFIG_EXT4_FS=m | CONFIG_MMU)",
NULL
};
static struct tst_test test = {
.test_all = do_test,
.needs_kconfigs = kconfigs,
}; |
google | android | test_parse_filesize | .c | platform/external/ltp/lib/newlib_tests/test_parse_filesize.c | 3,970 | utf_8 | f0fc8fab7545a88da6203702da762998 | */
/*
* Tests for tst_parse_filesize.
*/
#include "tst_test.h"
static void do_test(void)
{
long long val = 0;
int ret = 0;
if ((ret = tst_parse_filesize("1", &val, LLONG_MIN, LLONG_MAX))) {
tst_res(TFAIL, "return code %d (%s)", ret, tst_strerrno(ret));
} else {
if (val == 1LL)
... |
google | android | test13 | .c | platform/external/ltp/lib/newlib_tests/test13.c | 370 | utf_8 | 221fdd9aef6163f33bd6820b3b7a5295 | */
/*
* Test for timeout & children.
*/
#include "tst_test.h"
static void do_test(void)
{
SAFE_FORK();
SAFE_FORK();
SAFE_FORK();
tst_res(TINFO, "Pausing process pid %i", getpid());
pause();
}
static struct tst_test test = {
.forks_child = 1,
.test_all = do_test,
}; |
google | android | test14 | .c | platform/external/ltp/lib/newlib_tests/test14.c | 595 | utf_8 | 0039133748ca744b26ee3a9f5bcde687 | */
#include "tst_test.h"
#include "tst_safe_stdio.h"
#include "tst_safe_net.h"
static void cleanup(void)
{
int i;
tst_brk(TBROK, "TBROK in cleanup");
SAFE_OPEN("foo", O_RDWR);
SAFE_FILE_SCANF("foo", "%i", &i);
SAFE_TOUCH("doo/foo", 0777, NULL);
SAFE_FOPEN("foo", "r");
SAFE_SOCKET(AF_UNIX, SOCK_STREAM, -1);
tst... |
google | android | test08 | .c | platform/external/ltp/lib/newlib_tests/test08.c | 1,155 | utf_8 | 3b93945cd48af0e3dabdd8795a99c5c4 | */
/*
* Test for callback thread safety.
*/
#include <pthread.h>
#include "tst_test.h"
#define THREADS 10
static pthread_barrier_t barrier;
static void setup(void)
{
pthread_barrier_init(&barrier, NULL, THREADS);
tst_res(TINFO, "setup() executed");
}
static void cleanup(void)
{
static int flag;
/* Avoid subseque... |
google | android | test20 | .c | platform/external/ltp/lib/newlib_tests/test20.c | 1,095 | utf_8 | f5ae4c73feb530a9d84e78b300e38c57 | */
/*
* Tests .hugepages + .save_restore
*/
#include "tst_test.h"
#include "tst_hugepage.h"
#include "tst_sys_conf.h"
static void do_test(void) {
unsigned long val, hpages;
tst_res(TINFO, "tst_hugepages = %lu", tst_hugepages);
SAFE_FILE_PRINTF("/proc/sys/kernel/numa_balancing", "1");
hpages = test.hugepages.numb... |
google | android | tst_needs_cmds02 | .c | platform/external/ltp/lib/newlib_tests/tst_needs_cmds02.c | 402 | utf_8 | ebaafcb037acc26f11dd882e61dc9dff | */
/*
* Test Illegal format by using non-existing cmd.
*/
#include "tst_test.h"
static void do_test(void)
{
tst_res(TFAIL, "Nonexisting command is present!");
}
static struct tst_test test = {
.test_all = do_test,
.needs_cmds = (const char *[]) {
"mkfs.ext45 >= 1.43.0",
NULL
}
}; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.