mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-05 23:48:44 +02:00
tests: Add basic test framework for GResolver DNS parsing
Split out from https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2134 by Philip Withnall so it can be used in advance of HTTPS DNS record support landing. Reworked to no longer use test fixtures, as it’s simple enough to build the response header in each test. The tests are built on Unix only, as they test the parsing code in `g_resolver_records_from_res_query()`, which is Unix-specific. The Windows DNS APIs provide much more structured results which don’t need parsing.
This commit is contained in:
committed by
Philip Withnall
parent
96efd662c9
commit
5cdacced3f
@@ -74,6 +74,14 @@ if host_system != 'windows'
|
||||
endif
|
||||
endif
|
||||
|
||||
# dn_comp()
|
||||
if cc.links('''#include <resolv.h>
|
||||
int main (int argc, char ** argv) {
|
||||
return dn_comp(NULL, NULL, 0, NULL, NULL) == -1;
|
||||
} ''', args : network_args, name : 'dn_comp()')
|
||||
glib_conf.set('HAVE_DN_COMP', 1)
|
||||
endif
|
||||
|
||||
# res_nclose()
|
||||
if cc.links('''#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
|
Reference in New Issue
Block a user