Skip to content

Commit c50c149

Browse files
committed
try print different strtoul on windows and linux
1 parent d342847 commit c50c149

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/machine/instruction.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ uint16_t parse_csr_address(const QString &field_token, uint &chars_taken) {
13911391
chars_taken = r - str;
13921392
printf("aaaaaaaaaaaaa----------------------------------------------------------------\n");
13931393
printf(
1394-
"system - strtoul - function: { ori_str: %s, str: %s, chars_taken: %d, val: %x }\n",
1394+
"system - strtoul - function: { ori_str: %s, str: %s, chars_taken: %d, val: %lx }\n",
13951395
qPrintable(field_token), str, chars_taken, val);
13961396
return val;
13971397
}

src/machine/instruction.test.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,15 @@ void TestInstruction::instruction_code_from_str() {
9797
code_to_string[i].code, qPrintable(test_string_data), code);
9898
QCOMPARE(code, code_to_string[i].code);
9999
} catch (const Instruction::ParseError &e) {
100-
101-
TokenizedInstruction inst = TokenizedInstruction::from_line(test_string_data, Address(0x0), nullptr, 0);
100+
TokenizedInstruction inst
101+
= TokenizedInstruction::from_line(test_string_data, Address(0x0), nullptr, 0);
102102

103103
printf(
104-
"test_case: { base: %s, len: %d code: %x, test_string_data: %s}, output: { code: %x "
104+
"test_case: { base: %s, len: %d code: %x, test_string_data: %s}, output: { code: "
105+
"%x "
105106
"}\n",
106-
qPrintable(inst.base), code_to_string[i].str.length(),
107-
code_to_string[i].code, qPrintable(test_string_data), code);
107+
qPrintable(inst.base), code_to_string[i].str.length(), code_to_string[i].code,
108+
qPrintable(test_string_data), code);
108109

109110
printf("exception: %s\n", qPrintable(e.message));
110111
QFAIL(qPrintable(e.message));
@@ -114,6 +115,7 @@ void TestInstruction::instruction_code_from_str() {
114115
uint32_t code = 0;
115116
Instruction::code_from_string(&code, 100, "csrrw x0, 0x1, x1", Address(0x0));
116117

118+
QCOMPARE(1, 2);
117119
// RelocExpressionList reloc = {};
118120
// for (size_t i = 0; i < sizeof(pesude_code_to_string) / sizeof(pesude_code_to_string[0]); i++)
119121
// {

0 commit comments

Comments
 (0)