diff --git a/DXFeedFramework/Native/Schedule/NativeSchedule.swift b/DXFeedFramework/Native/Schedule/NativeSchedule.swift index b3c873340..f53961b0a 100644 --- a/DXFeedFramework/Native/Schedule/NativeSchedule.swift +++ b/DXFeedFramework/Native/Schedule/NativeSchedule.swift @@ -10,18 +10,18 @@ import Foundation class NativeSchedule { let schedule: UnsafeMutablePointer? - + init(schedule: UnsafeMutablePointer?) { self.schedule = schedule } - + convenience init(scheduleDefinition: String) throws { let thread = currentThread() let schedule = try ErrorCheck.nativeCall(thread, dxfg_Schedule_getInstance2(thread, scheduleDefinition.toCStringRef())) self.init(schedule: schedule) } - + convenience init(instrumentProfile: InstrumentProfile) throws { let mapper = InstrumentProfileMapper() let native = mapper.toNative(instrumentProfile: instrumentProfile) @@ -32,7 +32,7 @@ class NativeSchedule { mapper.releaseNative(native: native) self.init(schedule: schedule) } - + convenience init(instrumentProfile: InstrumentProfile, venue: String) throws { let mapper = InstrumentProfileMapper() let native = mapper.toNative(instrumentProfile: instrumentProfile) @@ -44,7 +44,7 @@ class NativeSchedule { mapper.releaseNative(native: native) self.init(schedule: schedule) } - + deinit { if let schgedule = schedule { let thread = currentThread() @@ -53,32 +53,32 @@ class NativeSchedule { &(schgedule.pointee.handler))) } } - + public func getName() throws -> String { let thread = currentThread() let name = try ErrorCheck.nativeCall(thread, dxfg_Schedule_getName(thread, schedule)) return String(pointee: name) } - + public func getTimeZone() throws -> String { let thread = currentThread() let timeZone = try ErrorCheck.nativeCall(thread, dxfg_Schedule_getTimeZone(thread, schedule)) return String(pointee: timeZone) } - + public func getDayByTime(time: Long) throws -> ScheduleDay { let thread = currentThread() let day = try ErrorCheck.nativeCall(thread, dxfg_Schedule_getDayByTime(thread, schedule, time)) let scheduleDay = try createDay(thread, day) return scheduleDay } - + public func getDayById(dayId: Int32) throws -> ScheduleDay { let thread = currentThread() let day = try ErrorCheck.nativeCall(thread, dxfg_Schedule_getDayById(thread, schedule, dayId)) return try createDay(thread, day) } - + private func createDay(_ thread: OpaquePointer?, _ day: UnsafeMutablePointer) throws -> ScheduleDay { let scheduleDay = ScheduleDay() diff --git a/DXFeedFrameworkTests/DXScheduleTest.swift b/DXFeedFrameworkTests/DXScheduleTest.swift index 543de2cfb..9ff6b5348 100644 --- a/DXFeedFrameworkTests/DXScheduleTest.swift +++ b/DXFeedFrameworkTests/DXScheduleTest.swift @@ -72,13 +72,6 @@ final class DXScheduleTest: XCTestCase { for session in day.sessions where [.afterMarket, .preMarket, .regular].contains(session.type) { extendedHours.append(session) } - let date = String(format: "%d-%02d-%02d", arguments: [day.year, day.monthOfYear, day.dayOfMonth]) - var sessions = "\n" - day.sessions.forEach { sch in - sessions += "\(sch.startTime) \(sch.endTime) \(sch.type) \n" - } - print("\(date) \(day.holiday) \(day.shortDay) \(sessions)") - } XCTAssert(sessionBreaks.count == 246) XCTAssert(extendedHours.count == 300) @@ -95,6 +88,4 @@ final class DXScheduleTest: XCTestCase { // } // } - - }