unit-test: add basic header validation tests
Ensure header size is correct and write tests to validate it.
The goal of this patch series is to match with the validation done
within openslp (slp_v2message.c, SLPv2MessageParseHeader)
Change-Id: I42aace162051a9e4795ebbaf36f193efe4738dcd
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meson.build b/meson.build
index 679ecad..4c28048 100644
--- a/meson.build
+++ b/meson.build
@@ -23,3 +23,19 @@
install: true,
install_dir: get_option('sbindir'),
)
+
+build_tests = get_option('tests')
+gtest = dependency('gtest', main: true, disabler: true, required: build_tests)
+gmock = dependency('gmock', disabler: true, required: build_tests)
+ test(
+ 'test_slp_parser',
+ executable('test_slp_parser',
+ './test/slp_parser_test.cpp',
+ 'slp_parser.cpp',
+ dependencies: [
+ gtest,
+ ],
+ implicit_include_directories: true,
+ include_directories: '../'
+ )
+ )