@@ -44,7 +44,8 @@ testing library have the following layout:
4444typealias Accessor = @convention (c) (
4545 _ outValue: UnsafeMutableRawPointer ,
4646 _ type: UnsafeRawPointer ,
47- _ hint: UnsafeRawPointer ?
47+ _ hint: UnsafeRawPointer ? ,
48+ _ reserved: UnsafeRawPointer ?
4849) -> CBool
4950
5051typealias TestContentRecord = (
@@ -63,7 +64,8 @@ If needed, this type can be represented in C as a structure:
6364typedef bool (* SWTAccessor)(
6465 void * outValue,
6566 const void * type,
66- const void * _ Nullable hint
67+ const void * _ Nullable hint,
68+ const void * _ Nullable reserved
6769);
6870
6971struct SWTTestContentRecord {
@@ -117,7 +119,7 @@ If `accessor` is `nil`, the test content record is ignored. The testing library
117119may, in the future, define record kinds that do not provide an accessor function
118120(that is, they represent pure compile-time information only.)
119121
120- The third argument to this function, ` type ` , is a pointer to the type[ ^ mightNotBeSwift ]
122+ The second argument to this function, ` type ` , is a pointer to the type[ ^ mightNotBeSwift ]
121123(not a bitcast Swift type) of the value expected to be written to ` outValue ` .
122124This argument helps to prevent memory corruption if two copies of Swift Testing
123125or a third-party library are inadvertently loaded into the same process. If the
@@ -134,12 +136,15 @@ accessor function must return `false` and must not modify `outValue`.
134136 [ ` std::type_info ` ] ( https://en.cppreference.com/w/cpp/types/type_info ) , and
135137 write a C++ class instance to ` outValue ` using [ placement ` new ` ] ( https://en.cppreference.com/w/cpp/language/new#Placement_new ) .
136138
137- The fourth argument to this function, ` hint ` , is an optional input that can be
139+ The third argument to this function, ` hint ` , is an optional input that can be
138140passed to help the accessor function determine if its corresponding test content
139141record matches what the caller is looking for. If the caller passes ` nil ` as the
140142` hint ` argument, the accessor behaves as if it matched (that is, no additional
141143filtering is performed.)
142144
145+ The fourth argument to this function, ` reserved ` , is reserved for future use.
146+ Accessor functions should assume it is ` nil ` and must not access it.
147+
143148The concrete Swift type of the value written to ` outValue ` , the type pointed to
144149by ` type ` , and the value pointed to by ` hint ` depend on the kind of record:
145150
0 commit comments