mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-18 19:31:37 -05:00
7d4b8288ca
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4456 b45a01b8-16f6-495d-af2f-9b41ad6348cc
38 lines
605 B
C++
38 lines
605 B
C++
#include "util/utest.h"
|
|
|
|
#include <iostream>
|
|
#include "pqi/pqinetwork.h"
|
|
|
|
#include <util/extaddrfinder.h>
|
|
#include <pqi/authgpg.h>
|
|
|
|
INITTEST();
|
|
|
|
int main()
|
|
{
|
|
std::cerr << "Testing the ext address finder service. This might take up to 10 secs..." << std::endl ;
|
|
|
|
ExtAddrFinder fnd ;
|
|
in_addr addr ;
|
|
uint32_t tries = 0 ;
|
|
|
|
while(! fnd.hasValidIP( &addr ))
|
|
{
|
|
sleep(1) ;
|
|
|
|
if(++tries > 20)
|
|
{
|
|
std::cerr << "Failed !" << std::endl ;
|
|
CHECK(false) ;
|
|
}
|
|
}
|
|
|
|
std::cerr << "Found the following IP: " << inet_ntoa(addr) << std::endl ;
|
|
|
|
FINALREPORT("extaddrfinder_test");
|
|
|
|
return TESTRESULT() ;
|
|
}
|
|
|
|
|