Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.add qt unit test #452

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -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