[vlc-commits] https: revector output test

Rémi Denis-Courmont git at videolan.org
Fri Dec 18 21:07:44 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Dec 18 18:44:41 2015 +0200| [b00564d0b6661cb3b2b130dc3dc1e6129d782ac8] | committer: Rémi Denis-Courmont

https: revector output test

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b00564d0b6661cb3b2b130dc3dc1e6129d782ac8
---

 modules/access/http/Makefile.am     |    7 ++-----
 modules/access/http/h2output_test.c |   12 +++++++-----
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/modules/access/http/Makefile.am b/modules/access/http/Makefile.am
index 2e898d9..7c8b4b7 100644
--- a/modules/access/http/Makefile.am
+++ b/modules/access/http/Makefile.am
@@ -28,11 +28,8 @@ hpackenc_test_CFLAGS = -DENC_TEST
 h2frame_test_SOURCES = access/http/h2frame_test.c \
 	access/http/hpack.c access/http/hpack.h access/http/hpackenc.c \
 	access/http/h2frame.c access/http/h2frame.h
-h2output_test_SOURCES = access/http/h2output_test.c \
-	access/http/hpack.c access/http/hpack.h access/http/hpackenc.c \
-	access/http/h2frame.c access/http/h2frame.h \
-	access/http/h2output.c access/http/h2output.h
-h2output_test_LDADD = $(LIBPTHREAD)
+h2output_test_SOURCES = access/http/h2output_test.c
+h2output_test_LDADD = libvlc_http.la $(LIBPTHREAD)
 h2conn_test_SOURCES = access/http/h2conn_test.c \
 	access/http/message.c access/http/message.h \
 	access/http/hpack.c access/http/hpack.h access/http/hpackenc.c \
diff --git a/modules/access/http/h2output_test.c b/modules/access/http/h2output_test.c
index 8d9bb9b..0f8249c 100644
--- a/modules/access/http/h2output_test.c
+++ b/modules/access/http/h2output_test.c
@@ -41,14 +41,11 @@ static bool send_failure = false;
 static bool expect_hello = true;
 static vlc_sem_t rx;
 
-static vlc_tls_t fake_tls;
-
-/* Callback for sent frames */
-ssize_t vlc_https_send(struct vlc_tls *tls, const void *buf, size_t len)
+static ssize_t send_callback(vlc_tls_t *tls, const void *buf, size_t len)
 {
     const uint8_t *p = buf;
 
-    assert(tls == &fake_tls);
+    assert(tls->send == send_callback);
 
     if (expect_hello)
     {
@@ -73,6 +70,11 @@ ssize_t vlc_https_send(struct vlc_tls *tls, const void *buf, size_t len)
     return send_failure ? -1 : (ssize_t)len;
 }
 
+static vlc_tls_t fake_tls =
+{
+    .send = send_callback,
+};
+
 static struct vlc_h2_frame *frame(unsigned char c)
 {
     struct vlc_h2_frame *f = vlc_h2_frame_data(1, &c, 1, false);



More information about the vlc-commits mailing list