Test for vec<union> vec<struct w/ union>.

Bug: 31973802
Test: hidl_test
Change-Id: I4367f1f525caa8d1edb95b7bfdac78f21b234576
diff --git a/tests/foo/1.0/IFoo.hal b/tests/foo/1.0/IFoo.hal
index c1ce7b0..4a930a2 100644
--- a/tests/foo/1.0/IFoo.hal
+++ b/tests/foo/1.0/IFoo.hal
@@ -122,6 +122,19 @@
         bitfield<BitField> bf;
     };
 
+    enum Discriminator : uint8_t {
+        BOOL,
+        INT,
+    };
+    union Union {
+        bool boolValue;
+        int64_t intValue;
+    };
+    struct ContainsUnion {
+        Discriminator discriminator;
+        Union value;
+    };
+
     typedef int32_t[5][6][7] multidimArrayOne;
     typedef multidimArrayOne[8][9][10] multidimArrayTwo;
     typedef multidimArrayTwo[2][3][4] multidimArrayThree;
@@ -144,6 +157,16 @@
         InnerTestEnumTypedef foo;
     };
 
+    /**
+     * If d is INT, converts all values to bools which are small enough (0 or 1).
+     * If d is BOOL, should leave all values as BOOLs.
+     *
+     * @param d discriminator for all values in u
+     * @param u values to be expanded
+     * @return c must have same length as u unless there is an error in which case it will be empty.
+     */
+    convertToBoolIfSmall(Discriminator d, vec<Union> u) generates (vec<ContainsUnion> c);
+
     doThis(float param);
     doThatAndReturnSomething(int64_t param) generates (int32_t result);
     doQuiteABit(int32_t a, int64_t b, float c, double d) generates (double something);