From: amosjeffries <> Date: Fri, 15 Feb 2008 17:46:39 +0000 (+0000) Subject: Loosen GetAddrInfo Unit-Tests. X-Git-Tag: BASIC_TPROXY4~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be8fdd566f491809856823486f6b598d2cf81dff;p=thirdparty%2Fsquid.git Loosen GetAddrInfo Unit-Tests. Squid does not need certain OS defaults, which are known to vary. --- diff --git a/lib/tests/testIPAddress.cc b/lib/tests/testIPAddress.cc index 77098118ce..144a989448 100644 --- a/lib/tests/testIPAddress.cc +++ b/lib/tests/testIPAddress.cc @@ -582,19 +582,21 @@ testIPAddress::testAddrInfo() /* display a byte-by-byte hex comparison of the addr cores */ unsigned int *p; p = (unsigned int*)expect; - printf("\nADDRINFO: %x %x %x %x %x %x ", + printf("\nSYS-ADDRINFO: %x %x %x %x %x %x ", p[0],p[1],p[2],p[3],p[4],p[5] ); p = (unsigned int*)ipval; - printf("\nADDRINFO: %x %x %x %x %x %x ", + printf("\nSQD-ADDRINFO: %x %x %x %x %x %x ", p[0],p[1],p[2],p[3],p[4],p[5] ); printf("\n"); // check the addrinfo object core. (BUT not the two ptrs at the tail) - CPPUNIT_ASSERT( memcmp( expect, ipval, sizeof(struct addrinfo)-(sizeof(void*)*3) ) == 0 ); + // details + CPPUNIT_ASSERT_EQUAL( expect->ai_flags, ipval->ai_flags ); + CPPUNIT_ASSERT_EQUAL( expect->ai_family, ipval->ai_family ); // check the sockaddr it points to. CPPUNIT_ASSERT_EQUAL( expect->ai_addrlen, ipval->ai_addrlen ); - CPPUNIT_ASSERT( memcmp( expect, ipval, expect->ai_addrlen ) == 0 ); + CPPUNIT_ASSERT( memcmp( expect->ai_addr, ipval->ai_addr, expect->ai_addrlen ) == 0 ); xfreeaddrinfo(expect); }