TYPED_TEST(MultiProtocolTest, Union) {
  {
    StructA oldUnionVal = makeStructALike<StructA>();
    Union oldObject;
    oldObject.fieldA_ref() = oldUnionVal;
    tablebased::StructA newUnionVal = makeStructALike<tablebased::StructA>();
    tablebased::Union newObject;
    newObject.fieldA_ref() = newUnionVal;
    EXPECT_COMPATIBLE_PROTOCOL(oldObject, newObject, TypeParam);
  }
  {
    StructB oldUnionVal = makeStructBLike<StructB>();
    Union oldObject;
    oldObject.fieldB_ref() = oldUnionVal;
    tablebased::StructB newUnionVal = makeStructBLike<tablebased::StructB>();
    tablebased::Union newObject;
    newObject.fieldB_ref() = newUnionVal;
    EXPECT_COMPATIBLE_PROTOCOL(oldObject, newObject, TypeParam);
  }
  {
    Union oldObject;
    oldObject.fieldC_ref() = "test";
    tablebased::Union newObject;
    newObject.fieldC_ref() = "test";
    EXPECT_COMPATIBLE_PROTOCOL(oldObject, newObject, TypeParam);
  }
}
TYPED_TEST(MultiProtocolTest, Union) {
  {
    StructA oldUnionVal = makeStructALike<StructA>();
    Union oldObject;
    oldObject.fieldA_ref() = oldUnionVal;
    tablebased::StructA newUnionVal = makeStructALike<tablebased::StructA>();
    tablebased::Union newObject;
    newObject.fieldA_ref() = newUnionVal;
    EXPECT_COMPATIBLE_PROTOCOL(oldObject, newObject, TypeParam);
  }
  {
    StructB oldUnionVal = makeStructBLike<StructB>();
    Union oldObject;
    oldObject.fieldB_ref() = oldUnionVal;
    tablebased::StructB newUnionVal = makeStructBLike<tablebased::StructB>();
    tablebased::Union newObject;
    newObject.fieldB_ref() = newUnionVal;
    EXPECT_COMPATIBLE_PROTOCOL(oldObject, newObject, TypeParam);
  }
  {
    Union oldObject;
    oldObject.fieldC_ref() = "test";
    tablebased::Union newObject;
    newObject.fieldC_ref() = "test";
    EXPECT_COMPATIBLE_PROTOCOL(oldObject, newObject, TypeParam);
  }
}