Add unit test for SSE
Writing this test exposed some bugs in SSE that got merged.
sendSSEHeader was never called, leading to a connection that starts
and immediately closes with no error code.
This issue has been corrected in code, such that the sockets start.
To allow for unit tests, the io_service needs to be passed into the
class, previously, the SSE connection was pulling the io_context from
the DBus connection, which is odd, given that the SSE connection has
no other dependencies on DBus.
Unit tests should help keep it working.
Tested: Unit tests pass.
Change-Id: I48080d2a94b6349989f556cd1c7b103bad498526
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/meson.build b/meson.build
index 33c8b12..d644b79 100644
--- a/meson.build
+++ b/meson.build
@@ -429,6 +429,7 @@
'test/http/http_response_test.cpp',
'test/http/utility_test.cpp',
'test/http/verb_test.cpp',
+ 'test/http/server_sent_event_test.cpp',
'test/http/mutual_tls_meta.cpp',
'test/http/http_file_body_test.cpp',
'test/include/dbus_utility_test.cpp',