Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Versioning].
display - PR #444 ([@chenzhiy2001])
- resolve the issue of not being able to set the GDB binary with a path on
Windows - PR #448 ([@henryriley0])
- add qt unit test ([@henryriley0])

## [0.27.0] - 2024-02-07

Expand Down
127 changes: 127 additions & 0 deletions src/test/unit/gdb_expansion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,133 @@ suite("GDB Value Expansion", () => {
}
]);
});
test("QT Complex node", () => {
const node = `{{ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, <No data fields>}}}, size = 0, static shared_null = <same type>}, {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = 0}, <No data fields>}}}, size = 0, static shared_null = <same type>}}`;
assert.strictEqual(isExpandable(node), 1);
const variables = expandValue(variableCreate, node);
assert.deepStrictEqual(variables, [
{
"name": "[0]",
"value": "Object",
"variablesReference": {
"expanded": [
{
"name": "ref",
"value": "Object",
"variablesReference": {
"expanded": [
{
"name": "atomic",
"value": "Object",
"variablesReference": {
"expanded": [
{
"name": "_q_value",
"value": "Object",
"variablesReference": {
"expanded": [
{
"name": "std::__atomic_base<int>>",
"value": "Object",
"variablesReference": {
"expanded": [
{
"name": "_S_alignment",
"value": "4",
"variablesReference": 0
},
{
"name": "_M_i",
"value": "-1",
"variablesReference": 0
}
]
}
}
]
}
}
]
}
}
]
}
},
{
"name": "size",
"value": "0",
"variablesReference": 0
},
{
"name": "shared_null",
"value": "<same type>",
"variablesReference": 0
}
]
}
},
{
"name": "[1]",
"value": "Object",
"variablesReference": {
"expanded": [
{
"name": "ref",
"value": "Object",
"variablesReference": {
"expanded": [
{
"name": "atomic",
"value": "Object",
"variablesReference": {
"expanded": [
{
"name": "_q_value",
"value": "Object",
"variablesReference": {
"expanded": [
{
"name": "std::__atomic_base<int>>",
"value": "Object",
"variablesReference": {
"expanded": [
{
"name": "_S_alignment",
"value": "4",
"variablesReference": 0
},
{
"name": "_M_i",
"value": "0",
"variablesReference": 0
}
]
}
}
]
}
}
]
}
}
]
}
},
{
"name": "size",
"value": "0",
"variablesReference": 0
},
{
"name": "shared_null",
"value": "<same type>",
"variablesReference": 0
}
]
}
}
]);
});
test("Simple node with errors", () => {
const node = `{_enableMipMaps = false, _minFilter = <incomplete type>, _magFilter = <incomplete type>, _wrapX = <incomplete type>, _wrapY = <incomplete type>, _inMode = 6408, _mode = 6408, _id = 1, _width = 1024, _height = 1024}`;
assert.strictEqual(isExpandable(node), 1);
Expand Down
Loading