Skip to content

Fix GraphHost/setTime(_ time:) guard should be not equal. #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 21, 2024
Merged

Fix GraphHost/setTime(_ time:) guard should be not equal. #74

merged 4 commits into from
Apr 21, 2024

Conversation

Dark-Existed
Copy link
Contributor

No description provided.

@Kyle-Ye
Copy link
Member

Kyle-Ye commented Apr 9, 2024

Could you please also add a GraphHostTests.swift file under Tests/OpenSwiftUITests and add a test case for setTime?

//
//  GraphHostTests.swift
//  OpenSwiftUITests

@testable import OpenSwiftUI
import Testing

struct GraphHostTests {
    @Test
    func setTimeTest() {
        ...
    }
}

@Dark-Existed
Copy link
Contributor Author

Done.

@Dark-Existed
Copy link
Contributor Author

Dark-Existed commented Apr 10, 2024

On Ubuntu when access graphHost.data.time will crash.
It looks like @ Attribute cause this?
PTAL.

Thread 0 "OpenSwiftUIPack":
0  0x00007f9955382cce <unknown> in libc.so.6
Thread 1 crashed:
0 [system]         0x0000564cb14aece4 GraphHost.Data.time.getter + 36 in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/Sources/OpenSwiftUI/Core/Graph/GraphHost.swift
  1 [ra] [inlined]   0x0000564cb159b053 freestanding macro expansion #1 of expect in GraphHostTests.setTimeTest() in OpenSwiftUIPackageTests.xctest at /tmp/swift-generated-sources/@__swiftmacro_16OpenSwiftUITests14GraphHostTestsV11setTimeTestyyF6expectfMf_.swift:1:52
  2 [ra]             0x0000564cb159b053 GraphHostTests.setTimeTest() + 146 in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/Tests/OpenSwiftUITests/Core/Graph/GraphHostTests.swift:12:9
  3 [ra]             0x0000564cb159baa6 closure #2 in static GraphHostTests.$s16OpenSwiftUITests14GraphHostTestsV11setTimeTest0I0fMp_17funcsetTimeTest__fMu1_@Sendable () + 53 in OpenSwiftUIPackageTests.xctest at /tmp/swift-generated-sources/@__swiftmacro_16OpenSwiftUITests14GraphHostTestsV11setTimeTest0I0fMp_.swift:13:102
  4 [async]          0x0000564cb16fbca0 __ifMainActorIsolationEnforced<A>(_:else:) in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/.build-test-debug/checkouts/swift-testing/Sources/Testing/Test+Macro.swift:493
  5 [async]          0x0000564cb159ab70 static GraphHostTests.$s16OpenSwiftUITests14GraphHostTestsV11setTimeTest0I0fMp_17funcsetTimeTest__fMu1_@Sendable () in OpenSwiftUIPackageTests.xctest at /tmp/swift-generated-sources/@__swiftmacro_16OpenSwiftUITests14GraphHostTestsV11setTimeTest0I0fMp_.swift:8
  6 [async]          0x0000564cb159be40 implicit closure #1 in static GraphHostTests.$s16OpenSwiftUITests14GraphHostTestsV11setTimeTest0I0fMp_47__🟠$test_container__function__funcsetTimeTest__fMu_.__tests.getter in OpenSwiftUIPackageTests.xctest at /tmp/swift-generated-sources/@__swiftmacro_16OpenSwiftUITests14GraphHostTestsV11setTimeTest0I0fMp_.swift:28
  7 [async]          0x0000564cb16da500 closure #1 in closure #1 in closure #1 in closure #1 in Runner._runTestCase(_:within:) in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/.build-test-debug/checkouts/swift-testing/Sources/Testing/Running/Runner.swift:328
  8 [async] [thunk]  0x0000564cb16e1e50 partial apply for closure #1 in closure #1 in closure #1 in closure #1 in Runner._runTestCase(_:within:) in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/<compiler-generated>
  9 [async]          0x0000564cb16cf030 Runner._executeTraits(for:testCase:_:) in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/.build-test-debug/checkouts/swift-testing/Sources/Testing/Running/Runner.swift:130
 10 [async]          0x0000564cb16da250 closure #1 in closure #1 in closure #1 in Runner._runTestCase(_:within:) in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/.build-test-debug/checkouts/swift-testing/Sources/Testing/Running/Runner.swift:327
 11 [async] [thunk]  0x0000564cb16e1b80 partial apply for closure #1 in closure #1 in closure #1 in Runner._runTestCase(_:within:) in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/<compiler-generated>
 12 [async]          0x0000564cb171fe40 withTimeLimit(for:configuration:_:timeoutHandler:) in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/.build-test-debug/checkouts/swift-testing/Sources/Testing/Traits/TimeLimitTrait.swift:195
 13 [async]          0x0000564cb16d9e40 closure #1 in closure #1 in Runner._runTestCase(_:within:) in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/.build-test-debug/checkouts/swift-testing/Sources/Testing/Running/Runner.swift:326
 14 [async] [thunk]  0x0000564cb16e1880 partial apply for closure #1 in closure #1 in Runner._runTestCase(_:within:) in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/<compiler-generated>
 15 [async]          0x0000564cb16cdc90 Runner._withErrorHandling(sourceLocation:_:) in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/.build-test-debug/checkouts/swift-testing/Sources/Testing/Running/Runner.swift:87
 16 [async]          0x0000564cb16d9740 closure #1 in Runner._runTestCase(_:within:
) in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/.build-test-debug/checkouts/swift-testing/Sources/Testing/Running/Runner.swift:325
 17 [async] [thunk]  0x0000564cb16e1780 partial apply for closure #1 in Runner._runTestCase(_:within:) in OpenSwiftUIPackageTests.xctest at /__w/OpenSwiftUI/OpenSwiftUI/<compiler-generated>
 18 [async]          0x00007f9956377d00 TaskLocal.withValueImpl<A>(_:operation:file:line:) in libswift_Concurrency.so
 ...

@Dark-Existed
Copy link
Contributor Author

Dark-Existed commented Apr 11, 2024

OK, I see, it hasn`t implemented OGGraphGetValue for OpenGraph.

@Kyle-Ye Kyle-Ye merged commit e449dd2 into OpenSwiftUIProject:main Apr 21, 2024
5 checks passed
@Kyle-Ye
Copy link
Member

Kyle-Ye commented Apr 21, 2024

Thanks. Sorry for the delayed reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants