Stop stubbing tuple (#224)

Summary:

Stubbing tuple without alignment info can cause failures. I added a test
case for this which failed before this fix but works now.

Test Plan:

Ran the test.
This commit is contained in:
arsarwade 2023-07-11 09:10:40 -07:00 committed by GitHub
parent 188a2a82d0
commit 28b813c6db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 1 deletions

View File

@ -73,7 +73,6 @@ OICodeGen::OICodeGen(const Config& c, SymbolService& s)
"McServerSession",
"Range",
"ReadResumableHandle",
"tuple",
"CountedIntrusiveList",
"EventBaseAtomicNotificationQueue",
/* Temporary IOBuf ring used for scattered read/write.

View File

@ -0,0 +1,36 @@
includes = ["tuple"]
definitions = '''
struct Foo {
std::tuple<uint64_t, uint64_t> t;
};
struct Bar {
std::optional<Foo> f;
};
'''
[cases]
[cases.uint64_uint64]
param_types = ["Bar&"]
setup = '''
Foo f;
f.t = std::make_tuple<uint64_t, uint64_t>(1,2);
Bar b;
b.f = f;
return b;
'''
expect_json = '''
[
{
"staticSize": 24,
"dynamicSize": 0,
"members": [
{
"staticSize": 24,
"dynamicSize": 0,
"length": 1,
"capacity": 1,
"elementStaticSize": 16
}
]
}
]
'''