From: Nabil Ghodbane Date: Wed, 23 Aug 2023 09:30:08 +0000 (+0200) Subject: bos #37326: fix compilation issue on Windows - replacing usleep with sleep_for &... X-Git-Tag: emc2p_1.4.0-rc1~2^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=a23b198721de69ce7d7b3ad46aabf18516a9e137;p=modules%2Fyacs.git bos #37326: fix compilation issue on Windows - replacing usleep with sleep_for & std::chrono --- diff --git a/src/runtime/Test/TestRuntime.cxx b/src/runtime/Test/TestRuntime.cxx index bf813ba89..d49cc8b37 100644 --- a/src/runtime/Test/TestRuntime.cxx +++ b/src/runtime/Test/TestRuntime.cxx @@ -33,6 +33,8 @@ CPPUNIT_TEST_SUITE_REGISTRATION( RuntimeTest ); // --- generic Main program from bases/Test #include "BasicMainTestInternal.hxx" #include "RuntimeSALOME.hxx" +#include +#include int main() { @@ -44,7 +46,7 @@ int main() CORBA::ORB_ptr orb = rt->getOrb(); CORBA::String_var ior = orb->object_to_string( ns ); AutoPyRef proc = rt->launchSubProcess({"./runtimeTestEchoSrv",std::string(ior)}); - usleep(3000000); + std::this_thread::sleep_for(std::chrono::microseconds(3000000)); int ret = BasicMainTestInternal(); // { diff --git a/src/yacsloader/Test/TestYacsLoader.cxx b/src/yacsloader/Test/TestYacsLoader.cxx index cc9f87cfa..ae483a0ce 100644 --- a/src/yacsloader/Test/TestYacsLoader.cxx +++ b/src/yacsloader/Test/TestYacsLoader.cxx @@ -41,6 +41,9 @@ CPPUNIT_TEST_SUITE_REGISTRATION( YacsLoaderTest ); #include "BasicMainTestInternal.hxx" #include "RuntimeSALOME.hxx" +#include +#include + int main() { YACS::ENGINE::RuntimeSALOME::setRuntime(); @@ -52,7 +55,7 @@ int main() CORBA::String_var ior = orb->object_to_string( ns ); AutoPyRef proc = rt->launchSubProcess({"./echoSrv",std::string(ior)}); //std::cout << getpid() << std::endl; - usleep(3000000); + std::this_thread::sleep_for(std::chrono::microseconds(3000000)); int ret = BasicMainTestInternal(); // SALOME_NamingService_Wrapper namingService(orb); diff --git a/src/yacsloader/Test/YacsLoaderTest.cxx b/src/yacsloader/Test/YacsLoaderTest.cxx index 109145e8a..5e88c036f 100644 --- a/src/yacsloader/Test/YacsLoaderTest.cxx +++ b/src/yacsloader/Test/YacsLoaderTest.cxx @@ -654,7 +654,7 @@ void YacsLoaderTest::refcnt() ret = driverTest(p, "samples/refcnt2.xml"); CPPUNIT_ASSERT(ret == 0); data = ((OutputPyPort*)p->nodeMap["b1.b.node1"]->getOutputPort("p1"))->get(); - CPPUNIT_ASSERT_EQUAL(data->ob_refcnt,(long int)13); + CPPUNIT_ASSERT(data->ob_refcnt == 13); } void YacsLoaderTest::foreachs()