1*d9f75844SAndroid Build Coastguard Worker /* 2*d9f75844SAndroid Build Coastguard Worker * Copyright (c) 2021 The WebRTC project authors. All Rights Reserved. 3*d9f75844SAndroid Build Coastguard Worker * 4*d9f75844SAndroid Build Coastguard Worker * Use of this source code is governed by a BSD-style license 5*d9f75844SAndroid Build Coastguard Worker * that can be found in the LICENSE file in the root of the source 6*d9f75844SAndroid Build Coastguard Worker * tree. An additional intellectual property rights grant can be found 7*d9f75844SAndroid Build Coastguard Worker * in the file PATENTS. All contributing project authors may 8*d9f75844SAndroid Build Coastguard Worker * be found in the AUTHORS file in the root of the source tree. 9*d9f75844SAndroid Build Coastguard Worker */ 10*d9f75844SAndroid Build Coastguard Worker #ifndef NET_DCSCTP_COMMON_HANDOVER_TESTING_H_ 11*d9f75844SAndroid Build Coastguard Worker #define NET_DCSCTP_COMMON_HANDOVER_TESTING_H_ 12*d9f75844SAndroid Build Coastguard Worker 13*d9f75844SAndroid Build Coastguard Worker #include "net/dcsctp/public/dcsctp_handover_state.h" 14*d9f75844SAndroid Build Coastguard Worker 15*d9f75844SAndroid Build Coastguard Worker namespace dcsctp { 16*d9f75844SAndroid Build Coastguard Worker // This global function is to facilitate testing of the socket handover state 17*d9f75844SAndroid Build Coastguard Worker // (`DcSctpSocketHandoverState`) serialization. dcSCTP library users have to 18*d9f75844SAndroid Build Coastguard Worker // implement state serialization if it's needed. To test the serialization one 19*d9f75844SAndroid Build Coastguard Worker // can set a custom `g_handover_state_transformer_for_test` at startup, link to 20*d9f75844SAndroid Build Coastguard Worker // the dcSCTP tests and run the resulting binary. Custom function can serialize 21*d9f75844SAndroid Build Coastguard Worker // and deserialize the passed state. All dcSCTP handover tests call 22*d9f75844SAndroid Build Coastguard Worker // `g_handover_state_transformer_for_test`. If some part of the state is 23*d9f75844SAndroid Build Coastguard Worker // serialized incorrectly or is forgotten, high chance that it will fail the 24*d9f75844SAndroid Build Coastguard Worker // tests. 25*d9f75844SAndroid Build Coastguard Worker extern void (*g_handover_state_transformer_for_test)( 26*d9f75844SAndroid Build Coastguard Worker DcSctpSocketHandoverState*); 27*d9f75844SAndroid Build Coastguard Worker } // namespace dcsctp 28*d9f75844SAndroid Build Coastguard Worker 29*d9f75844SAndroid Build Coastguard Worker #endif // NET_DCSCTP_COMMON_HANDOVER_TESTING_H_ 30