mbeckerle commented on a change in pull request #748:
URL: https://github.com/apache/daffodil/pull/748#discussion_r802048084



##########
File path: 
daffodil-io/src/main/scala/org/apache/daffodil/io/DirectOrBufferedDataOutputStream.scala
##########
@@ -966,6 +966,12 @@ object DirectOrBufferedDataOutputStream {
     Assert.invariant(bufDOS.isBuffering)
     Assert.invariant(!directDOS.isBuffering)
 
+    // ensure that if we know the absoluste starting position of the buffered
+    // DOS that it matches the ending bit position of the direct DOS we are
+    // about to deliver it to
+    val maybeBufStartPos = bufDOS.maybeAbsStartingBitPos0b
+    Assert.invariant(maybeBufStartPos.isEmpty || maybeBufStartPos.get == 
directDOS.maybeAbsBitPos0b.get)

Review comment:
       Hard to imagine it worked at all before without this. 

##########
File path: 
daffodil-io/src/test/scala/org/apache/daffodil/io/TestDataOutputStream4.scala
##########
@@ -41,10 +41,10 @@ class TestDataOutputStream4 {
 
     val out = direct.addBuffered
     if (setAbs)
-      out.setAbsStartingBitPos0b(ULong(20))
+      out.setAbsStartingBitPos0b(ULong(19))

Review comment:
       How could this possibly have worked before? Were these tests not called?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to