-
Notifications
You must be signed in to change notification settings - Fork 196
Fix Data Base64 length encoding bug #1425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Data Base64 length encoding bug #1425
Conversation
@swift-ci test |
#expect(stringBase64 == String(decoding: dataBase64, as: Unicode.UTF8.self)) | ||
} | ||
|
||
for count in 0..<10_000 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 10,000? If it takes a while to run and doesn’t provide additional code coverage it might be better to pick a lower number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed to 1_000 and parameterized the test:
Test testBase64DataOutputMatchesStingOutput(options:) started.
Test case passing 1 argument options → Base64EncodingOptions(rawValue: 33) to testBase64DataOutputMatchesStingOutput(options:) started.
Test case passing 1 argument options → Base64EncodingOptions(rawValue: 17) to testBase64DataOutputMatchesStingOutput(options:) started.
Test case passing 1 argument options → Base64EncodingOptions(rawValue: 2) to testBase64DataOutputMatchesStingOutput(options:) started.
Test case passing 1 argument options → Base64EncodingOptions(rawValue: 0) to testBase64DataOutputMatchesStingOutput(options:) started.
Test case passing 1 argument options → Base64EncodingOptions(rawValue: 1) to testBase64DataOutputMatchesStingOutput(options:) started.
Test testBase64DataOutputMatchesStingOutput(options:) with 5 test cases passed after 0.061 seconds.
Test failures are known and I just fixed/disabled those tests. |
@swift-ci please test |
### Motivation We have an issue in encodeComputeCapacity. If we add lineBreaks, we assumed to add line breaks for lines that ended at the max capacity. ### Changes - encodeComputeCapacity checks if the last line uses the full length and removes unnecessary seperatorBytes if needed rdar://155204772
2b34d0c
to
56dde3d
Compare
@swift-ci test |
Thanks @fabianfett |
Motivation
We have an issue in
encodeComputeCapacity
. If we add lineBreaks, we assumed to add line breaks for lines that ended at the max capacity.Changes
encodeComputeCapacity
checks if the last line uses the full length and removes unnecessary seperatorBytes if neededrdar://155204772