From 4b4c00a1af152c551ef2c0c7207e66ace7cb5bd7 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 22 Oct 2016 14:40:34 +0200 Subject: [PATCH] Check for `SEGMENTS_ALL` when printing --- test/testpaint/Printer.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/test/testpaint/Printer.cpp b/test/testpaint/Printer.cpp index 2d129b45ea..efdd5183da 100644 --- a/test/testpaint/Printer.cpp +++ b/test/testpaint/Printer.cpp @@ -122,14 +122,24 @@ namespace Printer { static std::string PrintSegmentSupportHeightCall(SegmentSupportCall call) { std::string out = ""; - int segmentsPrinted = 0; - for (int i = 0; i < 9; i++) { - if (call.segments & segment_offsets[i]) { - if (segmentsPrinted > 0) { - out += " | "; + if (call.segments == SEGMENTS_ALL) + { + out += "SEGMENTS_ALL"; + } + else + { + int segmentsPrinted = 0; + for (int i = 0; i < 9; i++) + { + if (call.segments & segment_offsets[i]) + { + if (segmentsPrinted > 0) + { + out += " | "; + } + out += String::Format("SEGMENT_%02X", 0xB4 + 4 * i); + segmentsPrinted++; } - out += String::Format("SEGMENT_%02X", 0xB4 + 4 * i); - segmentsPrinted++; } }