Edward O'Callaghan submitted this change.

View Change


Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved Edward O'Callaghan: Looks good to me, approved Peter Marheine: Looks good to me, but someone else must approve
flashrom_tester: Fix unit test error

Commit 065366d (flashrom_tester: Change timestamp to UTC microsecond)
changed the time format, breaking the unit test. This patch
fixes the unit test.

BUG=None
BRANCH=None
TEST=cargo test

Change-Id: Iba42a9026b41ddb61bb704aa1c26783cd251d787
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69765
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
---
M util/flashrom_tester/src/logger.rs
1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/util/flashrom_tester/src/logger.rs b/util/flashrom_tester/src/logger.rs
index fb26bde..b700c19 100644
--- a/util/flashrom_tester/src/logger.rs
+++ b/util/flashrom_tester/src/logger.rs
@@ -153,9 +153,10 @@

assert_eq!(&buf[..5], "\x1b[35m");
// Time is difficult to test, assume it's formatted okay
+ // Split on the UTC timezone char
assert_eq!(
- &buf[24..],
- " \x1b[33m[ INFO ]\x1b[0m Test message at INFO\n"
+ buf.split_once("Z ").unwrap().1,
+ "\x1b[33m[ INFO ]\x1b[0m Test message at INFO\n"
);
}


To view, visit change 69765. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iba42a9026b41ddb61bb704aa1c26783cd251d787
Gerrit-Change-Number: 69765
Gerrit-PatchSet: 3
Gerrit-Owner: Evan Benn <evanbenn@google.com>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged