kunit_iov_iter.c
Includes Linux kernel module headerKUnit test header include
SHA-256fc9cfafa5d8e5e395bdca9b58890a49894c8fe6d527e8679c81f66812ab5a143
MaleculeO(Er)H(Os)
Evidence
1// SPDX-License-Identifier: GPL-2.0-only
2/* I/O iterator tests. This can only test kernel-backed iterator types.
3 *
4 * Copyright (C) 2023 Red Hat, Inc. All Rights R …
5:46… com)
6 */
7
8#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
9
10#include <linux/module.h>
11#include <linux/vmalloc.h>
12#include <linux/mm.h>
13#include <linux/uio.h>
14#include <linux/bvec.h>
15#include <linux/folio_queue.h>
16#include <kunit/test.h>
17
18MODULE_DESCRIPTION("iov_iter testing");
⋯8 lines
77:28… c_test_range *pr)
78{
79 size_t size = 0;
80 int i;
81
82 for (i = 0; i < kvmax; i++, pr++) {
83 if (pr->from < 0)
84 break;
85 KUNIT_ASSERT_GE(test, pr->to, p …
127:5… IT_EXPECT_EQ(test, iter.nr_segs, 0);
128
129 /* Build the expected image in the scratch buffer. */
130 patt = 0;
131 memset(scratch, 0, bufsize);
132 for (pr = kv …