Merge branch 'master' into sid-dahiya/JniBuildFix
This commit is contained in:
Коммит
9c6d0d03f6
|
@ -27,7 +27,20 @@ public:
|
|||
LOG_INFO("=== %s.%s [%s]", test.test_case_name(), test.name(), test.result()->Passed() ? "OK" : "FAILED");
|
||||
if(!test.result()->Passed())
|
||||
{
|
||||
#if 0
|
||||
// use something like this code after we switch to Xcode 12 and can
|
||||
// delete the deprecated code in the else block below. ADO 4251996
|
||||
XCTSourceCodeLocation *location = [[[XCTSourceCodeLocation alloc] initWithFilePath:[NSString stringWithUTF8String:test.file()] lineNumber:test.line()] autorelease];
|
||||
XCTSourceCodeContext *context = [[[XCTSourceCodeContext alloc] initWithLocation:location] autorelease];
|
||||
XCTIssue *issue = [[[XCTIssue alloc] initWithType:XCTIssueTypeAssertionFailure compactDescription:[NSString stringWithUTF8String:test.test_case_name()] detailedDescription:nil sourceCodeContext:context associatedError:nil attachments:@[]] autorelease];
|
||||
|
||||
[m_tests recordIssue:issue];
|
||||
#else
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[m_tests recordFailureWithDescription:[NSString stringWithUTF8String:test.test_case_name()] inFile:[NSString stringWithUTF8String:test.file()] atLine:test.line() expected:true];
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
}
|
||||
}
|
||||
private:
|
||||
|
|
|
@ -38,7 +38,8 @@ class TransmissionPolicyManager4Test : public TransmissionPolicyManager {
|
|||
void uploadScheduled(bool state) { m_isUploadScheduled = state; }
|
||||
|
||||
std::set<EventsUploadContextPtr> const& activeUploads() const { return m_activeUploads; }
|
||||
EventsUploadContextPtr fakeActiveUpload() { auto ctx = new EventsUploadContext(); ctx->requestedMinLatency = EventLatency_RealTime; m_activeUploads.insert(ctx); return ctx; }
|
||||
EventsUploadContextPtr fakeActiveUpload() { auto ctx = new EventsUploadContext(); ctx->requestedMinLatency = EventLatency_RealTime; m_activeUploads.insert(ctx); return ctx; }
|
||||
EventsUploadContextPtr fakeActiveUpload(EventLatency latency) { auto ctx = new EventsUploadContext(); ctx->requestedMinLatency = latency; m_activeUploads.insert(ctx); return ctx; }
|
||||
|
||||
bool paused() const { return m_isPaused; }
|
||||
void paused(bool state) { m_isPaused = state; }
|
||||
|
@ -46,6 +47,8 @@ class TransmissionPolicyManager4Test : public TransmissionPolicyManager {
|
|||
int timerDelay() const { return m_timerdelay; }
|
||||
void timerDelay(int delay) { m_timerdelay = delay; }
|
||||
|
||||
void runningLatency(EventLatency latency) { m_runningLatency = latency; }
|
||||
|
||||
void NotMockScheduleUpload(int delay, EventLatency latency, bool force)
|
||||
{
|
||||
TransmissionPolicyManager::scheduleUpload(delay, latency, force);
|
||||
|
@ -279,11 +282,20 @@ TEST_F(TransmissionPolicyManagerTests, UploadInitiatesUpload)
|
|||
EXPECT_THAT(tpm.activeUploads(), Contains(upload));
|
||||
}
|
||||
|
||||
TEST_F(TransmissionPolicyManagerTests, EmptyUploadReschedulesAtTimerDelay)
|
||||
TEST_F(TransmissionPolicyManagerTests, EmptyUploadCeasesUploadingForRunningLatencyNormal)
|
||||
{
|
||||
auto upload = tpm.fakeActiveUpload(EventLatency_Normal);
|
||||
EXPECT_CALL(tpm, scheduleUpload(_, _, false))
|
||||
.Times(0);
|
||||
tpm.nothingToUpload(upload);
|
||||
}
|
||||
|
||||
TEST_F(TransmissionPolicyManagerTests, EmptyUploadReschedulesAtTimerDelayForRunningLatencyRealtime)
|
||||
{
|
||||
auto upload = tpm.fakeActiveUpload();
|
||||
constexpr std::chrono::duration<int,std::milli> delay { std::chrono::seconds(300) };
|
||||
tpm.timerDelay(delay.count());
|
||||
tpm.runningLatency(EventLatency_RealTime);
|
||||
EXPECT_CALL(tpm, scheduleUpload(delay.count(), EventLatency_Normal, false))
|
||||
.WillOnce(Return());
|
||||
tpm.nothingToUpload(upload);
|
||||
|
|
Загрузка…
Ссылка в новой задаче