@@ -53,6 +53,11 @@ if (struct1.field != struct2.field) { \
t.i = 58527;
t.c = ipa::test::IPAOperationInit;
+ Flags<ipa::test::ErrorFlags> flags;
+ flags |= ipa::test::ErrorFlags::Error1;
+ flags |= ipa::test::ErrorFlags::Error2;
+ t.f = flags;
+
std::vector<uint8_t> serialized;
std::tie(serialized, ignore) =
@@ -72,6 +77,10 @@ if (struct1.field != struct2.field) { \
TEST_FIELD_EQUALITY(t, u, i);
TEST_FIELD_EQUALITY(t, u, c);
+ if (t.f != u.f) {
+ cerr << "Flags f field incorrect" << endl;
+ return TestFail;
+ }
/* Test vector of generated structs */
std::vector<ipa::test::TestStruct> v = { t, u };
@@ -96,12 +105,22 @@ if (struct1.field != struct2.field) { \
TEST_FIELD_EQUALITY(v[0], w[0], i);
TEST_FIELD_EQUALITY(v[0], w[0], c);
+ if (v[0].f != w[0].f) {
+ cerr << "Flags f field incorrect" << endl;
+ return TestFail;
+ }
+
TEST_FIELD_EQUALITY(v[1], w[1], s1);
TEST_FIELD_EQUALITY(v[1], w[1], s2);
TEST_FIELD_EQUALITY(v[1], w[1], s3);
TEST_FIELD_EQUALITY(v[1], w[1], i);
TEST_FIELD_EQUALITY(v[1], w[1], c);
+ if (v[1].f != w[1].f) {
+ cerr << "Flags f field incorrect" << endl;
+ return TestFail;
+ }
+
return TestPass;
}
@@ -9,6 +9,13 @@ enum IPAOperationCode {
IPAOperationStop,
};
+[scopedEnum] enum ErrorFlags {
+ Error1 = 0x1,
+ Error2 = 0x2,
+ Error3 = 0x4,
+ Error4 = 0x8,
+};
+
struct IPASettings {};
struct TestStruct {
@@ -19,6 +26,7 @@ struct TestStruct {
int32 i;
string s3;
IPAOperationCode c;
+ [flags] ErrorFlags f;
};
interface IPATestInterface {