Remove synchronization in GRXBufferedPipe:writesFinishedWithError and change tests correspondingly

pull/11070/head
Muxi Yan 8 years ago
parent ec8e82507e
commit 49b7f8349b
  1. 5
      src/objective-c/RxLibrary/GRXBufferedPipe.m
  2. 4
      src/objective-c/tests/RxLibraryUnitTests.m

@ -82,11 +82,6 @@
if (errorOrNil) {
// No need to write pending values.
[self finishWithError:_errorOrNil];
} else {
// Wait until all the pending writes to be finished.
dispatch_sync(_writeQueue, ^{
return;
});
}
}

@ -166,6 +166,9 @@
[pipe writeValue:anyValue];
[pipe writesFinishedWithError:nil];
// Wait buffered pipe to be flushed.
sleep(1);
// Then:
XCTAssertEqual(handler.timesCalled, 1);
XCTAssertEqualObjects(handler.value, anyValue);
@ -202,6 +205,7 @@
[pipe writesFinishedWithError:nil];
// then start the writeable
[pipe startWithWriteable:writeable];
sleep(1);
// Then:
XCTAssertEqual(handler.timesCalled, 1);

Loading…
Cancel
Save