Conversation
Headers/Public/VLCMedia.h
Outdated
| * receiver follows media. If media is nil, returns NSOrderedDescending. | ||
| */ | ||
| - (NSComparisonResult)compare:(VLCMedia *)media; | ||
| - (NSComparisonResult)compare:(nullable VLCMedia *)media; |
There was a problem hiding this comment.
In VLCMedia.m::compare, the line
if (!media)
can not be satisfied unless the parameter is nullable.
Or can it without it??
Headers/Public/VLCMedia.h
Outdated
| VLCMediaParsedStatusInit = 0, | ||
| VLCMediaParsedStatusSkipped, | ||
| VLCMediaParsedStatusFailed, | ||
| VLCMediaParsedStatusTimeout, |
There was a problem hiding this comment.
| - (void)volumeDown | ||
| { | ||
| int tempVolume = [self volume] - VOLUME_STEP; | ||
| if (tempVolume > VOLUME_MAX) |
There was a problem hiding this comment.
This predicate will never execute as setVolume performs this check already
| int tempVolume = [self volume] + VOLUME_STEP; | ||
| if (tempVolume > VOLUME_MAX) | ||
| tempVolume = VOLUME_MAX; | ||
| else if (tempVolume < VOLUME_MIN) |
There was a problem hiding this comment.
This predicate is also impossible as setVolume already checks this
Sources/VLCMedia.m
Outdated
| options, | ||
| -1); | ||
| // Using the default time-out value | ||
| return [self parseWithOptions:options timeout:-1]; |
There was a problem hiding this comment.
Does the same thing as the deleted code :D
Sources/VLCMedia.m
Outdated
| } | ||
|
|
||
| urlString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | ||
| if ([[urlString stringByRemovingPercentEncoding] isEqualToString:urlString]) { |
There was a problem hiding this comment.
Addresses https://code.videolan.org/videolan/VLCKit/issues/139 and https://code.videolan.org/videolan/VLCKit/issues/45, I think?? Need more tests :D
Sources/VLCMedia.m
Outdated
| { | ||
| [self willChangeValueForKey:@"parsedStatus"]; | ||
| [self parsedStatus]; | ||
| [self fetchEssentialMetaInformation]; |
There was a problem hiding this comment.
| [self setState: [newStateAsNumber intValue]]; | ||
| } | ||
|
|
||
| #if TARGET_OS_IPHONE |
There was a problem hiding this comment.
Why were there two separate metaDictionary functions for iOS and non-iOS platforms?
474c047 to
9f9466c
Compare
| func XCTAssertNotNilAndUnwrap<T>(_ variable: T?, message: String = "Unexpected nil variable", file: StaticString = #file, line: UInt = #line) throws -> T { | ||
| guard let variable = variable else { | ||
| XCTFail(message, file: file, line: line) | ||
| throw UnexpectedNilError() |
There was a problem hiding this comment.
do we need to throw here since this is just a test ?
Tests/Sources/VLCAudioTest.swift
Outdated
| audio.isMuted = false | ||
| XCTAssertFalse(audio.isMuted) | ||
|
|
||
| audio.setMute(true) |
There was a problem hiding this comment.
huh, I wonder if we really need the setter and the property. @fkuehne ?
There was a problem hiding this comment.
I think this can be removed since this is a deprecated API
There was a problem hiding this comment.
Yes, this API will be removed in v4.
| } else { | ||
| XCTAssertEqual(audio.volume, Int32(max - (i * step))) | ||
| } | ||
| } |
There was a problem hiding this comment.
This code block is actually quite a bit confusing. I'm guessing 9000 is above the max ?
and what does the step do ? I have actually no clue what you're testing for :D
Tests/Sources/VLCAudioTest.swift
Outdated
| } | ||
| } | ||
|
|
||
| XCTAssertEqual(audio.volume, Int32(max)) |
|
|
||
| for (repeatCount, expected) in tests { | ||
| (0..<repeatCount).forEach { _ in audio.volumeDown() } | ||
| XCTAssertEqual(audio.volume, expected) |
There was a problem hiding this comment.
I just see this now but I think it might make sense to split setting volume and volumedown. Because right now you rely on audio.volume = Int32(9000) to cap and work so that the next tests succeed. They should be independent.
|
merged with ca81ecd and following |
This PR is just here to show you guys what I have been working on :D.
I've written couple of comments here and there to illustrate what I did to fix the bugs I found.
I will split up the massivcommit/PR into separate PRs next week