Skip to content

Commit

Permalink
1.add qt unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryRiley0 committed Dec 2, 2024
1 parent eb9f5e4 commit d4bb675
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Versioning].
- solve the problem of failed parsing of containers ([@henryriley0])
- Fixes #421 - Added `registerLimit` option to specify the registers to
display - PR #444 ([@chenzhiy2001])
- 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

0 comments on commit d4bb675

Please sign in to comment.