2023-04-05 21:56:55 +01:00
|
|
|
includes = ["folly/FBString.h"]
|
|
|
|
[cases]
|
|
|
|
[cases.empty]
|
2023-08-16 20:40:36 +01:00
|
|
|
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/322
|
2023-04-05 21:56:55 +01:00
|
|
|
param_types = ["folly::fbstring&"]
|
|
|
|
setup = "return {};"
|
|
|
|
expect_json = '''
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"typeName": "fbstring",
|
|
|
|
"isTypedef": true,
|
|
|
|
"staticSize": 24,
|
|
|
|
"dynamicSize": 0,
|
|
|
|
"exclusiveSize": 0,
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"staticSize": 24,
|
|
|
|
"dynamicSize": 0,
|
|
|
|
"exclusiveSize": 24,
|
|
|
|
"length": 0,
|
|
|
|
"capacity": 23,
|
|
|
|
"elementStaticSize": 1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
'''
|
|
|
|
|
|
|
|
[cases.inline]
|
2023-08-16 20:40:36 +01:00
|
|
|
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/322
|
2023-04-05 21:56:55 +01:00
|
|
|
param_types = ["folly::fbstring&"]
|
|
|
|
setup = 'return {"012345"};'
|
|
|
|
expect_json = '''
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"typeName": "fbstring",
|
|
|
|
"isTypedef": true,
|
|
|
|
"staticSize": 24,
|
|
|
|
"dynamicSize": 0,
|
|
|
|
"exclusiveSize": 0,
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"staticSize": 24,
|
|
|
|
"dynamicSize": 0,
|
|
|
|
"exclusiveSize": 24,
|
|
|
|
"length": 6,
|
|
|
|
"capacity": 23,
|
|
|
|
"elementStaticSize": 1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
'''
|
|
|
|
|
|
|
|
[cases.heap_allocated]
|
2023-08-16 20:40:36 +01:00
|
|
|
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/322
|
2023-04-05 21:56:55 +01:00
|
|
|
param_types = ["folly::fbstring&"]
|
|
|
|
setup = 'return {"abcdefghijklmnopqrstuvwxzy"};'
|
|
|
|
expect_json = '''
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"typeName": "fbstring",
|
|
|
|
"isTypedef": true,
|
|
|
|
"staticSize": 24,
|
|
|
|
"dynamicSize": 26,
|
|
|
|
"exclusiveSize": 0,
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"staticSize": 24,
|
|
|
|
"dynamicSize": 26,
|
|
|
|
"exclusiveSize": 50,
|
|
|
|
"length": 26,
|
|
|
|
"capacity": 26,
|
|
|
|
"elementStaticSize": 1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
'''
|
|
|
|
|
|
|
|
[cases.string_pooled]
|
2023-08-16 20:40:36 +01:00
|
|
|
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/322
|
2023-04-05 21:56:55 +01:00
|
|
|
param_types = ["folly::fbstring&"]
|
|
|
|
setup = "return folly::fbstring(1024, 'c');"
|
|
|
|
expect_json = '''
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"typeName": "fbstring",
|
|
|
|
"isTypedef": true,
|
|
|
|
"staticSize": 24,
|
|
|
|
"dynamicSize": 1024,
|
|
|
|
"exclusiveSize": 0,
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"staticSize": 24,
|
|
|
|
"dynamicSize": 1024,
|
|
|
|
"exclusiveSize": 1048,
|
|
|
|
"length": 1024,
|
|
|
|
"capacity": 1024,
|
|
|
|
"elementStaticSize": 1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
'''
|