File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ static void sleep(unsigned int secs) { Sleep(secs * 1000); }
19
19
#include < unistd.h> // for sleep
20
20
#endif
21
21
22
+ #define BUFFER_SIZE 4096
23
+
22
24
typedef struct {
23
25
rtcState state;
24
26
rtcGatheringState gatheringState;
@@ -187,9 +189,25 @@ int test_capi_track_main() {
187
189
goto error;
188
190
}
189
191
192
+ // Test createOffer
193
+ char buffer[BUFFER_SIZE];
194
+ if (rtcCreateOffer (peer1->pc , buffer, BUFFER_SIZE) < 0 ) {
195
+ fprintf (stderr, " rtcCreateOffer failed\n " );
196
+ goto error;
197
+ }
198
+ if (rtcGetLocalDescription (peer1->pc , buffer, BUFFER_SIZE) >= 0 ) {
199
+ fprintf (stderr, " rtcCreateOffer has set the local description\n " );
200
+ goto error;
201
+ }
202
+
190
203
// Initiate the handshake
191
204
rtcSetLocalDescription (peer1->pc , NULL );
192
205
206
+ if (rtcGetLocalDescription (peer1->pc , buffer, BUFFER_SIZE) < 0 ) {
207
+ fprintf (stderr, " rtcGetLocalDescription failed\n " );
208
+ goto error;
209
+ }
210
+
193
211
attempts = 10 ;
194
212
while ((!peer2->connected || !peer1->connected ) && attempts--)
195
213
sleep (1 );
You can’t perform that action at this time.
0 commit comments