Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
#include "../xcbutils.h"
// Qt
#include <QApplication>
-#include <QtTest/QtTest>
+#include <QtTest>
+#include <QHostInfo>
// xcb
#include <xcb/xcb.h>
// system
void TestClientMachine::initTestCase()
{
-#ifdef HOST_NAME_MAX
- char hostnamebuf[HOST_NAME_MAX];
-#else
- char hostnamebuf[256];
-#endif
- if (gethostname(hostnamebuf, sizeof hostnamebuf) >= 0) {
- hostnamebuf[sizeof(hostnamebuf)-1] = 0;
- m_hostName = hostnamebuf;
- }
+ m_hostName = QHostInfo::localHostName().toAscii();
+
addrinfo *res = NULL;
addrinfo addressHints;
memset(&addressHints, 0, sizeof(addressHints));