5996: Allow the test suite to run offline r=def- a=heinrich5991

Allow host resolving to fail, but still check its results if it succeeds.

## Checklist

- [x] Tested the change ~~ingame~~
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
This commit is contained in:
bors[bot] 2022-11-01 14:38:56 +00:00 committed by GitHub
commit 333c3ed82d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,9 +84,11 @@ TEST_F(Jobs, LookupHost)
EXPECT_STREQ(pJob->m_aHostname, HOST); EXPECT_STREQ(pJob->m_aHostname, HOST);
EXPECT_EQ(pJob->m_Nettype, NETTYPE); EXPECT_EQ(pJob->m_Nettype, NETTYPE);
ASSERT_EQ(pJob->m_Result, 0); if(pJob->m_Result == 0)
{
EXPECT_EQ(pJob->m_Addr.type & NETTYPE, pJob->m_Addr.type); EXPECT_EQ(pJob->m_Addr.type & NETTYPE, pJob->m_Addr.type);
} }
}
TEST_F(Jobs, LookupHostWebsocket) TEST_F(Jobs, LookupHostWebsocket)
{ {
@ -106,9 +108,11 @@ TEST_F(Jobs, LookupHostWebsocket)
EXPECT_STREQ(pJob->m_aHostname, HOST); EXPECT_STREQ(pJob->m_aHostname, HOST);
EXPECT_EQ(pJob->m_Nettype, NETTYPE); EXPECT_EQ(pJob->m_Nettype, NETTYPE);
ASSERT_EQ(pJob->m_Result, 0); if(pJob->m_Result == 0)
{
EXPECT_EQ(pJob->m_Addr.type & NETTYPE_WEBSOCKET_IPV4, pJob->m_Addr.type); EXPECT_EQ(pJob->m_Addr.type & NETTYPE_WEBSOCKET_IPV4, pJob->m_Addr.type);
} }
}
TEST_F(Jobs, Many) TEST_F(Jobs, Many)
{ {