From e5bf9e7681a3b62c07325e30df231c9ef710ac67 Mon Sep 17 00:00:00 2001 From: James Moschou Date: Sun, 24 Aug 2025 16:15:48 +0200 Subject: [PATCH 1/6] Add OAGTreeValue and OAGTreeElement # Conflicts: # Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OGTreeElement.h # Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OGTreeValue.h # Sources/OpenGraphCxx/include/OpenGraph/OpenGraph-umbrella.h --- .../OpenAttributeGraph/OAGTreeElement.h | 87 +++++++++++++++++++ .../include/OpenAttributeGraph/OAGTreeValue.h | 42 +++++++++ .../OpenAttributeGraph-umbrella.h | 2 + Sources/OpenGraphCxx/Tree/OGTreeElement.cpp | 55 ++++++++++++ Sources/OpenGraphCxx/Tree/OGTreeValue.cpp | 25 ++++++ 5 files changed, 211 insertions(+) create mode 100644 Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGTreeElement.h create mode 100644 Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGTreeValue.h create mode 100644 Sources/OpenGraphCxx/Tree/OGTreeElement.cpp create mode 100644 Sources/OpenGraphCxx/Tree/OGTreeValue.cpp diff --git a/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGTreeElement.h b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGTreeElement.h new file mode 100644 index 00000000..502409d4 --- /dev/null +++ b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGTreeElement.h @@ -0,0 +1,87 @@ +// +// OAGTreeElement.h +// OpenAttributeGraphCxx + +#ifndef OAGTreeElement_h +#define OAGTreeElement_h + +#include +#include + +OAG_ASSUME_NONNULL_BEGIN + +OAG_IMPLICIT_BRIDGING_ENABLED + +OAG_EXTERN_C_BEGIN + +typedef struct _OAGTreeElement *OAGTreeElement OAG_SWIFT_STRUCT OAG_SWIFT_NAME(TreeElement); + +typedef struct OAGTreeElementValueIterator { + uintptr_t parent_elt; + uintptr_t next_elt; +} OAG_SWIFT_NAME(Values) OAGTreeElementValueIterator; + +typedef struct OAGTreeElementNodeIterator { + uintptr_t elt; + unsigned long node_index; +} OAG_SWIFT_NAME(Nodes) OAGTreeElementNodeIterator; + +typedef struct OAGTreeElementChildIterator { + uintptr_t parent_elt; + uintptr_t next_elt; + size_t subgraph_index; +} OAG_SWIFT_NAME(Children) OAGTreeElementChildIterator; + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +OAGTypeID OAGTreeElementGetType(OAGTreeElement tree_element) OAG_SWIFT_NAME(getter:OAGTreeElement.type(self:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +OAGAttribute OAGTreeElementGetValue(OAGTreeElement tree_element); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +uint32_t OAGTreeElementGetFlags(OAGTreeElement tree_element) OAG_SWIFT_NAME(getter:OAGTreeElement.flags(self:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +OAGTreeElement _Nullable OAGTreeElementGetParent(OAGTreeElement tree_element) + OAG_SWIFT_NAME(getter:OAGTreeElement.parent(self:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +OAGTreeElementValueIterator OAGTreeElementMakeValueIterator(OAGTreeElement tree_element) + OAG_SWIFT_NAME(getter:OAGTreeElement.values(self:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +OAGTreeValue _Nullable OAGTreeElementGetNextValue(OAGTreeElementValueIterator *iter) + OAG_SWIFT_NAME(OAGTreeElementValueIterator.next(self:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +OAGTreeElementNodeIterator OAGTreeElementMakeNodeIterator(OAGTreeElement tree_element) + OAG_SWIFT_NAME(getter:OAGTreeElement.nodes(self:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +OAGAttribute OAGTreeElementGetNextNode(OAGTreeElementNodeIterator *iter); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +OAGTreeElementChildIterator OAGTreeElementMakeChildIterator(OAGTreeElement tree_element) + OAG_SWIFT_NAME(getter:OAGTreeElement.children(self:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +OAGTreeElement _Nullable OAGTreeElementGetNextChild(OAGTreeElementChildIterator *iter) + OAG_SWIFT_NAME(OAGTreeElementChildIterator.next(self:)); + +OAG_EXTERN_C_END + +OAG_IMPLICIT_BRIDGING_DISABLED + +OAG_ASSUME_NONNULL_END + +#endif /* OAGTreeElement_h */ diff --git a/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGTreeValue.h b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGTreeValue.h new file mode 100644 index 00000000..cae7bafe --- /dev/null +++ b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGTreeValue.h @@ -0,0 +1,42 @@ +// +// OAGTreeValue.h +// OpenAttributeGraphCxx + +#ifndef OAGTreeValue_h +#define OAGTreeValue_h + +#include +#include +#include + +OAG_ASSUME_NONNULL_BEGIN + +OAG_IMPLICIT_BRIDGING_ENABLED + +OAG_EXTERN_C_BEGIN + +typedef struct _OAGTreeValue *OAGTreeValue OAG_SWIFT_STRUCT OAG_SWIFT_NAME(TreeValue); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +OAGTypeID OAGTreeValueGetType(OAGTreeValue tree_value) OAG_SWIFT_NAME(getter:OAGTreeValue.type(self:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +OAGAttribute OAGTreeValueGetValue(OAGTreeValue tree_value) OAG_SWIFT_NAME(getter:OAGTreeValue.value(self:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +const char *OAGTreeValueGetKey(OAGTreeValue tree_value) OAG_SWIFT_NAME(getter:OAGTreeValue.key(self:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +uint32_t OAGTreeValueGetFlags(OAGTreeValue tree_value) OAG_SWIFT_NAME(getter:OAGTreeValue.flags(self:)); + +OAG_EXTERN_C_END + +OAG_IMPLICIT_BRIDGING_DISABLED + +OAG_ASSUME_NONNULL_END + +#endif /* OAGTreeValue_h */ diff --git a/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OpenAttributeGraph-umbrella.h b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OpenAttributeGraph-umbrella.h index c67c2aba..f951f96e 100644 --- a/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OpenAttributeGraph-umbrella.h +++ b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OpenAttributeGraph-umbrella.h @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/Sources/OpenGraphCxx/Tree/OGTreeElement.cpp b/Sources/OpenGraphCxx/Tree/OGTreeElement.cpp new file mode 100644 index 00000000..994f8d6d --- /dev/null +++ b/Sources/OpenGraphCxx/Tree/OGTreeElement.cpp @@ -0,0 +1,55 @@ +// +// OGTreeElement.cpp +// OpenGraphCxx + +#include + +OGTypeID OGTreeElementGetType(OGTreeElement tree_element) { + // TODO + return nullptr; +} + +OGAttribute OGTreeElementGetValue(OGTreeElement tree_element) { + // TODO + return OGAttributeNil; +} + +uint32_t OGTreeElementGetFlags(OGTreeElement tree_element) { + // TODO + return 0; +} + +OGTreeElement OGTreeElementGetParent(OGTreeElement tree_element) { + // TODO + return nullptr; +} + +OGTreeElementValueIterator OGTreeElementMakeValueIterator(OGTreeElement tree_element) { + // TODO + return {0, 0}; +} + +OGTreeValue OGTreeElementGetNextValue(OGTreeElementValueIterator *iter) { + // TODO + return nullptr; +} + +OGTreeElementNodeIterator OGTreeElementMakeNodeIterator(OGTreeElement tree_element) { + // TODO + return {0, 0}; +} + +OGAttribute OGTreeElementGetNextNode(OGTreeElementNodeIterator *iter) { + // TODO + return OGAttributeNil; +} + +OGTreeElementChildIterator OGTreeElementMakeChildIterator(OGTreeElement tree_element) { + // TODO + return {0, 0, 0}; +} + +OGTreeElement OGTreeElementGetNextChild(OGTreeElementChildIterator *iter) { + // TODO + return 0; +} diff --git a/Sources/OpenGraphCxx/Tree/OGTreeValue.cpp b/Sources/OpenGraphCxx/Tree/OGTreeValue.cpp new file mode 100644 index 00000000..0e5241d2 --- /dev/null +++ b/Sources/OpenGraphCxx/Tree/OGTreeValue.cpp @@ -0,0 +1,25 @@ +// +// OGTreeValue.cpp +// OpenGraphCxx + +#include + +OGTypeID OGTreeValueGetType(OGTreeValue tree_value) { + // TODO + return nullptr; +} + +OGAttribute OGTreeValueGetValue(OGTreeValue tree_value) { + // TODO + return OGAttributeNil; +} + +const char *OGTreeValueGetKey(OGTreeValue tree_value) { + // TODO + return nullptr; +} + +uint32_t OGTreeValueGetFlags(OGTreeValue tree_value) { + // TODO + return 0; +} From ed7084113c4116adbcfc74fe98eef058e9dd5b1d Mon Sep 17 00:00:00 2001 From: James Moschou Date: Sun, 24 Aug 2025 16:15:54 +0200 Subject: [PATCH 2/6] Add OAGSubgraphGetTreeRoot --- Sources/OpenAttributeGraphCxx/Graph/OAGSubgraph.cpp | 5 +++++ .../include/OpenAttributeGraph/OAGSubgraph.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Sources/OpenAttributeGraphCxx/Graph/OAGSubgraph.cpp b/Sources/OpenAttributeGraphCxx/Graph/OAGSubgraph.cpp index 4b24503e..0d2537b2 100644 --- a/Sources/OpenAttributeGraphCxx/Graph/OAGSubgraph.cpp +++ b/Sources/OpenAttributeGraphCxx/Graph/OAGSubgraph.cpp @@ -251,3 +251,8 @@ void OAGSubgraphEndTreeElement(OAGAttribute attribute) { subgraph->end_tree(attribute); } } + +OAGTreeElement OAGSubgraphGetTreeRoot(OAGSubgraphRef cf_subgraph) { + // TODO + return nullptr; +} diff --git a/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGSubgraph.h b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGSubgraph.h index e49efa4c..c1bf16cc 100644 --- a/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGSubgraph.h +++ b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGSubgraph.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -139,6 +140,10 @@ OAG_EXPORT OAG_REFINED_FOR_SWIFT void OAGSubgraphEndTreeElement(OAGAttribute attribute); +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +_Nullable OAGTreeElement OAGSubgraphGetTreeRoot(OAGSubgraphRef cf_subgraph) OAG_SWIFT_NAME(getter:OAGSubgraphRef.treeRoot(self:)); + OAG_EXTERN_C_END OAG_IMPLICIT_BRIDGING_DISABLED From 68d48d60dd35ac53add07d222e438fbd8eb13867 Mon Sep 17 00:00:00 2001 From: James Moschou Date: Sun, 24 Aug 2025 16:21:04 +0200 Subject: [PATCH 3/6] Add Swift refinements for TreeElement --- Sources/OpenGraph/Tree/TreeElement.swift | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Sources/OpenGraph/Tree/TreeElement.swift diff --git a/Sources/OpenGraph/Tree/TreeElement.swift b/Sources/OpenGraph/Tree/TreeElement.swift new file mode 100644 index 00000000..2d7c3d9d --- /dev/null +++ b/Sources/OpenGraph/Tree/TreeElement.swift @@ -0,0 +1,28 @@ +// +// TreeElement.swift +// OpenGraph + +public import OpenGraphCxx + +extension TreeElement { + public var value: AnyAttribute? { + let result = __OGTreeElementGetValue(self) + return result == .nil ? nil : result + } +} + +extension Nodes: @retroactive IteratorProtocol { + public typealias Element = AnyAttribute + public mutating func next() -> AnyAttribute? { + let result = __OGTreeElementGetNextNode(&self) + return result == .nil ? nil : result + } +} + +extension Children: @retroactive IteratorProtocol { + public typealias Element = TreeElement +} + +extension Values: @retroactive IteratorProtocol { + public typealias Element = TreeValue +} From 031f25df5bf2f539e49b76590f5f638f24b06ffb Mon Sep 17 00:00:00 2001 From: James Moschou Date: Sun, 24 Aug 2025 16:34:42 +0200 Subject: [PATCH 4/6] Add graph tracing functions --- .../Graph/OAGGraphTracing.cpp | 46 +++++++++++++++++++ .../OpenAttributeGraph/OAGGraphTracing.h | 35 +++++++++++++- 2 files changed, 79 insertions(+), 2 deletions(-) diff --git a/Sources/OpenAttributeGraphCxx/Graph/OAGGraphTracing.cpp b/Sources/OpenAttributeGraphCxx/Graph/OAGGraphTracing.cpp index dedaa8df..ab6a64d3 100644 --- a/Sources/OpenAttributeGraphCxx/Graph/OAGGraphTracing.cpp +++ b/Sources/OpenAttributeGraphCxx/Graph/OAGGraphTracing.cpp @@ -15,3 +15,49 @@ void OAGGraphStartTracing2(_Nullable OAGGraphRef graph, OAGGraphTraceOptions opt void OAGGraphStopTracing(_Nullable OAGGraphRef graph) { // TODO } + +void OAGGraphSyncTracing(_Nullable OAGGraphRef graph) { + // TODO +} + +CFStringRef OAGGraphCopyTracePath(_Nullable OAGGraphRef graph) { + // TODO + return nullptr; +} + +OAGUniqueID OAGGraphAddTrace(OAGGraphRef graph, const OAGTraceRef trace, void *context) { + // TODO + return 0; +} + +void OAGGraphRemoveTrace(OAGGraphRef graph, OAGUniqueID trace_id) { + // TODO +} + +void OAGGraphSetTrace(OAGGraphRef graph, const OAGTraceRef trace, void *context) { + // TODO +} + +void OAGGraphResetTrace(OAGGraphRef graph) { + // TODO +} + +bool OAGGraphIsTracingActive(OAGGraphRef graph) { + // TODO + return false; +} + +const char *OAGGraphGetTraceEventName(uint32_t event_id) { + // TODO + return nullptr; +} + +const char *OAGGraphGetTraceEventSubsystem(uint32_t event_id) { + // TODO + return nullptr; +} + +uint32_t OAGGraphRegisterNamedTraceEvent(const char *event_name, const char *event_subsystem) { + // TODO + return 0; +} diff --git a/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGGraphTracing.h b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGGraphTracing.h index 062edf4c..14d7254e 100644 --- a/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGGraphTracing.h +++ b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGGraphTracing.h @@ -40,13 +40,44 @@ void OAGGraphStopTracing(_Nullable OAGGraphRef graph) OAG_SWIFT_NAME(OAGGraphRef OAG_EXPORT OAG_REFINED_FOR_SWIFT -OAGUniqueID OAGGraphAddTrace(OAGGraphRef graph, const OAGTraceRef trace, void *_Nullable context) -OAG_SWIFT_NAME(OAGGraphRef.addTrace(self:_:context:)); +void OAGGraphSyncTracing(_Nullable OAGGraphRef graph) OAG_SWIFT_NAME(OAGGraphRef.syncTracing(_:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +CFStringRef OAGGraphCopyTracePath(_Nullable OAGGraphRef graph) OAG_SWIFT_NAME(OAGGraphRef.tracePath(_:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +OAGUniqueID OAGGraphAddTrace(OAGGraphRef graph, const OAGTraceRef trace, void *_Nullable context) OAG_SWIFT_NAME(OAGGraphRef.addTrace(self:_:context:)); OAG_EXPORT OAG_REFINED_FOR_SWIFT void OAGGraphRemoveTrace(OAGGraphRef graph, OAGUniqueID trace_id) OAG_SWIFT_NAME(OAGGraphRef.removeTrace(self:traceID:)); +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +void OAGGraphSetTrace(OAGGraphRef graph, const OAGTraceRef trace, void *_Nullable context) OAG_SWIFT_NAME(OAGGraphRef.setTrace(self:_:context:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +void OAGGraphResetTrace(OAGGraphRef graph) OAG_SWIFT_NAME(OAGGraphRef.resetTrace(self:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +bool OAGGraphIsTracingActive(OAGGraphRef graph) OAG_SWIFT_NAME(getter:OAGGraphRef.isTracingActive(self:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +const char *_Nullable OAGGraphGetTraceEventName(uint32_t event_id) OAG_SWIFT_NAME(OAGGraphRef.traceEventName(for:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +const char *_Nullable OAGGraphGetTraceEventSubsystem(uint32_t event_id) OAG_SWIFT_NAME(OAGGraphRef.traceEventSubsystem(for:)); + +OAG_EXPORT +OAG_REFINED_FOR_SWIFT +uint32_t OAGGraphRegisterNamedTraceEvent(const char *event_name, const char *event_subsystem) OAG_SWIFT_NAME(OAGGraphRef.registerNamedTraceEvent(name:subsystem:)); + OAG_EXTERN_C_END OAG_IMPLICIT_BRIDGING_DISABLED From a403e04e5421b88e001a8408a15d847741bbbe6f Mon Sep 17 00:00:00 2001 From: James Moschou Date: Sun, 7 Sep 2025 17:25:00 +0200 Subject: [PATCH 5/6] Add compatibility tests for graph tracing methods --- .../GraphTracingCompatibilityTests.swift | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Tests/OpenAttributeGraphCompatibilityTests/Graph/GraphTracingCompatibilityTests.swift b/Tests/OpenAttributeGraphCompatibilityTests/Graph/GraphTracingCompatibilityTests.swift index a9f71c1c..f45bf648 100644 --- a/Tests/OpenAttributeGraphCompatibilityTests/Graph/GraphTracingCompatibilityTests.swift +++ b/Tests/OpenAttributeGraphCompatibilityTests/Graph/GraphTracingCompatibilityTests.swift @@ -9,8 +9,46 @@ struct GraphTracingCompatibilityTests { func tracing() { let graph = Graph() Graph.startTracing(graph, options: []) + Graph.syncTracing(graph) Graph.stopTracing(graph) } + + @Test + func tracePath() { + let graph = Graph() + let tracePath = Graph.tracePath(graph) + #expect(tracePath == nil) + } + + @Test(.disabled(if: !compatibilityTestEnabled, "Not implemented on OAG")) + func setTrace() { + let graph = Graph() + #expect(graph.isTracingActive == false) + + var trace = AGTrace() + withUnsafeMutablePointer(to: &trace) { tracePointer in + graph.setTrace(tracePointer, context: nil) + } + #expect(graph.isTracingActive == true) + + graph.resetTrace() + #expect(graph.isTracingActive == false) + } + + @Test(.disabled(if: !compatibilityTestEnabled, "Not implemented on OAG")) + func traceEventRegistration() { + let eventID = "TEST_EVENT".withCString { namePtr in + "TEST_SUBSYSTEM".withCString { subsystemPtr in + Graph.registerNamedTraceEvent(name: namePtr, subsystem: subsystemPtr) + } + } + + let name = Graph.traceEventName(for: eventID) + #expect(name.map { String(cString: $0) } == "TEST_EVENT") + + let subsystem = Graph.traceEventSubsystem(for: eventID) + #expect(subsystem.map { String(cString: $0) } == "TEST_SUBSYSTEM") + } @Test func tracingAll() { From 28c99d9e21fdfbf40b65ac19ff6ba69495dd7edd Mon Sep 17 00:00:00 2001 From: James Moschou Date: Sun, 7 Sep 2025 17:54:21 +0200 Subject: [PATCH 6/6] Add compatibility tests for tree --- .../Graph/SubgraphCompatibilityTests.swift | 7 +++ .../Graph/TreeCompatibilityTests.swift | 61 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 Tests/OpenAttributeGraphCompatibilityTests/Graph/TreeCompatibilityTests.swift diff --git a/Tests/OpenAttributeGraphCompatibilityTests/Graph/SubgraphCompatibilityTests.swift b/Tests/OpenAttributeGraphCompatibilityTests/Graph/SubgraphCompatibilityTests.swift index ed0bc3c8..6de96bc7 100644 --- a/Tests/OpenAttributeGraphCompatibilityTests/Graph/SubgraphCompatibilityTests.swift +++ b/Tests/OpenAttributeGraphCompatibilityTests/Graph/SubgraphCompatibilityTests.swift @@ -128,4 +128,11 @@ struct SubgraphCompatibilityTests { #expect(child.parentCount == 0) } } + + @Test + func treeRoot() { + let graph = Graph() + let subgraph = Subgraph(graph: graph) + let _ = subgraph.treeRoot + } } diff --git a/Tests/OpenAttributeGraphCompatibilityTests/Graph/TreeCompatibilityTests.swift b/Tests/OpenAttributeGraphCompatibilityTests/Graph/TreeCompatibilityTests.swift new file mode 100644 index 00000000..6f8438e7 --- /dev/null +++ b/Tests/OpenAttributeGraphCompatibilityTests/Graph/TreeCompatibilityTests.swift @@ -0,0 +1,61 @@ +// +// TreeCompatibilityTests.swift +// OpenAttributeGraphCompatibilityTests + +import Testing + +@MainActor +@Suite(.graphScope) +struct TreeCompatibilityTests { + + @Test + func treeElement() { + let graph = Graph() + let subgraph = Subgraph(graph: graph) + + let treeElement = subgraph.treeRoot + #expect(treeElement == nil) + + let _ = treeElement?.type + let _ = treeElement?.value + let _ = treeElement?.flags + let _ = treeElement?.parent + } + + @Test + func values() { + let graph = Graph() + let subgraph = Subgraph(graph: graph) + + let treeElement = subgraph.treeRoot + var values = treeElement?.values + + let treeValue = values?.next() + let _ = treeValue?.type + let _ = treeValue?.value + let _ = treeValue?.key + let _ = treeValue?.flags + } + + @Test + func nodes() { + let graph = Graph() + let subgraph = Subgraph(graph: graph) + + let treeElement = subgraph.treeRoot + var nodes = treeElement?.nodes + + let _ = nodes?.next() + } + + @Test + func children() { + let graph = Graph() + let subgraph = Subgraph(graph: graph) + + let treeElement = subgraph.treeRoot + var children = treeElement?.children + + let _ = children?.next() + } +}