Skip to content

Commit

Permalink
try to fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-f committed Mar 6, 2024
1 parent ca66cd0 commit 7be383a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,7 @@ jobs:
class CppUnit::TestCaller<class ICMPClientTest>.testBigPing,
class CppUnit::TestCaller<class ICMPSocketTest>.testMTU,
class CppUnit::TestCaller<class HTTPSClientSessionTest>.testProxy,
class CppUnit::TestCaller<class HTTPSStreamFactoryTest>.testProxy,
class CppUnit::TestCaller<class ProcessRunnerTest>.testProcessRunner # cmake CI has messed up env path
class CppUnit::TestCaller<class HTTPSStreamFactoryTest>.testProxy
steps:
- uses: actions/checkout@v3
- run: cmake -S. -Bcmake-build -DENABLE_NETSSL_WIN=ON -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_JWT=OFF -DENABLE_DATA=ON -DENABLE_DATA_ODBC=ON -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_TESTS=ON
Expand Down
7 changes: 6 additions & 1 deletion Foundation/include/Poco/Any.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ class Any
template <typename ValueType>
friend ValueType* AnyCast(Any*);

template <typename ValueType>
friend const ValueType* AnyCast(const Any*);

template <typename ValueType>
friend ValueType* UnsafeAnyCast(Any*);

Expand Down Expand Up @@ -426,7 +429,9 @@ const ValueType* AnyCast(const Any* operand)
/// const MyType* pTmp = AnyCast<MyType>(pAny).
/// Returns nullptr if the types don't match.
{
return AnyCast<ValueType>(const_cast<Any*>(operand));
return operand && operand->type() == typeid(ValueType)
? &static_cast<const Any::Holder<ValueType>*>(operand->content())->_held
: nullptr;
}


Expand Down
26 changes: 19 additions & 7 deletions Foundation/src/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,26 @@ std::string File::absolutePath() const
StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
for (const auto& p: st)
{
std::string fileName(p);
if (p.size() && p[p.size()-1] != Path::separator())
fileName.append(1, Path::separator());
fileName.append(path());
if (File(fileName).exists())
try
{
ret = fileName;
break;
std::string fileName(p);
if (p.size() && p[p.size()-1] != Path::separator())
fileName.append(1, Path::separator());
fileName.append(path());
if (File(fileName).exists())
{
ret = fileName;
break;
}
}
catch (const Poco::PathSyntaxException&)
{
// this try/catch is only here to prevent windows cmake CI from failing
// (apparently bad windows path settings in the CI environment):
//
// class CppUnit::TestCaller<class ProcessRunnerTest>.testProcessRunner
// "class Poco::PathSyntaxException:
// Bad path syntax: D:/a/poco/poco/cmake-build/bin:C:\Program Files\PowerShell\7\TestApp"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Foundation/testsuite/src/AnyTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void AnyTest::testAnyCastToReference()

int& ra = AnyCast<int &>(a);
int const& ra_c = AnyCast<int const &>(a);
// NOTE: The following two AnyCasts will trigger the
// NOTE: The volatile AnyCasts will trigger the
// undefined behavior sanitizer.
int volatile& ra_v = AnyCast<int volatile &>(a);
int const volatile& ra_cv = AnyCast<int const volatile&>(a);
Expand Down

0 comments on commit 7be383a

Please sign in to comment.