mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-12 23:04:55 +08:00

The sources can be obtained via: https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-765.1.2.tar.gz Move mDNS_StartResolveService() and mDNS_StopResolveService() to an RTEMS-specific file (rtemsbsd/mdns/mDNSResolveService.c) using the v576.30.4 implementation. Apple removed these functions without explanation. Update #3522.
50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
#include "mDNSEmbeddedAPI.h"
|
|
#include "DNSMessageTest.h"
|
|
#include "../mDNSCore/DNSCommon.h"
|
|
|
|
int SizeTest(void);
|
|
int InitializeTest(void);
|
|
int PutDomainNameAsLabels(void);
|
|
int PutRData(void);
|
|
int Finalize(void);
|
|
|
|
|
|
DNSMessage *msg;
|
|
|
|
|
|
UNITTEST_HEADER(DNSMessageTest)
|
|
UNITTEST_TEST(SizeTest)
|
|
UNITTEST_TEST(InitializeTest)
|
|
UNITTEST_TEST(Finalize)
|
|
UNITTEST_FOOTER
|
|
|
|
|
|
UNITTEST_HEADER(SizeTest)
|
|
msg = (DNSMessage *)malloc (sizeof(DNSMessage));
|
|
UNITTEST_ASSERT_RETURN(msg != NULL);
|
|
|
|
// message header should be 12 bytes
|
|
UNITTEST_ASSERT(sizeof(msg->h) == 12);
|
|
UNITTEST_FOOTER
|
|
|
|
|
|
UNITTEST_HEADER(InitializeTest)
|
|
// Initialize the message
|
|
InitializeDNSMessage(&msg->h, onesID, QueryFlags);
|
|
|
|
// Check that the message is initialized properly
|
|
UNITTEST_ASSERT(msg->h.numAdditionals == 0);
|
|
UNITTEST_ASSERT(msg->h.numAnswers == 0);
|
|
UNITTEST_ASSERT(msg->h.numQuestions == 0);
|
|
UNITTEST_ASSERT(msg->h.numAuthorities == 0);
|
|
UNITTEST_FOOTER
|
|
|
|
|
|
UNITTEST_HEADER(PutDomainNameAsLabels)
|
|
|
|
UNITTEST_FOOTER
|
|
|
|
UNITTEST_HEADER(Finalize)
|
|
UNITTEST_ASSERT_RETURN(msg != NULL)
|
|
free(msg);
|
|
UNITTEST_FOOTER |