#include "gpiod-test-helpers.h"
GVariant *
-gpiod_test_package_line_names(const struct gpiod_test_line_name *names)
+gpiod_test_package_line_names(const GPIOSimLineName *names)
{
g_autoptr(GVariantBuilder) builder = NULL;
- const struct gpiod_test_line_name *name;
+ const GPIOSimLineName *name;
builder = g_variant_builder_new(G_VARIANT_TYPE("a(us)"));
return g_variant_ref_sink(g_variant_new("a(us)", builder));
}
-GVariant *gpiod_test_package_hogs(const struct gpiod_test_hog *hogs)
+GVariant *gpiod_test_package_hogs(const GPIOSimHog *hogs)
{
g_autoptr(GVariantBuilder) builder = NULL;
- const struct gpiod_test_hog *hog;
+ const GPIOSimHog *hog;
builder = g_variant_builder_new(G_VARIANT_TYPE("a(usi)"));
#define gpiod_test_expect_errno(_expected) \
g_assert_cmpint(_expected, ==, errno)
-struct gpiod_test_line_name {
+typedef struct {
guint offset;
const gchar *name;
-};
+} GPIOSimLineName;
-struct gpiod_test_hog {
+typedef struct {
guint offset;
const gchar *name;
GPIOSimDirection direction;
-};
+} GPIOSimHog;
-GVariant *
-gpiod_test_package_line_names(const struct gpiod_test_line_name *names);
-GVariant *gpiod_test_package_hogs(const struct gpiod_test_hog *hogs);
+GVariant *gpiod_test_package_line_names(const GPIOSimLineName *names);
+GVariant *gpiod_test_package_hogs(const GPIOSimHog *hogs);
#endif /* __GPIOD_TEST_HELPERS_H__ */
GPIOD_TEST_CASE(find_line_bad)
{
- static const struct gpiod_test_line_name names[] = {
+ static const GPIOSimLineName names[] = {
{ .offset = 1, .name = "foo", },
{ .offset = 2, .name = "bar", },
{ .offset = 4, .name = "baz", },
GPIOD_TEST_CASE(find_line_good)
{
- static const struct gpiod_test_line_name names[] = {
+ static const GPIOSimLineName names[] = {
{ .offset = 1, .name = "foo", },
{ .offset = 2, .name = "bar", },
{ .offset = 4, .name = "baz", },
/* Verify that for duplicated line names, the first one is returned. */
GPIOD_TEST_CASE(find_line_duplicate)
{
- static const struct gpiod_test_line_name names[] = {
+ static const GPIOSimLineName names[] = {
{ .offset = 1, .name = "foo", },
{ .offset = 2, .name = "baz", },
{ .offset = 4, .name = "baz", },
GPIOD_TEST_CASE(line_info_basic_properties)
{
- static const struct gpiod_test_line_name names[] = {
+ static const GPIOSimLineName names[] = {
{ .offset = 1, .name = "foo", },
{ .offset = 2, .name = "bar", },
{ .offset = 4, .name = "baz", },
{ }
};
- static const struct gpiod_test_hog hogs[] = {
+ static const GPIOSimHog hogs[] = {
{
.offset = 3,
.name = "hog3",