Skip to contentSkip to conversation

s390x: Beautify sthyi report strings

PATCH Thomas Huth 1 participant 1 message Feb 25, 2019 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 50 lines · David Hildenbrand
Quoted 49 lines · Janosch Frank
Quoted 47 lines · Thomas Huth
Quoted 2 lines · Janosch Frank

Tests like the register odd check in r1 and r2 were not destinguishable and the reports were hard to read in total.

distinguishable

Quoted 28 lines
---
 s390x/sthyi.c | 45 +++++++++++++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 16 deletions(-)
s390x/sthyi.c +3 -2
index 16b8c14..aaf13af 100644
@@ -52,10 +52,12 @@ static void test_exception_addr(void)
 
 static void test_exception_reg_odd(void)
 {
-	report_prefix_push("Register check odd");
+	report_prefix_push("Register check odd R1");
 	expect_pgm_int();
 	sthyi((uint64_t)pagebuf, 0, NULL, 1, 2);
 	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
+	report_prefix_pop();
+	report_prefix_push("Register check odd R2");
 	expect_pgm_int();
 	sthyi((uint64_t)pagebuf, 0, NULL, 0, 3);
 	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
@@ -76,52 +78,59 @@ static void test_function_code(uint64_t addr)
 	uint64_t urc = 0;
 	int cc = sthyi((uint64_t)pagebuf, 42, &urc, 0, 2);
 
-	report("Ill. fcode", cc == 3 && urc == CODE_UNSUPP);

s390x/sthyi.c static void test_function_code(uint64_t addr) · line 89

Quoted 10 lines
s390x/sthyi.c +4 -1
+	report("Illegal fcode", cc == 3 && urc == CODE_UNSUPP);
 }
 
 static void test_fcode0_hdr(struct sthyi_hdr_sctn *hdr)
 {
-	report("HDR length", (hdr->INFHDLN >= sizeof(*hdr)
+	report_prefix_push("Header");
+
+	report("length", (hdr->INFHDLN >= sizeof(*hdr)
 			      && !(hdr->INFHDLN % 8)));

That fits into one line now (especially if you also remove the redundant parentheses around the conditional expression).

Quoted 5 lines
Quoted 3 lines

You and your hate for parentheses... :-)
Fixed all of the problems.

Maybe he's traumatized by LISP ... just like me ;)

Yes, I took a LISP course at the university once ... I never overcame that trauma... ;-)

Thomas