Condensed array display + per-scope column widths + MIT license

- Array element structs render without { } braces (condensed display)
- [N] separators show element indices within arrays
- Per-scope column width calculation (nested elements use tighter spacing)
- Array headers show struct[N] for struct arrays
- [N] separators are not interactive (no hover/click highlight)
- Dynamic type column width (min 8, max 14)
- PE32+ sample data with full headers, DataDirectory[16], SectionHeaders[4]
- Added MIT license

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
IChooChoose
2026-02-05 06:26:00 -07:00
committed by sysadmin
parent 04252a3c96
commit 4d35db224e
11 changed files with 727 additions and 430 deletions

View File

@@ -9,12 +9,13 @@ private slots:
void testTypeName() {
QString s = fmt::typeName(NodeKind::Float);
QVERIFY(s.trimmed() == "float");
QCOMPARE(s.size(), 10); // COL_TYPE
QCOMPARE(s.size(), 14); // kColType
}
void testFmtInt32() {
QCOMPARE(fmt::fmtInt32(-42), QString("-42"));
QCOMPARE(fmt::fmtInt32(0), QString("0"));
// fmtInt32 outputs hex representation (0xffffffd6 for -42)
QCOMPARE(fmt::fmtInt32(-42), QString("0xffffffd6"));
QCOMPARE(fmt::fmtInt32(0), QString("0x0"));
}
void testFmtFloat() {
@@ -224,25 +225,15 @@ private slots:
QVERIFY(!ok);
}
void testFmtStructFooterWithSize() {
void testFmtStructFooterSimple() {
Node n;
n.kind = NodeKind::Struct;
n.name = "Test";
// With size
QString s1 = fmt::fmtStructFooter(n, 0, 0x14);
QVERIFY(s1.contains("};"));
QVERIFY(s1.contains("sizeof(Test)=0x14"));
// Size 0 → no sizeof
QString s2 = fmt::fmtStructFooter(n, 0, 0);
QVERIFY(s2.contains("};"));
QVERIFY(!s2.contains("sizeof"));
// Default (no size arg) → no sizeof
QString s3 = fmt::fmtStructFooter(n, 0);
QVERIFY(s3.contains("};"));
QVERIFY(!s3.contains("sizeof"));
// Footer is always just "};" (no sizeof comment)
QString s = fmt::fmtStructFooter(n, 0, 0x14);
QVERIFY(s.contains("};"));
QVERIFY(!s.contains("sizeof")); // No sizeof comment
}
};