aboutsummaryrefslogtreecommitdiffstats
path: root/tests/data/small-server.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/data/small-server.h')
-rw-r--r--tests/data/small-server.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/data/small-server.h b/tests/data/small-server.h
index 009d9cd..9cafcd9 100644
--- a/tests/data/small-server.h
+++ b/tests/data/small-server.h
@@ -133,6 +133,47 @@ intf_A_foo_is_valid(uint32_t value, uint32_t version) {
}
#endif /* INTF_A_FOO_ENUM */
+#ifndef INTF_A_BAR_ENUM
+#define INTF_A_BAR_ENUM
+enum intf_A_bar {
+ /**
+ * this is the first
+ */
+ INTF_A_BAR_FIRST = 0x01,
+ /**
+ * this is the second
+ */
+ INTF_A_BAR_SECOND = 0x02,
+ /**
+ * this is the third
+ * @since 2
+ */
+ INTF_A_BAR_THIRD = 0x04,
+};
+/**
+ * @ingroup iface_intf_A
+ */
+#define INTF_A_BAR_THIRD_SINCE_VERSION 2
+/**
+ * @ingroup iface_intf_A
+ * Validate a intf_A bar value.
+ *
+ * @return true on success, false on error.
+ * @ref intf_A_bar
+ */
+static inline bool
+intf_A_bar_is_valid(uint32_t value, uint32_t version) {
+ uint32_t valid = 0;
+ if (version >= 1)
+ valid |= INTF_A_BAR_FIRST;
+ if (version >= 1)
+ valid |= INTF_A_BAR_SECOND;
+ if (version >= 2)
+ valid |= INTF_A_BAR_THIRD;
+ return (value & ~valid) == 0;
+}
+#endif /* INTF_A_BAR_ENUM */
+
/**
* @ingroup iface_intf_A
* @struct intf_A_interface