meta-flow: Correctly set destination MAC in mf_set_flow_value().
[sliver-openvswitch.git] / tests / check-structs.at
index 52e92ec..a926a0f 100644 (file)
@@ -2,7 +2,8 @@ AT_BANNER([struct alignment checker unit tests])
 
 m4_define([check_structs], [$top_srcdir/build-aux/check-structs])
 m4_define([RUN_STRUCT_CHECKER], 
-  [AT_SKIP_IF([test $HAVE_PYTHON = no])
+  [AT_KEYWORDS([check-structs])
+   AT_SKIP_IF([test $HAVE_PYTHON = no])
    AT_DATA([test.h], [$1
 ])
    AT_CHECK_UNQUOTED([$PYTHON check_structs test.h], [$2], [$3], [$4])])
@@ -39,3 +40,17 @@ OFP_ASSERT(sizeof(struct wibble) == 12);
   [test.h:4: warning: struct wibble is 8 bytes long but declared as 12
 ])
 AT_CLEANUP
+
+AT_SETUP([check wrong struct's declared size])
+RUN_STRUCT_CHECKER(
+[struct moo {
+    uint64_t bar;
+};
+OFP_ASSERT(sizeof(struct moo) == 8);
+struct wibble {
+    uint64_t z;
+};
+OFP_ASSERT(sizeof(struct moo) == 8);
+], [1], [], [test.h:8: warning: checking size of struct moo but struct wibble was most recently defined
+])
+AT_CLEANUP