From b7cc2959ca404187c5cc5189f160368faa9ae5df Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Wed, 17 Apr 2024 10:09:03 +0200 Subject: [PATCH] test/gatt-service: add test to device_information_service_server --- .../device_information_service_server_test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/gatt_service_server/device_information_service_server_test.cpp b/test/gatt_service_server/device_information_service_server_test.cpp index 43ed9e785..432ee1c99 100644 --- a/test/gatt_service_server/device_information_service_server_test.cpp +++ b/test/gatt_service_server/device_information_service_server_test.cpp @@ -99,6 +99,16 @@ TEST(DEVICE_INFORMATION_SERVICE_SERVER, read_values){ response_len = mock_att_service_read_callback(con_handle, device_information_fields[i].value_handle, 0, response, sizeof(response)); CHECK(response_len > 0); } + + // NULL data field + device_information_service_server_set_manufacturer_name(NULL); + response_len = mock_att_service_read_callback(con_handle, device_information_fields[0].value_handle, 0, response, sizeof(response)); + CHECK(response_len == 0); + + + // invalid handle + response_len = mock_att_service_read_callback(con_handle, 0xFFFF, 0, response, sizeof(response)); + CHECK(response_len == 0); } int main (int argc, const char * argv[]){