chore(Net): fix some warnings and tests

This commit is contained in:
Alex Fabijanic
2022-07-27 16:21:55 -04:00
parent 10dfe9fe92
commit 459f1ea19c
5 changed files with 17 additions and 11 deletions

View File

@@ -99,7 +99,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="Configuration">
@@ -109,12 +109,12 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -190,27 +190,33 @@
<OutDir>..\bin64\</OutDir>
<IntDir>obj64\Net\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
<TargetName>Poco$(ProjectName)64d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">
<OutDir>..\bin64\</OutDir>
<IntDir>obj64\Net\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<TargetName>Poco$(ProjectName)64</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">
<OutDir>..\lib64\</OutDir>
<IntDir>obj64\Net\$(Configuration)\</IntDir>
<TargetName>Poco$(ProjectName)64d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">
<OutDir>..\lib64\</OutDir>
<IntDir>obj64\Net\$(Configuration)\</IntDir>
<TargetName>Poco$(ProjectName)64</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">
<OutDir>..\lib64\</OutDir>
<IntDir>obj64\Net\$(Configuration)\</IntDir>
<TargetName>Poco$(ProjectName)64d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">
<OutDir>..\lib64\</OutDir>
<IntDir>obj64\Net\$(Configuration)\</IntDir>
<TargetName>Poco$(ProjectName)64</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">
<ClCompile>

View File

@@ -100,7 +100,7 @@ int Socket::select(SocketList& readList, SocketList& writeList, SocketList& exce
{
#if defined(POCO_HAVE_FD_EPOLL)
int epollSize = readList.size() + writeList.size() + exceptList.size();
int epollSize = static_cast<int>(readList.size() + writeList.size() + exceptList.size());
if (epollSize == 0) return 0;
PollSet ps;
@@ -119,7 +119,7 @@ int Socket::select(SocketList& readList, SocketList& writeList, SocketList& exce
if (s.second & PollSet::POLL_ERROR) exceptList.push_back(s.first);
}
return readList.size() + writeList.size() + exceptList.size();
return static_cast<int>(readList.size() + writeList.size() + exceptList.size());
#elif defined(POCO_HAVE_FD_POLL)
typedef Poco::SharedPtr<pollfd, Poco::ReferenceCounter, Poco::ReleaseArrayPolicy<pollfd>> SharedPollArray;

View File

@@ -675,7 +675,7 @@ bool SocketImpl::poll(const Poco::Timespan& timeout, int mode)
memset(&evout, 0, sizeof(evout));
Poco::Timestamp start;
rc = epoll_wait(epollfd, &evout, 1, remainingTime.totalMilliseconds());
rc = epoll_wait(epollfd, &evout, 1, static_cast<int>(remainingTime.totalMilliseconds()));
if (rc < 0 && lastError() == POCO_EINTR)
{
Poco::Timestamp end;

View File

@@ -109,12 +109,12 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -194,6 +194,7 @@
<OutDir>bin64\</OutDir>
<IntDir>obj64\TestSuite\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
<TargetName>$(ProjectName)d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">
<OutDir>bin64\</OutDir>

View File

@@ -450,9 +450,8 @@ void SocketTest::testSelect()
assertTrue (writeList.empty());
assertTrue (exceptList.empty());
ss.sendBytes("hello", 5);
ss.poll(timeout, Socket::SELECT_READ);
assertTrue (5 == ss.sendBytes("hello", 5));
assertTrue (ss.poll(timeout, Socket::SELECT_READ));
readList.push_back(ss);
writeList.push_back(ss);