Salome HOME
bos #37326: fix compilation issue on Windows - replacing usleep with sleep_for &... bos/37326 4/head
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 23 Aug 2023 09:30:08 +0000 (11:30 +0200)
committerKonstantin Leontev <Konstantin.LEONTEV@opencascade.com>
Tue, 29 Aug 2023 09:16:32 +0000 (10:16 +0100)
src/runtime/Test/TestRuntime.cxx
src/yacsloader/Test/TestYacsLoader.cxx
src/yacsloader/Test/YacsLoaderTest.cxx

index bf813ba89f5ac8e5bed61a8bd1e7e7edb360570a..d49cc8b37ef43d4b74f129b997bad7878785ca2e 100644 (file)
@@ -33,6 +33,8 @@ CPPUNIT_TEST_SUITE_REGISTRATION( RuntimeTest );
 // --- generic Main program from bases/Test
 #include "BasicMainTestInternal.hxx"
 #include "RuntimeSALOME.hxx"
+#include <chrono>
+#include <thread>
 
 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();
   //
   {
index cc9f87cfa9f94938214b6cf5c18a5ae7eee44a7a..ae483a0ce894d21f51b58b20d5cf4afd4b20e60d 100644 (file)
@@ -41,6 +41,9 @@ CPPUNIT_TEST_SUITE_REGISTRATION( YacsLoaderTest );
 #include "BasicMainTestInternal.hxx"
 #include "RuntimeSALOME.hxx"
 
+#include <chrono>
+#include <thread>
+
 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);
index 109145e8acee9f2458332a787080141c15836844..5e88c036fdf39265e4c7faccba028ec06f81c329 100644 (file)
@@ -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()