2 // SecProtocolHelperTest.m
6 #import <XCTest/XCTest.h>
8 #import "SecProtocolInternal.h"
10 #define DefineTLSCiphersuiteGroupList(XXX, ...) \
11 static const tls_ciphersuite_t list_##XXX[] = { \
15 // Mirror the internal definition of this ciphersuite group
16 DefineTLSCiphersuiteGroupList(tls_ciphersuite_group_default, CiphersuitesTLS13, CiphersuitesPFS);
18 #undef DefineTLSCiphersuiteGroupList
20 @interface SecProtocolHelperTest : XCTestCase
23 @implementation SecProtocolHelperTest
25 - (void)testCiphersuiteGroupConversion {
26 size_t ciphersuites_len = 0;
27 const tls_ciphersuite_t *ciphersuites = sec_protocol_helper_ciphersuite_group_to_ciphersuite_list(tls_ciphersuite_group_default, &ciphersuites_len);
28 XCTAssertTrue(ciphersuites != NULL);
29 XCTAssertTrue(ciphersuites_len == (sizeof(list_tls_ciphersuite_group_default) / sizeof(tls_ciphersuite_t)));
30 for (size_t i = 0; i < ciphersuites_len; i++) {
31 XCTAssertTrue(ciphersuites[i] == list_tls_ciphersuite_group_default[i]);