-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Remove the now useless `handler` and adds the `traversal_func` and `processor` entries for `std::list`. This type is a bit weird as most of our sequential containers don't have any overhead on storing the element. I went for the same approach we take for maps where we have a shared `[]` element covering the map overhead and below that a `key` & `value`. As we only have a single element under it which doesn't have a logical name I went for `*`. Closes #315. Test Plan: - CI - Copied the relevant `std::vector` tests and updated the existing one.
- Loading branch information
1 parent
3871d92
commit e9d8df0
Showing
4 changed files
with
161 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
includes = ["list"] | ||
|
||
definitions = ''' | ||
struct SimpleStruct { | ||
int a; | ||
char b; | ||
long long c; | ||
}; | ||
''' | ||
|
||
[cases] | ||
[cases.int_empty] | ||
param_types = ["const std::list<int>&"] | ||
setup = "return {};" | ||
expect_json = '[{"staticSize":24, "dynamicSize":0, "length":0, "capacity":0, "elementStaticSize":4}]' | ||
expect_json_v2 = '[{"staticSize":24, "exclusiveSize":24, "length":0, "capacity":0, "members":[]}]' | ||
[cases.int_some] | ||
param_types = ["const std::list<int>&"] | ||
setup = "return {{1,2,3}};" | ||
expect_json = '[{"staticSize":24, "dynamicSize":12, "length":3, "capacity":3, "elementStaticSize":4}]' | ||
expect_json_v2 = '''[{"staticSize":24, "exclusiveSize":24, "length":3, "capacity":3, "members":[ | ||
{"staticSize":4, "exclusiveSize":4}, | ||
{"staticSize":4, "exclusiveSize":4}, | ||
{"staticSize":4, "exclusiveSize":4} | ||
]}]''' | ||
[cases.struct_some] | ||
param_types = ["const std::list<SimpleStruct>&"] | ||
setup = "return {{{}, {}, {}}};" | ||
expect_json = '[{"staticSize":24, "dynamicSize":48, "length":3, "capacity":3, "elementStaticSize":16}]' | ||
expect_json_v2 = '''[{"staticSize":24, "exclusiveSize":24, "length":3, "capacity":3, "members":[ | ||
{"staticSize":16, "exclusiveSize":3}, | ||
{"staticSize":16, "exclusiveSize":3}, | ||
{"staticSize":16, "exclusiveSize":3} | ||
]}]''' | ||
[cases.list_int_empty] | ||
param_types = ["const std::list<std::list<int>>&"] | ||
setup = "return {};" | ||
expect_json = '[{"staticSize":24, "dynamicSize":0, "length":0, "capacity":0, "elementStaticSize":24}]' | ||
expect_json_v2 = '[{"staticSize":24, "exclusiveSize":24, "length":0, "capacity":0, "members":[]}]' | ||
[cases.list_int_some] | ||
param_types = ["const std::list<std::list<int>>&"] | ||
setup = "return {{{1,2,3},{4},{5,6}}};" | ||
expect_json = '''[{ | ||
"staticSize":24, | ||
"dynamicSize":96, | ||
"exclusiveSize":24, | ||
"length":3, | ||
"capacity":3, | ||
"elementStaticSize":24, | ||
"members":[ | ||
{"staticSize":24, "dynamicSize":12, "exclusiveSize":36, "length":3, "capacity":3, "elementStaticSize":4}, | ||
{"staticSize":24, "dynamicSize":4, "exclusiveSize":28, "length":1, "capacity":1, "elementStaticSize":4}, | ||
{"staticSize":24, "dynamicSize":8, "exclusiveSize":32, "length":2, "capacity":2, "elementStaticSize":4} | ||
]}]''' | ||
expect_json_v2 = '''[{"staticSize":24, "exclusiveSize":24, "length":3, "capacity": 3, "members":[ | ||
{"staticSize":24, "exclusiveSize":24, "length":3, "capacity": 3, "members":[]}, | ||
{"staticSize":24, "exclusiveSize":24, "length":1, "capacity": 1, "members":[]}, | ||
{"staticSize":24, "exclusiveSize":24, "length":2, "capacity": 2, "members":[]} | ||
]}]''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters