From 65461ccc48afa9f9f5d0a66b748f5707b2ae7dce Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 18 Mar 2023 12:47:43 +0100 Subject: [PATCH] fixes unit test --- .../src/com/minres/scviewer/database/fst/FstFileParser.java | 2 +- .../src/com/minres/scviewer/database/ftr/FtrDbLoader.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/com.minres.scviewer.database.fst/src/com/minres/scviewer/database/fst/FstFileParser.java b/plugins/com.minres.scviewer.database.fst/src/com/minres/scviewer/database/fst/FstFileParser.java index 0b273fe..eaf3eb9 100644 --- a/plugins/com.minres.scviewer.database.fst/src/com/minres/scviewer/database/fst/FstFileParser.java +++ b/plugins/com.minres.scviewer.database.fst/src/com/minres/scviewer/database/fst/FstFileParser.java @@ -36,7 +36,7 @@ class FstFileParser { // String version = FstLibrary.fstReaderGetVersionString(fst); long endTime = FstLibrary.fstReaderGetEndTime(fst); byte timeScale = FstLibrary.fstReaderGetTimescale(fst); - builder.setMaxTime(endTime, timeScale); + builder.setMaxTime(endTime, -timeScale); FstLibrary.fstReaderIterateHierRewind(fst); Pointer p = FstLibrary.fstReaderIterateHier(fst); while(p!=null && !p.equals(Pointer.NULL)) { diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java index d7ead39..a68dbb4 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java @@ -528,7 +528,7 @@ public class FtrDbLoader implements IWaveformDbLoader { CborType next = cborDecoder.peekType(); while(next != null && !break_type.isEqualType(next)) { long sz = cborDecoder.readArrayLength(); - assert(sz==5); + assert(sz==5 || sz==3); long type_id = cborDecoder.readInt(); long from_id = cborDecoder.readInt(); long to_id = cborDecoder.readInt();