zephyr/tests/net/socket/socketpair/src/_main.h
Christopher Friedt f1d7c0b196 tests: net: socketpair: use a test fixture to deduplicate code
A fair bit of setup / teardown code was being duplicated in many
test cases in the socketpair testsuite.

Take advantage of the `setup()`, `before()`, and `after()`
functions in the new ZTest API.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00

26 lines
526 B
C

/*
* Copyright (c) 2020 Friedt Professional Engineering Services, Inc
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef TEST_SOCKETPAIR_THREAD_H_
#define TEST_SOCKETPAIR_THREAD_H_
#include <errno.h>
#include <string.h>
#include <zephyr/logging/log.h>
#include <zephyr/net/socket.h>
#include <zephyr/posix/fcntl.h>
#include <zephyr/sys/util.h>
#include <zephyr/ztest.h>
LOG_MODULE_DECLARE(net_test, CONFIG_NET_SOCKETS_LOG_LEVEL);
struct net_socketpair_fixture {
int sv[2];
};
#endif /* TEST_SOCKETPAIR_THREAD_H_ */