Salome HOME
#18963 Minimize compiler warnings
[modules/kernel.git] / src / KernelHelpers / KernelHelpersUseCases.cxx
index c4d07fe21df7cd691bc6e7e8aa373f3cf31baae1..7c41260adbf3ce47d0f56aaa40b419f4bc7bc36d 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,7 +16,8 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-// Author: Guillaume Boulant (EDF/R&D) 
+
+// Author: Guillaume Boulant (EDF/R&D)
 
 #include "SALOME_KernelServices.hxx"
 #include "Basics_Utils.hxx"
@@ -34,7 +35,7 @@ bool TEST_corba() {
   if ( ns == NULL ) {
     LOG("TEST_Corba: ns ERROR");
     return false;
-    
+
   }
   SALOME_LifeCycleCORBA * lcc = KERNEL::getLifeCycleCORBA();
   if ( lcc == NULL ) {
@@ -49,7 +50,7 @@ bool TEST_corba() {
 bool TEST_getLifeCycleCORBA() {
   Engines::EngineComponent_var component =
     KERNEL::getLifeCycleCORBA()->FindOrLoad_Component( "FactoryServer","SalomeTestComponent" );
-  
+
   Engines::TestComponent_var engine = Engines::TestComponent::_narrow(component);
   char * coucou_res = engine->Coucou(123.);
   const char * coucou_ref = "L = 123";
@@ -60,8 +61,8 @@ bool TEST_getLifeCycleCORBA() {
   return true;
 }
 
-bool TEST_getStudyManager() {
-  SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudyManager()->NewStudy("kerneltest");
+bool TEST_getStudy() {
+  SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudyServant();
   if ( CORBA::is_nil(myTestStudy) ) {
     return false;
   }
@@ -70,9 +71,8 @@ bool TEST_getStudyManager() {
   myTestStudy->SetString("material","wood");
   myTestStudy->SetReal("volume",3.23);
 
-  // The study is characterized by an ID
-  int myTestStudyId = myTestStudy->StudyId();
-  LOG("TestComponentImpl::testkernel: study id = "<<myTestStudyId);
+  // The study with properties was opened
+  LOG("TestComponentImpl::testkernel: study with properties was opened");
   return true;
 }
 
@@ -82,6 +82,7 @@ bool TEST_getSalomeLauncher() {
   for (int i=0; i<10; i++) {
     try {
       int pid = salomeLauncher->getPID();
+      SALOME_UNUSED(pid); // unused in release mode
       LOG("["<<i<<"] SALOME launcher PID = " << pid);
     }
     catch (const SALOME::SALOME_Exception & ex) {
@@ -111,10 +112,10 @@ bool TEST_getSalomeLauncher() {
 
 
 
-int main (int argc, char * argv[]) {
+int main () {
   TEST_corba();
   TEST_getLifeCycleCORBA();
-  TEST_getStudyManager();
+  TEST_getStudy();
   TEST_getSalomeLauncher();
   return 0;
 }