Comments (4)
It does? It shouldn't… it's supposed to check that calling zippedData on already zippedData returns the same value instead of re-applying the zip function.
from gzip.
- (void)testRezipZippedData
{
//set up data
NSString *inputString = @"Hello World!";
NSData *inputData = [inputString dataUsingEncoding:NSUTF8StringEncoding];
//compress
NSData *compressedData = [inputData gzippedData];
inputString = [[NSString alloc] initWithData:compressedData encoding:NSUTF8StringEncoding]; <-- doesn't make sense, returns nil, on swift - crashes.
//compress again
NSData *outputData = [compressedData gzippedData];
NSString *outputString = [[NSString alloc] initWithData:outputData encoding:NSUTF8StringEncoding]; <-- doesn't make sense, returns nil, on swift - crashes.
XCTAssertEqualObjects(outputString, inputString); <-- doesn't make sense.
}
I think, it should be:
func testRezipZippedData() {
// setup
let inputString: NSString = "Hello World!"
let inputData = inputString.dataUsingEncoding(NSUTF8StringEncoding)!
// compress
let compressedData = inputData.gzippedData()!
// compress again
let outputData = compressedData.gzippedData()!
let outputString = NSString(data: outputData.gunzippedData()!, encoding: NSUTF8StringEncoding)
XCTAssertEqual(outputString, inputString)
}
from gzip.
Hmm, you're right. Thanks.
from gzip.
Fixed.
from gzip.
Related Issues (20)
- gzippedData returns nil HOT 1
- Uncompress code causing crash HOT 2
- Hi,Can We add pod support for convineince? HOT 1
- Crash on iOS 9 HOT 1
- Add Carthage Support HOT 5
- Support for .tar.gz files HOT 1
- Ungzip while reading file HOT 1
- Don't use dlopen and dlsym in iOS App Store project HOT 5
- iOS GZIP value differs between iOS10 -> iOS11 HOT 1
- how can i compress a folder with multi- files in it HOT 1
- Password Protection capability HOT 1
- Gzip
- Xcode 12 and Swift 5.3 compatibility
- FR: Add precompiled assets to the tag
- deflateInit2 causing unknown crashes HOT 3
- pod new version is 1.3.0 , The latest version is 1.3.1 HOT 1
- Missing PrivacyInfo file HOT 2
- Different gzipped data, but gunzipped same result. Is this expected? HOT 2
- NSData+Gzip HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gzip.