Commit 2f6a0230 authored by Pavel Vainerman's avatar Pavel Vainerman

(utypes): исправил ошибку в тесте

(SM): мелкие правки инициализации по умолчанию
parent 3897860d
...@@ -306,6 +306,7 @@ class SharedMemory: ...@@ -306,6 +306,7 @@ class SharedMemory:
/*! глобальная функция для инициализации объекта */ /*! глобальная функция для инициализации объекта */
static std::shared_ptr<SharedMemory> init_smemory( int argc, const char* const* argv ); static std::shared_ptr<SharedMemory> init_smemory( int argc, const char* const* argv );
/*! глобальная функция для вывода help-а */ /*! глобальная функция для вывода help-а */
static void help_print( int argc, const char* const* argv ); static void help_print( int argc, const char* const* argv );
...@@ -351,25 +352,20 @@ class SharedMemory: ...@@ -351,25 +352,20 @@ class SharedMemory:
struct HistoryInfo struct HistoryInfo
{ {
HistoryInfo(): HistoryInfo()
id(0),
size(0), filter(""),
fuse_id(UniSetTypes::DefaultObjectId),
fuse_invert(false), fuse_use_val(false), fuse_val(0)
{ {
::clock_gettime(CLOCK_REALTIME, &fuse_tm); ::clock_gettime(CLOCK_REALTIME, &fuse_tm);
} }
long id; // ID long id = { 0 }; // ID
HistoryList hlst; // history list HistoryList hlst; // history list
int size; size_t size = { 0 };
std::string filter; // filter field std::string filter = { "" }; // filter field
UniSetTypes::ObjectId fuse_id; // fuse sesnsor UniSetTypes::ObjectId fuse_id = { UniSetTypes::DefaultObjectId }; // fuse sesnsor
bool fuse_invert; bool fuse_invert = { false };
bool fuse_use_val; bool fuse_use_val = { false };
long fuse_val; long fuse_val = { 0 };
// timestamp timespec fuse_tm = { 0, 0 }; // timestamp
timespec fuse_tm;
}; };
friend std::ostream& operator<<( std::ostream& os, const HistoryInfo& h ); friend std::ostream& operator<<( std::ostream& os, const HistoryInfo& h );
...@@ -492,7 +488,7 @@ class SharedMemory: ...@@ -492,7 +488,7 @@ class SharedMemory:
History hist; History hist;
HistoryFuseMap histmap; /*!< map для оптимизации поиска */ HistoryFuseMap histmap; /*!< map для оптимизации поиска */
virtual void checkFuse(std::shared_ptr<IOController::USensorInfo>& usi, IOController* ); virtual void checkFuse( std::shared_ptr<IOController::USensorInfo>& usi, IOController* );
virtual void saveToHistory(); virtual void saveToHistory();
void buildHistoryList( xmlNode* cnode ); void buildHistoryList( xmlNode* cnode );
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
#include <sstream> #include <sstream>
#include <limits> #include <limits>
#include "Configuration.h"
#include "UniSetTypes.h" #include "UniSetTypes.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
using namespace std; using namespace std;
...@@ -108,7 +109,7 @@ TEST_CASE("UniSetTypes: getSInfoList", "[utypes][getsinfo]" ) ...@@ -108,7 +109,7 @@ TEST_CASE("UniSetTypes: getSInfoList", "[utypes][getsinfo]" )
{ {
const std::string str1("Input4_S@node2,Input1_S,5,5@node3,6@1001"); const std::string str1("Input4_S@node2,Input1_S,5,5@node3,6@1001");
auto t1 = UniSetTypes::getSInfoList(str1); auto t1 = UniSetTypes::getSInfoList(str1, UniSetTypes::uniset_conf());
CHECK( t1.size() == 5 ); CHECK( t1.size() == 5 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment