summaryrefslogtreecommitdiffstats
path: root/mDNSResponder/unittests/daemon_ut.c
diff options
context:
space:
mode:
Diffstat (limited to 'mDNSResponder/unittests/daemon_ut.c')
-rw-r--r--mDNSResponder/unittests/daemon_ut.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/mDNSResponder/unittests/daemon_ut.c b/mDNSResponder/unittests/daemon_ut.c
new file mode 100644
index 00000000..526b3513
--- /dev/null
+++ b/mDNSResponder/unittests/daemon_ut.c
@@ -0,0 +1,35 @@
+#include "DNSCommon.h"
+
+mDNSexport void init_logging_ut(void)
+{
+#if APPLE_OSX_mDNSResponder
+ init_logging();
+
+ /* When doing unit testing, it is likely that some local functions and
+ * variables will not be needed to do unit testing validation. So to get
+ * around compiler warnings about unused functions or variables, each
+ * warning work-around is handled explicitly below.
+ */
+
+ /* The next three LogOperation() are used to trick the compiler into
+ * suppressing unused function and variable warnings. This is done by
+ * outputting the function or variable pointer to a log message.
+ */
+ LogOperation("Quiet compiler warnings for KQueueLoop= %p, "
+ "KQWokenFlushBytes= %p, SignalCallback= %p, "
+ "mDNS_StatusCallback= %p, LaunchdCheckin= %p",
+ KQueueLoop, KQWokenFlushBytes,
+ SignalCallback, mDNS_StatusCallback,
+ LaunchdCheckin);
+ LogOperation("Quiet compiler warnings for SandboxProcess= %p, "
+ "mDNSDaemonInitialize= %p, HandleSIG= %p, "
+ "PreferencesGetValueInt= %p, PreferencesGetValueBool= %p",
+ SandboxProcess, mDNSDaemonInitialize,
+ HandleSIG, PreferencesGetValueInt,
+ PreferencesGetValueBool);
+ LogOperation("Quiet compiler warnings for rrcachestorage= %p, "
+ "NoMulticastAdvertisements= %p",
+ rrcachestorage, NoMulticastAdvertisements);
+
+#endif // APPLE_OSX_mDNSResponder
+}