Skip to content
Snippets Groups Projects
Commit f90f5390 authored by Andrey Saranchin's avatar Andrey Saranchin Committed by Serge Petrenko
Browse files

test: cover port implementations with unit tests

The commit introduces new `unit/port.cc` test that covers almost all
port implementations and almost all port methods. This test was
intended as a testing point for future port changes.

Implementations `port_sql` and `port_vdbemem` and method  `dump_vdbemem`
are not tested because I don't know much about the sql subsystem. For
the same reason, I didn't tested `port_dump_msgpack_with_context`.
Method `dump_msgpack_16` is not actually supported, but it is
still used for compatibility with very old connectors. The problem is I
found a bug in `port_c_dump_msgpack_16` while writing the test, and we
don't want to fix it - probably, we will get rid of this method in
future. Method `dump_plain` is not tested because it requires functions
from `console.lua` file - it is easier to test `console.push` from Lua
then loading the Lua file in unit test.

The file has .cc extension because the test requires user_cache
susbystem, which has init and free methods available only from C++
source files.

NO_CHANGELOG=test
NO_DOC=test
parent 2af8611b
No related branches found
No related tags found
No related merge requests found
......@@ -636,3 +636,13 @@ create_unit_test(PREFIX event
SOURCES event.c core_test_utils.c
LIBRARIES core unit
)
create_unit_test(PREFIX port
SOURCES port.cc box_test_utils.c
LIBRARIES unit box server core misc
${CURL_LIBRARIES}
${LIBYAML_LIBRARIES}
${READLINE_LIBRARIES}
${ICU_LIBRARIES}
${LUAJIT_LIBRARIES}
)
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment