Revision c81c126e Test/pstreamer_manager_test.c

View differences:

Test/pstreamer_manager_test.c
19 19
	pstreamer_manager_destroy(NULL);
20 20
	pstreamer_manager_destroy(&psm);
21 21

  
22
	psm = pstreamer_manager_new(6000);
22
	psm = pstreamer_manager_new(6000, NULL);
23 23

  
24 24
	pstreamer_manager_destroy(&psm);
25 25

  
......
31 31
	struct pstreamer_manager * psm = NULL;
32 32
	const struct pstreamer * ps = NULL;
33 33

  
34
	ps = pstreamer_manager_create_streamer(NULL, NULL, NULL, NULL, NULL);
34
	ps = pstreamer_manager_create_streamer(NULL, NULL, NULL, NULL, NULL, NULL);
35 35
	assert(ps == NULL);
36 36

  
37
	psm = pstreamer_manager_new(6000);
37
	psm = pstreamer_manager_new(6000, NULL);
38 38

  
39
	ps = pstreamer_manager_create_streamer(psm, NULL, NULL, NULL, NULL);
39
	ps = pstreamer_manager_create_streamer(psm, NULL, NULL, NULL, NULL, NULL);
40 40
	assert(ps == NULL);
41 41

  
42
	ps = pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "42", "127.0.0.1");
42
	ps = pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "42", "127.0.0.1", NULL);
43 43
	assert(ps);
44 44

  
45
	ps = pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "24", "127.0.0.1");
45
	ps = pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "24", "127.0.0.1", NULL);
46 46
	assert(ps);
47 47

  
48
	ps = pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "42", "127.0.0.1");
48
	ps = pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "42", "127.0.0.1", NULL);
49 49
	assert(ps == NULL);
50 50

  
51 51
	pstreamer_manager_destroy(&psm);
......
62 62
	json = pstreamer_to_json(NULL);
63 63
	assert(json == NULL);
64 64

  
65
	psm = pstreamer_manager_new(6000);
66
	ps = pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "42", "127.0.0.1");
65
	psm = pstreamer_manager_new(6000, NULL);
66
	ps = pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "42", "127.0.0.1", NULL);
67 67

  
68 68
	json = pstreamer_to_json(ps);
69
	assert(strcmp(json, "{\"id\":\"42\",\"source_ip\":\"10.0.0.1\",\"source_port\":\"6000\"}") == 0);
69
	fprintf(stderr, "[DEBUG] %s\n", json);
70
	assert(strcmp(json, "{\"id\":\"42\",\"source_ip\":\"10.0.0.1\",\"source_port\":\"6000\",\"janus_streaming_id\":\"0\"}") == 0);
70 71
	free(json);
71 72

  
72 73
	pstreamer_manager_destroy(&psm);
......
82 83
	res = pstreamer_manager_destroy_streamer(NULL, NULL);
83 84
	assert(res);
84 85

  
85
	psm = pstreamer_manager_new(6000);
86
	psm = pstreamer_manager_new(6000, NULL);
86 87
	res = pstreamer_manager_destroy_streamer(psm, NULL);
87 88
	assert(res);
88 89

  
89
	ps = pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "42", "127.0.0.1");
90
	ps = pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "24", "127.0.0.1");
90
	ps = pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "42", "127.0.0.1", NULL);
91
	ps = pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "24", "127.0.0.1", NULL);
91 92

  
92 93
	res = pstreamer_manager_destroy_streamer(psm, ps);
93 94
	assert(res == 0);
......
105 106
	res = pstreamer_manager_set_streamer_options(psm, NULL);
106 107
	assert(res == -1);
107 108

  
108
	psm = pstreamer_manager_new(6000);
109
	psm = pstreamer_manager_new(6000, NULL);
109 110

  
110 111
	res = pstreamer_manager_set_streamer_options(psm, NULL);
111 112
	assert(res == -1);
......
113 114
	res = pstreamer_manager_set_streamer_options(psm, "iface=lo");
114 115
	assert(res == 0);
115 116

  
116
	pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "42", "127.0.0.1");
117
	pstreamer_manager_create_streamer(psm, "10.0.0.1", "6000", "42", "127.0.0.1", NULL);
117 118
	pstreamer_manager_destroy(&psm);
118 119
	fprintf(stderr,"%s successfully passed!\n",__func__);
119 120
}

Also available in: Unified diff