1
1
includes = [" vector" , " utility" , " cstdint" ]
2
2
[cases ]
3
3
[cases .uint64_uint64 ]
4
- oil_skip = ' tests need updating for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/310
5
4
param_types = [" std::pair<std::uint64_t, std::uint64_t>&" ]
6
5
setup = " return {{0, 1}};"
7
6
expect_json = '''
@@ -14,8 +13,13 @@ includes = ["vector", "utility", "cstdint"]
14
13
}
15
14
]
16
15
'''
16
+ expect_json_v2 = ''' [
17
+ {"staticSize": 16, "exclusiveSize": 0, "members": [
18
+ {"typeNames": ["uint64_t"], "staticSize": 8, "exclusiveSize": 8},
19
+ {"typeNames": ["uint64_t"], "staticSize": 8, "exclusiveSize": 8}
20
+ ]}
21
+ ]'''
17
22
[cases .uint64_uint32 ]
18
- oil_skip = ' tests need updating for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/310
19
23
param_types = [" std::pair<std::uint64_t, std::uint32_t>&" ]
20
24
setup = " return {{0, 1}};"
21
25
# Should still have static size of 16 due to padding
@@ -29,8 +33,28 @@ includes = ["vector", "utility", "cstdint"]
29
33
}
30
34
]
31
35
'''
36
+ expect_json_v2 = ''' [
37
+ {"staticSize": 16, "exclusiveSize": 4, "members": [
38
+ {"typeNames": ["uint64_t"], "staticSize": 8, "exclusiveSize": 8},
39
+ {"typeNames": ["uint32_t"], "staticSize": 4, "exclusiveSize": 4}
40
+ ]}
41
+ ]'''
42
+
43
+ [cases .uint64_uint64_ptr ]
44
+ # Stubbed pointers were previously generated as a uintptr_t. Now they're
45
+ # generated as a special StubbedPointer type. This previously caused
46
+ # codegen problems as uintptr_t is a typedef of uint64_t and they'd both
47
+ # be specialised on a template.
48
+ param_types = [" std::pair<uint64_t, uint64_t*>&" ]
49
+ setup = " return {{0, nullptr}};"
50
+ expect_json_v2 = ''' [
51
+ {"staticSize": 16, "exclusiveSize": 0, "members": [
52
+ {"typeNames": ["uint64_t"], "staticSize": 8, "exclusiveSize": 8},
53
+ {"typeNames": ["uintptr_t (stubbed)"], "staticSize": 8, "exclusiveSize": 8}
54
+ ]}
55
+ ]'''
56
+
32
57
[cases .vector_vector ]
33
- oil_skip = ' tests need updating for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/310
34
58
param_types = [" std::pair<std::vector<std::uint64_t>, std::vector<std::uint64_t>>&" ]
35
59
setup = " return {{std::initializer_list<std::uint64_t>({0,1,2}), std::initializer_list<std::uint64_t>({3,4,5,6})}};"
36
60
expect_json = '''
@@ -57,3 +81,9 @@ includes = ["vector", "utility", "cstdint"]
57
81
}
58
82
]
59
83
'''
84
+ expect_json_v2 = ''' [
85
+ {"staticSize": 48, "exclusiveSize": 0, "members": [
86
+ {"typeNames": ["std::vector<uint64_t, std::allocator<uint64_t>>"], "staticSize": 24, "exclusiveSize": 24},
87
+ {"typeNames": ["std::vector<uint64_t, std::allocator<uint64_t>>"], "staticSize": 24, "exclusiveSize": 24}
88
+ ]}
89
+ ]'''
0 commit comments