]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: WURFL: call header_retireve_callback() in dummy library
authormbellomi <massimiliano@scientiamobile.com>
Tue, 21 May 2019 13:44:53 +0000 (15:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 10:06:05 +0000 (12:06 +0200)
The current coverage of the dummy library was limited because the callbacks
passed to wurfl_lookup() were not called. Now we do call them with one existing
and one non-existing headers to make sure that ha_wurfl_retrieve_header() is
covered by the tests as well.

contrib/wurfl/dummy-wurfl.c

index c87d9b95b09bc9ba7add4e67c18515af0f6a757e..8c7909d12199aa2cceca756793515d4348d03ced 100644 (file)
@@ -67,6 +67,11 @@ wurfl_error wurfl_load(wurfl_handle hwurfl)
 
 wurfl_device_handle wurfl_lookup(wurfl_handle hwurfl, wurfl_header_retrieve_callback header_retrieve_callback, const void *header_retrieve_callback_data)
 {
+  // call callback, on a probably existing header
+  const char *hvalue = header_retrieve_callback("User-Agent", header_retrieve_callback_data);
+  // and on a non existing one
+  hvalue = header_retrieve_callback("Non-Existing-Header", header_retrieve_callback_data);
+
   return (void *) 0xdeffa;
 }