AC_INIT([Persistence Client Library], [pers_client_library_tag_version], [not-valid@xse.de])
+AC_COPYRIGHT([Copyright (c) 2014 XS Embedded GmbH])
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([dist-bzip2])
AC_GNU_SOURCE()
if(readBlacklistConfigFile(blacklistPath) == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclInitLibrary -> failed to access blacklist:"), DLT_STRING(blacklistPath));
+ DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclInitLibrary - failed to access blacklist:"), DLT_STRING(blacklistPath));
}
if(setup_dbus_mainloop() == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary => Failed to setup main loop"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary - Failed to setup main loop"));
pthread_mutex_unlock(&gDbusPendingRegMtx);
return EPERS_DBUS_MAINLOOP;
}
DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("PAS interface is enabled!!"));
if(register_pers_admin_service() == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary => Failed to register to pers admin dbus interface"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary - Failed to register to pers admin dbus interface"));
pthread_mutex_unlock(&gDbusPendingRegMtx);
return EPERS_REGISTER_ADMIN;
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary => Successfully established IPC protocol for PCL."));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary - Successfully established IPC protocol for PCL."));
}
#else
DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("PAS interface is not enabled, enable with \"./configure --enable-pasinterface\""));
else if(gPclInitialized >= PCLinitialized)
{
gPclInitialized++; // increment init counter
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary => I N I T Persistence Client Library - "), DLT_STRING(gAppId),
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary - I N I T Persistence Client Library - "), DLT_STRING(gAppId),
DLT_STRING("- ONLY INCREMENT init counter: "), DLT_INT(gPclInitialized) );
}
data.message.cmd = (uint32_t)CMD_QUIT;
data.message.string[0] = '\0'; // no string parameter, set to 0
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary -> D E I N I T client library - "), DLT_STRING(gAppId),
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary - D E I N I T client library - "), DLT_STRING(gAppId),
DLT_STRING("- init counter: "), DLT_INT(gPclInitialized));
// unregister for lifecycle dbus messages
rval = unregister_pers_admin_service();
if(0 != rval)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclDeinitLibrary => Failed to de-initialize IPC protocol for PCL."));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclDeinitLibrary - Failed to de-initialize IPC protocol for PCL."));
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary => Successfully de-initialized IPC protocol for PCL."));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary - Successfully de-initialized IPC protocol for PCL."));
}
#endif
}
else if(gPclInitialized > PCLinitialized)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary -> D E I N I T client library - "), DLT_STRING(gAppId),
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary - D E I N I T client library - "), DLT_STRING(gAppId),
DLT_STRING("- ONLY DECREMENT init counter: "), DLT_INT(gPclInitialized));
gPclInitialized--; // decrement init counter
}
if(fd == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("configReader::readConfigFile ==> Error file open"), DLT_STRING(filename), DLT_STRING(strerror(errno)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("readBlacklistConfigFile - Error file open"), DLT_STRING(filename), DLT_STRING(strerror(errno)) );
return EPERS_COMMON;
}
if(configFileMap == MAP_FAILED)
{
close(fd);
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("configReader::readConfigFile ==> Error mapping the file:"), DLT_STRING(filename), DLT_STRING(strerror(errno)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("readBlacklistConfigFile - Error mapping the file:"), DLT_STRING(filename), DLT_STRING(strerror(errno)) );
return EPERS_COMMON;
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("configReader::readConfigFile ==> Error config file size is 0:"), DLT_STRING(filename));
+ DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("readBlacklistConfigFile - Error config file size is 0:"), DLT_STRING(filename));
return EPERS_COMMON;
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("configReader::readConfigFile ==> failed to stat() config file:"), DLT_STRING(filename));
+ DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("readBlacklistConfigFile - failed to stat() config file:"), DLT_STRING(filename));
return EPERS_COMMON;
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("configReader::readConfigFile ==> config file name is NULL:"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("readBlacklistConfigFile - config file name is NULL:"));
rval = EPERS_COMMON;
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateFile ==> no valid path to create: "), DLT_STRING(path) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateFile - no valid path to create: "), DLT_STRING(path) );
}
return handle;
// *************************************************
if((backupAvail == 0) && (csumAvail == 0) )
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency => there is a backup file AND a checksum"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency - there is a backup file AND a checksum"));
// calculate checksum form backup file
fdBackup = open(backupPath, O_RDONLY);
if(fdBackup != -1)
// *************************************************
else if(csumAvail == 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency => there is ONLY a checksum file"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency - there is ONLY a checksum file"));
fdCsum = open(csumPath, O_RDONLY);
if(fdCsum != -1)
readSize = read(fdCsum, csumBuf, ChecksumBufSize);
if(readSize <= 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclVerifyConsistency => read checksum: invalid readSize"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclVerifyConsistency - read checksum: invalid readSize"));
}
close(fdCsum);
// *************************************************
else if(backupAvail == 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency => there is ONLY a backup file"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency - there is ONLY a backup file"));
// calculate checksum form backup file
fdBackup = open(backupPath, O_RDONLY);
// copy data from one file to another
if(pclBackupDoFileCopy(backupFd, handle) == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclRecoverFromBackup => couldn't write whole buffer"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclRecoverFromBackup - couldn't write whole buffer"));
}
}
int csumSize = strlen(csumBuf);
if(write(csfd, csumBuf, csumSize) != csumSize)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup => failed to write checksum to file"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - failed to write checksum to file"));
}
close(csfd);
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup => failed to create checksum file:"), DLT_STRING(strerror(errno)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - failed to create checksum file:"), DLT_STRING(strerror(errno)) );
}
// create backup file, user and group has read/write permission, others have read permission
// copy data from one file to another
if((readSize = pclBackupDoFileCopy(srcfd, dstFd)) == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pcl_create_backup => error copying file"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - error copying file"));
}
if(close(dstFd) == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pcl_create_backup => error closing fd"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - error closing fd"));
}
// set back to the position
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup => failed to open backup file"),
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - failed to open backup file"),
DLT_STRING(dstPath), DLT_STRING(strerror(errno)));
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("custom_libname_to_id - error - id not found for lib:"), DLT_STRING(lib_name));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("custom_client_name_to_id - id not found for lib:"), DLT_STRING(lib_name));
}
}
else
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("custom_libname_to_id - error - id not found for lib:"), DLT_STRING(lib_name));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("custom_client_name_to_id - id not found for lib:"), DLT_STRING(lib_name));
}
}
int i = 0;
int fd = open(filename, O_RDONLY);
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("load custom library config file ==> "), DLT_STRING(filename));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("get_custom_libraries - load config - "), DLT_STRING(filename));
if (fd == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load custom library config file error ==> Error file open: "),
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - Error file open: "),
DLT_STRING(filename), DLT_STRING("err msg: "), DLT_STRING(strerror(errno)) );
return EPERS_COMMON;
}
if (customConfFileMap == MAP_FAILED)
{
close(fd);
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load custom library config file error ==> Error mapping the file"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - Error mapping the file"));
return EPERS_COMMON;
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load custom library config file error ==> Error file size is 0"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - Error file size is 0"));
rval = EPERS_COMMON;
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load custom library config file error ==> failed to stat() file"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - failed to stat() file"));
rval = EPERS_COMMON;
}
return rval;
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - error: could not load plugin functions: "),
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - could not load plugin functions: "),
DLT_STRING(get_custom_client_lib_name(customLib)));
rval = EPERS_COMMON;
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library => error: could not load plugin functions: "),
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - could not load plugin functions: "),
DLT_STRING(get_custom_client_lib_name(customLib)));
rval = EPERS_COMMON;
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - error: unknown init type "),
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - unknown init type "),
DLT_STRING(get_custom_client_lib_name(customLib)));
rval = EPERS_COMMON;
}
else
{
error = dlerror();
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - error:"), DLT_STRING(error));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - "), DLT_STRING(error));
rval = EPERS_DLOPENERROR;
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - error: - customLib out of bounds"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - customLib out of bounds"));
rval = EPERS_DLOPENERROR;
}
{
if(load_custom_library(i, &gPersCustomFuncs[i] ) <= 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_plugins => E r r o r could not load plugin: "),
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_plugins - could not load plugin: "),
DLT_STRING(get_custom_client_lib_name(i)));
rval = EPERS_COMMON;
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclInit => Failed to load custom library config table"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_plugins - Failed to load custom library config table"));
rval = EPERS_COMMON;
}
/// btree array
-static int gHandlesDB[DbTableSize][PersistencePolicy_LastEntry];
-static int gHandlesDBCreated[DbTableSize][PersistencePolicy_LastEntry] = { {0} };
+static int gHandlesDB[DbTableSize][PersistenceDB_LastEntry];
+static int gHandlesDBCreated[DbTableSize][PersistenceDB_LastEntry] = { {0} };
// function prototype
-static int database_get(PersistenceInfo_s* info, const char* dbPath)
+static int database_get(PersistenceInfo_s* info, const char* dbPath, int dbType)
{
int arrayIdx = 0;
int handleDB = -1;
if(arrayIdx < DbTableSize)
{
- if(gHandlesDBCreated[arrayIdx][info->configKey.policy] == 0)
+ if(gHandlesDBCreated[arrayIdx][dbType] == 0)
{
char path[DbPathMaxLen] = {0};
- if(PersistencePolicy_wt == info->configKey.policy) /// write through database
+ if(PersistencePolicy_wt == dbType) /// write through database
{
snprintf(path, DbPathMaxLen, "%s%s", dbPath, gLocalWt);
}
- else if(PersistencePolicy_wc == info->configKey.policy) // cached database
+ else if(PersistencePolicy_wc == dbType) // cached database
{
snprintf(path, DbPathMaxLen, "%s%s", dbPath, gLocalCached);
}
- else if(PersistencePolicy_cd == info->configKey.policy) // configurable default database
+ else if(PersistenceDB_confdefault == dbType) // configurable default database
{
snprintf(path, DbPathMaxLen, "%s%s", dbPath, gLocalConfigurableDefault);
}
- else if(PersistencePolicy_d == info->configKey.policy) // default database
+ else if(PersistenceDB_default == dbType) // default database
{
snprintf(path, DbPathMaxLen, "%s%s", dbPath, gLocalFactoryDefault);
}
handleDB = persComDbOpen(path, 0x01);
if(handleDB >= 0)
{
- gHandlesDB[arrayIdx][info->configKey.policy] = handleDB ;
- gHandlesDBCreated[arrayIdx][info->configKey.policy] = 1;
+ gHandlesDB[arrayIdx][dbType] = handleDB ;
+ gHandlesDBCreated[arrayIdx][dbType] = 1;
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get ==> persComDbOpen() failed"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get - persComDbOpen() failed"));
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get ==> wrong policy! Cannot extend dbPath wit database."));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get - wrong policy! Cannot extend dbPath wit database."));
}
}
else
{
- handleDB = gHandlesDB[arrayIdx][info->configKey.policy];
+ handleDB = gHandlesDB[arrayIdx][dbType];
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get ==> invalid storage type"), DLT_STRING(dbPath));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get - invalid storage type"), DLT_STRING(dbPath));
}
return handleDB;
}
int read_size = EPERS_NOKEY;
char dltMessage[DbPathMaxLen] = {0};
- info->configKey.policy = PersistencePolicy_cd;
- for(i=(int)PersistencePolicy_cd; i<(int)PersistencePolicy_na; i++)
+ for(i=(int)PersistenceDB_confdefault; i<(int)PersistenceDB_LastEntry; i++)
{
- handleDefaultDB = database_get(info, dbPath);
- info->configKey.policy++;
+ handleDefaultDB = database_get(info, dbPath, i);
if(handleDefaultDB >= 0)
{
if (PersGetDefault_Data == job)
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pers_get_defaults ==> unknown job"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pers_get_defaults - unknown job"));
break;
}
{
snprintf(dltMessage, DbPathMaxLen, "%s%s", dbPath, gLocalFactoryDefault);
}
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Default data will be used for Key"), DLT_STRING(key),
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pers_get_defaults - efault data will be used for Key"), DLT_STRING(key),
DLT_STRING("from"), DLT_STRING(dltMessage));
break;
}
if (read_size < 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Default data not available for Key"), DLT_STRING(key),
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pers_get_defaults - default data not available for Key"), DLT_STRING(key),
DLT_STRING("Path:"), DLT_STRING(dbPath));
}
for(i=0; i<DbTableSize; i++)
{
- for(j=0; j < PersistencePolicy_na; j++)
+ for(j=0; j < PersistenceDB_LastEntry; j++)
{
if(gHandlesDBCreated[i][j] == 1)
{
int iErrorCode = persComDbClose(gHandlesDB[i][j]);
if (iErrorCode < 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_close_all => failed to close db => persComDbClose"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_close_all - failed to close db"));
}
else
{
if( PersistenceStorage_shared == info->configKey.storage
|| PersistenceStorage_local == info->configKey.storage)
{
- int handleDB = database_get(info, dbPath);
+ int handleDB = database_get(info, dbPath, info->configKey.policy);
if(handleDB >= 0)
{
read_size = persComDbReadKey(handleDB, key, (char*)buffer, buffer_size);
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Plugin not available (getData), unknown loading type: "),
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_get_data - Plugin not available, unknown loading type: "),
DLT_INT(getCustomLoadingType(idx)));
read_size = EPERS_COMMON;
}
(void)get_db_path_and_key(info, key, NULL, dbPath);
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Plugin data not available. Try to get default data of key:"), DLT_STRING(key));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_get_data - Plugin data not available - get default data of key:"), DLT_STRING(key));
ret_defaults = pers_get_defaults(dbPath, (char*)resourceID, info, buffer, buffer_size, PersGetDefault_Data);
if (0 < ret_defaults)
{
-int persistence_set_data(char* dbPath, char* key, PersistenceInfo_s* info, unsigned char* buffer, unsigned int buffer_size)
+int persistence_set_data(char* dbPath, char* key, const char* resource_id, PersistenceInfo_s* info, unsigned char* buffer, unsigned int buffer_size)
{
int write_size = -1;
int handleDB = -1 ;
- handleDB = database_get(info, dbPath);
+ handleDB = database_get(info, dbPath, info->configKey.policy);
if(handleDB >= 0)
{
write_size = persComDbWriteKey(handleDB, key, (char*)buffer, buffer_size) ;
if(write_size < 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data ==> persComDbWriteKey() failure"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data - persComDbWriteKey() failure"));
}
else
{
if(PersistenceStorage_shared == info->configKey.storage)
{
- int rval = pers_send_Notification_Signal(key, &info->context, pclNotifyStatus_changed);
+ int rval = pers_send_Notification_Signal(resource_id, &info->context, pclNotifyStatus_changed);
if(rval <= 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data ==> failed to send notification signal"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data - failed to send notification signal"));
write_size = rval;
}
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data ==> no resource config table"), DLT_STRING(dbPath), DLT_STRING(key));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data - no resource config table"), DLT_STRING(dbPath), DLT_STRING(key));
write_size = EPERS_NOPRCTABLE;
}
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Plugin not available (setData), unknown loading type: "),
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_set_data - Plugin not available, unknown loading type: "),
DLT_INT(getCustomLoadingType(idx)));
write_size = EPERS_COMMON;
}
if ((0 < write_size) && ((unsigned int)write_size == buffer_size)) /* Check return value and send notification if OK */
{
- int rval = pers_send_Notification_Signal(key, &info->context, pclNotifyStatus_changed);
+ int rval = pers_send_Notification_Signal(resource_id, &info->context, pclNotifyStatus_changed);
if(rval <= 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data ==> failed to send notification signal"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data - failed to send notification signal"));
write_size = rval;
}
}
if( PersistenceStorage_shared == info->configKey.storage
|| PersistenceStorage_local == info->configKey.storage)
{
- int handleDB = database_get(info, dbPath);
+ int handleDB = database_get(info, dbPath, info->configKey.policy);
if(handleDB >= 0)
{
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Plugin not available (getDataSize), unknown loading type: "),
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_get_data_size - Plugin not available, unknown loading type: "),
DLT_INT(getCustomLoadingType(idx)));
read_size = EPERS_COMMON;
}
info->configKey.policy = PersistencePolicy_wc; /* Set the policy */
info->configKey.type = PersistenceResourceType_key; /* Set the type */
(void)get_db_path_and_key(info, key, NULL, dbPath);
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Plugin data not available. Try to get size of default data for key:"),
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_get_data_size - Plugin data not available, get size of default data for key:"),
DLT_STRING(key));
ret_defaults = pers_get_defaults(dbPath, (char*)resourceID, info, NULL, 0, PersGetDefault_Size);
if (0 < ret_defaults)
-int persistence_delete_data(char* dbPath, char* key, PersistenceInfo_s* info)
+int persistence_delete_data(char* dbPath, char* key, const char* resource_id, PersistenceInfo_s* info)
{
int ret = 0;
if(PersistenceStorage_custom != info->configKey.storage)
{
- int handleDB = database_get(info, dbPath);
+ int handleDB = database_get(info, dbPath, info->configKey.policy);
if(handleDB >= 0)
{
ret = persComDbDeleteKey(handleDB, key) ;
if(ret < 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_delete_data => persComDbDeleteKey failed: "), DLT_STRING(key));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_delete_data - failed: "), DLT_STRING(key));
if(PERS_COM_ERR_NOT_FOUND == ret)
{
ret = EPERS_NOKEY ;
if(PersistenceStorage_shared == info->configKey.storage)
{
- pers_send_Notification_Signal(key, &info->context, pclNotifyStatus_deleted);
+ pers_send_Notification_Signal(resource_id, &info->context, pclNotifyStatus_deleted);
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_delete_data ==> no resource config table"), DLT_STRING(dbPath), DLT_STRING(key));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_delete_data - no resource config table"), DLT_STRING(dbPath), DLT_STRING(key));
ret = EPERS_NOPRCTABLE;
}
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Plugin not available (deleteData), unknown loading type: "),
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_delete_data - Plugin not available, unknown loading type: "),
DLT_INT(getCustomLoadingType(idx)));
ret = EPERS_COMMON;
}
if(0 <= ret) /* Check return value and send notification if OK */
{
- pers_send_Notification_Signal(key, &info->context, pclNotifyStatus_deleted);
+ pers_send_Notification_Signal(resource_id, &info->context, pclNotifyStatus_deleted);
}
}
else
if(-1 == deliverToMainloop(&data))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_notify_on_change => failed to write to pipe"), DLT_INT(errno));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_notify_on_change - failed to write to pipe"), DLT_INT(errno));
rval = -1;
}
}
if(-1 == deliverToMainloop(&data) )
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pers_send_Notification_Signal => failed to write to pipe"), DLT_INT(errno));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pers_send_Notification_Signal - failed to write to pipe"), DLT_INT(errno));
rval = EPERS_NOTIFY_SIG;
}
}
{
if(persComRctClose(get_resource_cfg_table_by_idx(i)) != 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_prepare_shutdown => failed to close db => index:"), DLT_INT(i));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_prepare_shutdown - failed close db => index:"), DLT_INT(i));
}
invalidate_resource_cfg_table(i);
+/// default database definitions
+typedef enum PersistenceDB_e_
+{
+ /// configurable default database
+ PersistenceDB_confdefault = PersistencePolicy_LastEntry,
+ /// default database
+ PersistenceDB_default,
+
+ PersistenceDB_LastEntry
+
+} PersistenceDefaultDB_e;
+
+
/**
* @brief get the raw key without prefixed '/node/', '/user/3/' etc
*
*
* @param dbPath the path to the database where the key is in
* @param key the database key
+ * @param resource_id the resource identifier
* @param info persistence information
* @param buffer the buffer holding the data
* @param buffer_size the size of the buffer
* @return the number of bytes written or a negative value if an error occured with the following error codes:
* EPERS_SETDTAFAILED EPERS_NOPRCTABLE EPERS_NOKEYDATA EPERS_NOKEY
*/
-int persistence_set_data(char* dbPath, char* key, PersistenceInfo_s* info, unsigned char* buffer, unsigned int buffer_size);
+int persistence_set_data(char* dbPath, char* key, const char* resource_id, PersistenceInfo_s* info, unsigned char* buffer, unsigned int buffer_size);
*
* @param dbPath the path to the database where the key is in
* @param key the database key to register on
+ * @param resource_id the resource identifier
* @param info persistence information
*
* @return 0 if deletion was successfull;
* or an error code: EPERS_DB_KEY_SIZE, EPERS_NOPRCTABLE, EPERS_DB_ERROR_INTERNAL or EPERS_NOPLUGINFUNCT
*/
-int persistence_delete_data(char* dbPath, char* key, PersistenceInfo_s* info);
+int persistence_delete_data(char* dbPath, char* key, const char* resource_id, PersistenceInfo_s* info);
snprintf(userArray, DbusSubMatchSize, "%u", notifyUserNo);
snprintf(seatArray, DbusSubMatchSize, "%u", notifySeatNo);
- //printf("process_send_Notification_Signal => key: %s | lbid: %d | gUserNo: %d | gSeatNo: %d | gReason: %d \n", gNotifykey, gLdbid, gUserNo, gSeatNo, gReason);
+ //printf("process_send_Notification_Signal => key: %s | lbid: %d | gUserNo: %d | gSeatNo: %d | gReason: %d \n", notifyKey, notifyLdbid, notifyUserNo, notifySeatNo, notifyReason);
message = dbus_message_new_signal(gPersAdminConsumerPath,
gDbusPersAdminConsInterface,
notifyReasonString);
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal ==> failed to send dbus message!!"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - failed to send dbus message!!"));
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal ==> E R R O R C O N E C T I O N NULL!!"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - C O N E C T I O N NULL!!"));
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal ==> ERROR dbus_message_append_args"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - dbus_message_append_args"));
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal ==> ERROR invalid notification reason"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - invalid notification reason"));
}
}
#endif
if(rval == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_prepare_shutdown => failed to close file: "), DLT_STRING(strerror(errno)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_prepare_shutdown - failed to close file: "), DLT_STRING(strerror(errno)) );
}
}
if(!dbus_connection_send(conn, message, 0))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register => Access denied"), DLT_STRING(error.message) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - Access denied"), DLT_STRING(error.message) );
}
dbus_connection_flush(conn);
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request => ERROR: Invalid message") );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request - Invalid message") );
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request => ERROR: Invalid connection") );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request - Invalid connection") );
}
}
if(!dbus_pending_call_set_notify(pending, msg_pending_func, method, NULL))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_pas_register => dbus_pending_call_set_notify: FAILED\n") );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_pas_register - dbus_pending_call_set_notify: FAILED\n") );
}
dbus_pending_call_unref(pending);
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register => ERROR: Invalid message") );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register - Invalid message") );
}
dbus_message_unref(message);
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register => ERROR: Invalid busname") );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register - Invalid busname") );
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register => ERROR: Invalid connection") );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register - Invalid connection") );
}
}
if(!dbus_connection_send(conn, message, 0))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register => Access denied"), DLT_STRING(error.message) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - Access denied"), DLT_STRING(error.message) );
}
dbus_connection_flush(conn);
dbus_message_unref(message);
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register => ERROR: Invalid message"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - Invalid message"));
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register => ERROR: connection isn NULL"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - connection isn NULL"));
}
}
if(!dbus_connection_send(conn, message, 0))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request => Access denied"), DLT_STRING(error.message) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request - Access denied"), DLT_STRING(error.message) );
}
dbus_connection_flush(conn);
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request => ERROR: Invalid message"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request - Invalid message"));
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request => ERROR: connection isn NULL"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request - connection isn NULL"));
}
}
if (dbus_set_error_from_message(&err, message))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_pending_func ==> Access denied") );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_pending_func - Access denied") );
}
else
{
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback -> unknown signal:"), DLT_STRING(dbus_message_get_interface(message)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - unknown signal:"), DLT_STRING(dbus_message_get_interface(message)) );
}
}
}
if (reply == 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback => DBus No memory"), DLT_STRING(dbus_message_get_interface(message)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - DBus No memory"), DLT_STRING(dbus_message_get_interface(message)) );
}
if (!dbus_connection_send(connection, reply, 0))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback => DBus No memory"), DLT_STRING(dbus_message_get_interface(message)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - DBus No memory"), DLT_STRING(dbus_message_get_interface(message)) );
}
result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;;
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback => gChangeNotifyCallback is not set (possibly NULL)") );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - gChangeNotifyCallback is not set (possibly NULL)") );
}
result = DBUS_HANDLER_RESULT_HANDLED;
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback -> unknown property:"), DLT_STRING(dbus_message_get_interface(message)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - unknown property:"), DLT_STRING(dbus_message_get_interface(message)) );
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback -> not a signal:"), DLT_STRING(dbus_message_get_member(message)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - not a signal:"), DLT_STRING(dbus_message_get_member(message)) );
}
}
return result;
// Connect to the bus and check for errors
if(pAddress != NULL)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("setup_dbus_mainloop -> Use specific dbus address:"), DLT_STRING(pAddress) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("setup_dbus_mainloop - Use specific dbus address:"), DLT_STRING(pAddress) );
conn = dbus_connection_open_private(pAddress, &err);
{
if(!dbus_bus_register(conn, &err))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbus_bus_register() Error :"), DLT_STRING(err.message) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbus_bus_register() :"), DLT_STRING(err.message) );
dbus_error_free (&err);
pthread_mutex_unlock(&gDbusInitializedMtx);
return -1;
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbus_connection_open_private() Error :"), DLT_STRING(err.message) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbus_connection_open_private() :"), DLT_STRING(err.message) );
dbus_error_free(&err);
pthread_mutex_unlock(&gDbusInitializedMtx);
return -1;
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout => timerfd_settime() failed"), DLT_STRING(strerror(errno)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout - timerfd_settime() failed"), DLT_STRING(strerror(errno)) );
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout => timerfd_create() failed"), DLT_STRING(strerror(errno)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout - timerfd_create() failed"), DLT_STRING(strerror(errno)) );
}
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout => cannot create another fd to be poll()'ed"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout - cannot create another fd to be poll()'ed"));
}
return ret;
}
{
if (-1==close(gPollInfo.fds[i].fd))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("removeTimeout => close() timerfd"), DLT_STRING(strerror(errno)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("removeTimeout - close() timerfd"), DLT_STRING(strerror(errno)) );
}
--gPollInfo.nfds;
const struct itimerspec its = { .it_value= {interval/1000, interval%1000} };
if (-1!=timerfd_settime(gPollInfo.fds[i].fd, 0, &its, NULL))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("timeoutToggled => timerfd_settime()"), DLT_STRING(strerror(errno)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("timeoutToggled - timerfd_settime()"), DLT_STRING(strerror(errno)) );
}
}
}
if (dbus_error_is_set(&err))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => Connection Error:"), DLT_STRING(err.message) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - Connection Error:"), DLT_STRING(err.message) );
dbus_error_free(&err);
}
else if (NULL != conn)
//if (-1 == (gEfds = eventfd(0, 0)))
if (-1 == (pipe(gPipeFd)))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => eventfd() failed w/ errno:"), DLT_INT(errno) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - eventfd() failed w/ errno:"), DLT_INT(errno) );
}
else
{
if( (TRUE!=dbus_connection_set_watch_functions(conn, addWatch, removeWatch, watchToggled, NULL, NULL))
|| (TRUE!=dbus_connection_set_timeout_functions(conn, addTimeout, removeTimeout, timeoutToggled, NULL, NULL)) )
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => dbus_connection_set_watch_functions() failed"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - dbus_connection_set_watch_functions() failed"));
}
else
{
if (0>ret)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => poll() failed w/ errno "), DLT_INT(errno) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - poll() failed w/ errno "), DLT_INT(errno) );
}
else if (0==ret)
{
if ((ssize_t)sizeof(nExpCount)!=read(gPollInfo.fds[i].fd, &nExpCount, sizeof(nExpCount)))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => read failed"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - read failed"));
}
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => timeout"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - timeout"));
if (FALSE==dbus_timeout_handle(gPollInfo.objects[i].timeout))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => dbus_timeout_handle() failed!?"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - dbus_timeout_handle() failed!?"));
}
bContinue = TRUE;
}
while ((-1==(ret = read(gPollInfo.fds[i].fd, readData.payload, 128)))&&(EINTR == errno));
if(ret < 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => read() failed"), DLT_STRING(strerror(errno)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - read() failed"), DLT_STRING(strerror(errno)) );
}
else
{
bQuit = TRUE;
break;
default:
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => command not handled"), DLT_INT(readData.message.cmd) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - command not handled"), DLT_INT(readData.message.cmd) );
break;
}
pthread_cond_signal(&gMainLoopCond);
wantBackup = 0;
if((handle = pclVerifyConsistency(dbPath, backupPath, csumPath, flags)) == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileOpen: error => file inconsistent, recovery N O T possible!"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileOpen - file inconsistent, recovery N O T possible!"));
return -1;
}
}
else
{
if(dbContext.configKey.permission == PersistencePermission_ReadOnly)
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileOpen: No Backup => file is READ ONLY!"), DLT_STRING(dbKey));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileOpen: No Backup - file is READ ONLY!"), DLT_STRING(dbKey));
else
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileOpen: No Backup => file is in backup blacklist!"), DLT_STRING(dbKey));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileOpen: No Backup - file is in backup blacklist!"), DLT_STRING(dbKey));
}
{
if((handle = pclCreateFile(dbPath, cacheStatus)) == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileOpen: error => failed to create file: "), DLT_STRING(dbPath));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileOpen - failed to create file: "), DLT_STRING(dbPath));
}
else
{
if(pclFileGetDefaultData(handle, resource_id, dbContext.configKey.policy) == -1) // try to get default data
{
- DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileOpen: no default data available: "), DLT_STRING(resource_id));
+ DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileOpen - no default data available: "), DLT_STRING(resource_id));
}
}
rval = remove(dbPath);
if(rval == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileRemove => remove ERROR"), DLT_STRING(strerror(errno)) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileRemove - remove()"), DLT_STRING(strerror(errno)) );
}
}
else
{
rval = shared_DB;
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileRemove ==> no valid database context or resource not a file"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileRemove - no valid database context or resource not a file"));
}
}
else
if(get_file_cache_status(fd) == 1)
{
if(fsync(fd) == -1)
- DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileWriteData: Failed to fsync ==>!"), DLT_STRING(strerror(errno)));
+ DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileWriteData - Failed to fsync ==>!"), DLT_STRING(strerror(errno)));
}
#endif
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileWriteData: Failed to write ==> read only file!"), DLT_STRING(get_file_backup_path(fd)));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileWriteData - Failed to write ==> read only file!"), DLT_STRING(get_file_backup_path(fd)));
size = EPERS_RESOURCE_READ_ONLY;
}
}
if((handle = pclVerifyConsistency(dbPath, backupPath, csumPath, flags)) == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileCreatePath: error => file inconsistent, recovery N O T possible!"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileCreatePath - file inconsistent, recovery N O T possible!"));
return -1;
}
// we don't need the file handle here
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileCreatePath: No Backup => read only OR in blacklist!"), DLT_STRING(dbKey));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileCreatePath - No Backup, read only OR in blacklist!"), DLT_STRING(dbKey));
}
handle = get_persistence_handle_idx();
if(handle == -1)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileCreatePath: error => failed to create file: "), DLT_STRING(*path));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileCreatePath - failed to create file: "), DLT_STRING(*path));
}
else
{
if(pclFileGetDefaultData(handle, resource_id, dbContext.configKey.policy) == -1) // try to get default data
{
- DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileCreatePath => no default data available: "), DLT_STRING(resource_id));
+ DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileCreatePath - no default data available: "), DLT_STRING(resource_id));
}
close(handle); // don't need the open file
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileGetDefaultData => failed to copy file "), DLT_STRING(strerror(errno)));
+ DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileGetDefaultData - failed to copy file "), DLT_STRING(strerror(errno)));
}
close(defaultHandle);
else
{
handle = EPERS_MAXHANDLE;
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_persistence_handle_idx => Reached maximum of open handles: "), DLT_INT(MaxPersHandle));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_persistence_handle_idx - max open handles: "), DLT_INT(MaxPersHandle));
}
}
pthread_mutex_unlock(&gMtx);
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("set_key_handle_data: error - index out of bounds:"), DLT_INT(idx));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("set_key_handle_data - index out of bounds:"), DLT_INT(idx));
}
pthread_mutex_unlock(&gKeyHandleAccessMtx);
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyHandleOpen: error - no database context or resource is not a key "));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyHandleOpen - no database context or resource is not a key "));
}
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyHandleRegisterNotifyOnChange: Only one callback is allowed for change notifications."));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyHandleRegisterNotifyOnChange - Only one callback is allowed for change notifications."));
rval = EPERS_NOTIFY_NOT_ALLOWED;
}
return rval;
{
if( dbContext.configKey.storage < PersistenceStorage_LastEntry) // check if store policy is valid
{
- rval = persistence_delete_data(dbPath, dbKey, &dbContext);
+ rval = persistence_delete_data(dbPath, dbKey, resource_id, &dbContext);
}
else
{
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyReadData - error - no database context or resource is not a key"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyReadData - no database context or resource is not a key"));
}
}
else
// store data
if( dbContext.configKey.storage < PersistenceStorage_LastEntry) // check if store policy is valid
{
- data_size = persistence_set_data(dbPath, dbKey, &dbContext, buffer, buffer_size);
+ data_size = persistence_set_data(dbPath, dbKey, resource_id, &dbContext, buffer, buffer_size);
}
else
{
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyWriteData - error - no database context or resource is not a key"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyWriteData no database context or resource is not a key"));
}
}
else
{
data_size = EPERS_BUFLIMIT;
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyWriteData: error - buffer_size to big, limit is [bytes]:"), DLT_INT(gMaxKeyValDataSize));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyWriteData - buffer_size to big, limit is [bytes]:"), DLT_INT(gMaxKeyValDataSize));
}
}
else
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyRegisterNotifyOnChange: Only one callback is allowed for change notifications."));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyRegisterNotifyOnChange - Only one callback is allowed for change notifications."));
rval = EPERS_NOTIFY_NOT_ALLOWED;
}
return rval;
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("regNotifyOnChange: Not allowed! Resource is local or it is a file:"),
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("regNotifyOnChange - Not allowed! Resource is local or it is a file:"),
DLT_STRING(resource_id), DLT_STRING("LDBID:"), DLT_UINT(ldbid));
rval = EPERS_NOTIFY_NOT_ALLOWED;
}
else
{
DLT_LOG(gPclDLTContext, DLT_LOG_ERROR,
- DLT_STRING("regNotifyOnChange: Not possible! get_db_context() returned:"),
+ DLT_STRING("regNotifyOnChange - Not possible! get_db_context() returned:"),
DLT_INT(rval));
}
}
if(-1 == deliverToMainloop_NM(&data) )
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("check_lc_request => failed to write to pipe"), DLT_INT(errno));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("check_lc_request - failed to write to pipe"), DLT_INT(errno));
rval = NsmErrorStatus_Fail;
}
else
}
default:
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("check_lc_request => Unknown lifecycle message"), DLT_INT(request));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("check_lc_request - Unknown lifecycle message"), DLT_INT(request));
break;
}
}
if (reply == 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory"));
}
if (!dbus_connection_send(connection, reply, 0))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory"));
}
dbus_message_unref(reply);
if (reply == 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory"));
}
if (!dbus_message_append_args(reply, DBUS_TYPE_INT32, &msgReturn, DBUS_TYPE_INVALID))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory"));
}
if (!dbus_connection_send(connection, reply, 0))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory"));
}
dbus_connection_flush(connection);
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkLifecycleMsg -> unknown message "), DLT_STRING(dbus_message_get_interface(message)));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkLifecycleMsg - unknown message "), DLT_STRING(dbus_message_get_interface(message)));
}
}
return result;
data.message.params[1] = requestID;
data.message.string[0] = '\0'; // no string parameter, set to 0
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("PCL: check_pas_request; case PasMsg_Block o. PasMsg_WriteBack"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("check_pas_request - case PasMsg_Block o. PasMsg_WriteBack"));
if(-1 == deliverToMainloop_NM(&data))
{
DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("write failed w/ errno "), DLT_INT(errno), DLT_STRING(strerror(errno)));
}
case PasMsg_Unblock:
{
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("PCL: check_pas_request; case PasMsg_Unblock"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("check_pas_request - case PasMsg_Unblock"));
pers_unlock_access();
rval = PasErrorStatus_OK;
break;
if(reply == 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory"));
}
if (!dbus_connection_send(connection, reply, 0))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory"));
}
dbus_message_unref(reply);
if (reply == 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory"));
}
if (!dbus_message_append_args(reply, DBUS_TYPE_INT32, &errorReturn, DBUS_TYPE_INVALID))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory"));
}
if (!dbus_connection_send(connection, reply, 0))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory"));
}
dbus_connection_flush(connection);
if(reply == 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory"));
}
if (!dbus_connection_send(connection, reply, 0))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory"));
}
dbus_message_unref(reply);
if (reply == 0)
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory"));
}
if (!dbus_message_append_args(reply, DBUS_TYPE_INT32, &errorCode, DBUS_TYPE_INVALID))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory"));
}
if (!dbus_connection_send(connection, reply, 0))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange => DBus No memory"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory"));
}
dbus_connection_flush(connection);
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkPersAdminMsg => unknown message"), DLT_STRING(dbus_message_get_member(message)));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkPersAdminMsg - unknown message"), DLT_STRING(dbus_message_get_member(message)));
}
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkPersAdminMsg => unknown message"), DLT_STRING(dbus_message_get_interface(message)));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkPersAdminMsg - unknown message"), DLT_STRING(dbus_message_get_interface(message)));
}
return result;
}
if(-1 == deliverToMainloop(&data))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("register_pers_admin_service => failed to write to pipe"), DLT_INT(errno));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("register_pers_admin_service - failed to write to pipe"), DLT_INT(errno));
rval = -1;
}
else
if(-1 == deliverToMainloop(&data))
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("unregister_pers_admin_service => failed to write to pipe"), DLT_INT(errno));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("unregister_pers_admin_service - failed to write to pipe"), DLT_INT(errno));
rval = -1;
}
else
snprintf(filename, DbPathMaxLen, gSharedWtPathKey, gAppId, group, gResTableCfg);
break;
default:
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_resource_cfg_table - error: no valid PersistenceRCT_e"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_resource_cfg_table - no valid PersistenceRCT_e"));
break;
}
if(gResource_table[arrayIdx] < 0)
{
gResourceOpen[arrayIdx] = -1;
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_resource_cfg_table => RCT problem"), DLT_INT(gResource_table[arrayIdx] ));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_resource_cfg_table - RCT problem"), DLT_INT(gResource_table[arrayIdx] ));
}
else
{
}
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("get_db_context => persComRctRead => resource_table: no value for key:"), DLT_STRING(resource_id) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("get_db_context - resource_table: no value for key:"), DLT_STRING(resource_id) );
rval = EPERS_NOKEYDATA;
}
} // resource table
else
{
- DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_db_context =>error resource table"));
+ DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_db_context - resource table"));
rval = EPERS_NOPRCTABLE;
}
memcpy(dbContext->configKey.reponsible, "default", strlen("default"));
memcpy(dbContext->configKey.custom_name, "default", strlen("default"));
- DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("get_db_context => create resource not in PRCT => key:"), DLT_STRING(resource_id) );
+ DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("get_db_context - create resource not in PRCT => key:"), DLT_STRING(resource_id) );
rval = get_db_path_and_key(dbContext, resource_id, dbKey, dbPath);
}
ret = pclKeyHandleOpen(0xFF, "posHandle/last_position", 0, 0);
printf("Register for change notification\n");
- ret = pclKeyRegisterNotifyOnChange(0x84, "links/last_link2", 2/*user_no*/, 1/*seat_no*/, &myChangeCallback);
- ret = pclKeyRegisterNotifyOnChange(0x84, "links/last_link3", 3/*user_no*/, 2/*seat_no*/, &myChangeCallback);
- ret = pclKeyRegisterNotifyOnChange(0x84, "links/last_link4", 4/*user_no*/, 1/*seat_no*/, &myChangeCallback);
+ ret = pclKeyRegisterNotifyOnChange(0x20, "links/last_link2", 2/*user_no*/, 1/*seat_no*/, &myChangeCallback);
+ ret = pclKeyRegisterNotifyOnChange(0x20, "links/last_link3", 3/*user_no*/, 2/*seat_no*/, &myChangeCallback);
+ ret = pclKeyRegisterNotifyOnChange(0x20, "links/last_link4", 4/*user_no*/, 1/*seat_no*/, &myChangeCallback);
ret = pclKeyRegisterNotifyOnChange(0xFF, "69", 1/*user_no*/, 2/*seat_no*/, &myChangeCallback);
printf("Reg => 69: %d\n", ret);
printf("Press enter to unregister to notifications\n");
getchar();
- ret = pclKeyUnRegisterNotifyOnChange(0x84, "links/last_link2", 2/*user_no*/, 1/*seat_no*/, &myChangeCallback);
- ret = pclKeyUnRegisterNotifyOnChange(0x84, "links/last_link3", 3/*user_no*/, 2/*seat_no*/, &myChangeCallback);
- ret = pclKeyUnRegisterNotifyOnChange(0x84, "links/last_link4", 4/*user_no*/, 1/*seat_no*/, &myChangeCallback);
+ ret = pclKeyUnRegisterNotifyOnChange(0x20, "links/last_link2", 2/*user_no*/, 1/*seat_no*/, &myChangeCallback);
+ ret = pclKeyUnRegisterNotifyOnChange(0x20, "links/last_link3", 3/*user_no*/, 2/*seat_no*/, &myChangeCallback);
+ ret = pclKeyUnRegisterNotifyOnChange(0x20, "links/last_link4", 4/*user_no*/, 1/*seat_no*/, &myChangeCallback);
printf("Press enter to register to notifications\n");
getchar();
- ret = pclKeyRegisterNotifyOnChange(0x84, "links/last_link2", 2/*user_no*/, 1/*seat_no*/, &myChangeCallback);
- ret = pclKeyRegisterNotifyOnChange(0x84, "links/last_link3", 3/*user_no*/, 2/*seat_no*/, &myChangeCallback);
- ret = pclKeyRegisterNotifyOnChange(0x84, "links/last_link4", 4/*user_no*/, 1/*seat_no*/, &myChangeCallback);
+ ret = pclKeyRegisterNotifyOnChange(0x20, "links/last_link2", 2/*user_no*/, 1/*seat_no*/, &myChangeCallback);
+ ret = pclKeyRegisterNotifyOnChange(0x20, "links/last_link3", 3/*user_no*/, 2/*seat_no*/, &myChangeCallback);
+ ret = pclKeyRegisterNotifyOnChange(0x20, "links/last_link4", 4/*user_no*/, 1/*seat_no*/, &myChangeCallback);
printf("Press enter to end\n");
getchar();
+void data_setup(void)
+{
+ unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
+ (void)pclInitLibrary(gTheAppId, shutdownReg);
+}
+
void data_teardown(void)
{
- printf("* * * tear down * * *\n"); // nothing
+ pclDeinitLibrary();
}
int myChangeCallback(pclNotification_s * notifyStruct)
{
printf(" ==> * - * myChangeCallback * - *\n");
-
return 1;
}
X_TEST_REPORT_TYPE(GOOD);
int ret = 0;
- unsigned int shutdownReg = (PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL);
-
unsigned char buffer[READ_SIZE] = {0};
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
#if 1
/**
memset(buffer, 0, READ_SIZE);
#endif
- pclDeinitLibrary();
+
}
END_TEST
X_TEST_REPORT_TYPE(GOOD);
int ret = 0, handle = 0, handle2 = 0, handle3 = 0, handle4 = 0, size = 0;
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
unsigned char buffer[READ_SIZE] = {0};
struct tm *locTime;
char sysTimeBuffer[128];
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
#if 1
time_t t = time(0);
x_fail_unless(handle >= 0, "Failed to open handle ==> /posHandle/last_position");
ret = pclKeyHandleReadData(handle, buffer, READ_SIZE);
- x_fail_unless(strncmp((char*)buffer, "WT_ H A N D L E: +48° 10' 38.95\", +8° 44' 39.06\"", ret-1) == 0, "Buffer not correctly read => 1");
+ //printf("pclKeyHandleReadData: \nsoll: %s \nist : %s => ret: %d | strlen: %d\n", "WT_ H A N D L E: +48° 10' 38.95\", +8° 44' 39.06\"", buffer, ret, strlen("WT_ H A N D L E: +48° 10' 38.95\", +8° 44' 39.06\""));
+ x_fail_unless(strncmp((char*)buffer, "WT_ H A N D L E: +48° 10' 38.95\", +8° 44' 39.06\"", ret) == 0, "Buffer not correctly read => 1");
size = pclKeyHandleGetSize(handle);
+ //printf("pclKeyHandleGetSize => size: %d\n", size);
x_fail_unless(size == strlen("WT_ H A N D L E: +48° 10' 38.95\", +8° 44' 39.06\""));
// ---------------------------------------------------------------------------------------------
#if 0 // plugin test case
memset(buffer, 0, READ_SIZE);
handle4 = pclKeyHandleOpen(0xFF, "language/country_code", 0, 0);
- printf("H A N D L E: %d\n", handle4);
x_fail_unless(handle4 >= 0, "Failed to open handle /language/country_code");
ret = pclKeyHandleReadData(handle4, buffer, READ_SIZE);
ret = pclKeyHandleClose(handle3);
ret = pclKeyHandleClose(handle4);
#endif
- pclDeinitLibrary();
}
END_TEST
X_TEST_REPORT_REFERENCE("NONE");
X_TEST_REPORT_DESCRIPTION("Test of set data");
X_TEST_REPORT_TYPE(GOOD);
-
int ret = 0;
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
+
unsigned char buffer[READ_SIZE] = {0};
char write1[READ_SIZE] = {0};
char write2[READ_SIZE] = {0};
struct tm *locTime;
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
-
#if 1
/**
* Logical DB ID: 0xFF with user 3 and seat 2
* ==> used for shared testing
*/
//printf("Write data to trigger change notification\n");
- ret = pclKeyWriteData(0x84, "links/last_link2", 2, 1, (unsigned char*)"Test notify shared data", strlen("Test notify shared data"));
+ ret = pclKeyWriteData(0x20, "links/last_link2", 2, 1, (unsigned char*)"Test notify shared data", strlen("Test notify shared data"));
x_fail_unless(ret == strlen("Test notify shared data"), "Wrong write size");
/**
* ==> used for shared testing
*/
//printf("Write data to trigger change notification\n");
- ret = pclKeyWriteData(0x84, "links/last_link3", 3, 2, (unsigned char*)"Test notify shared data", strlen("Test notify shared data"));
+ ret = pclKeyWriteData(0x20, "links/last_link3", 3, 2, (unsigned char*)"Test notify shared data", strlen("Test notify shared data"));
x_fail_unless(ret == strlen("Test notify shared data"), "Wrong write size");
/**
* ==> used for shared testing
*/
//printf("Write data to trigger change notification\n");
- ret = pclKeyWriteData(0x84, "links/last_link4", 4, 1, (unsigned char*)"Test notify shared data", strlen("Test notify shared data"));
+ ret = pclKeyWriteData(0x20, "links/last_link4", 4, 1, (unsigned char*)"Test notify shared data", strlen("Test notify shared data"));
x_fail_unless(ret == strlen("Test notify shared data"), "Wrong write size");
/*******************************************************************************************************************************************/
/*******************************************************************************************************************************************/
x_fail_unless(ret == strlen(write2), "Wrong read size");
#endif
#endif
- pclDeinitLibrary();
}
END_TEST
X_TEST_REPORT_TYPE(GOOD);
int ret = 0;
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
unsigned char buffer[READ_SIZE] = {0};
struct tm *locTime;
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
#if 1
time_t t = time(0);
x_fail_unless(ret == strlen(sysTimeBuffer), "Wrong read size");
//printf("read buffer : %s\n", buffer);
#endif
- pclDeinitLibrary();
}
END_TEST
X_TEST_REPORT_DESCRIPTION("Test of get data size");
X_TEST_REPORT_TYPE(GOOD);
- int size = 0, ret = 0;
-
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
+ int size = 0;
#if 1
/**
* Logical DB ID: 0xFF with user 3 and seat 2
size = pclKeyGetSize(0x84, "links/last_link", 2, 1);
x_fail_unless(size == strlen("CACHE_ /last_exit/queens"), "Invalid size");
#endif
- pclDeinitLibrary();
}
END_TEST
int rval = 0;
unsigned char buffer[READ_SIZE];
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
- rval = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(rval <= 1, "Failed to init PCL");
#if 1
// read data from key
rval = pclKeyReadData(0xFF, "key_70", 1, 2, buffer, READ_SIZE);
rval = pclKeyReadData(0xFF, "70", 1, 2, buffer, READ_SIZE);
x_fail_unless(rval == EPERS_NOKEY, "Read form key 70 works, but should fail");
#endif
- pclDeinitLibrary();
}
END_TEST
const char* backupBlacklist = "/Data/mnt-c/lt-persistence_client_library_test/BackupFileList.info";
+ unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
+ (void)pclInitLibrary(gTheAppId, shutdownReg);
+
if(access(backupBlacklist, F_OK) == -1)
{
int ret = 0;
int size = 0, ret = 0, avail = 100;
int writeSize = 16*1024;
int fdArray[10] = {0};
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
unsigned char buffer[READ_SIZE] = {0};
unsigned char wBuffer[READ_SIZE] = {0};
char* writeBuffer;
char* fileMap = NULL;
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
#if 1
writeBuffer = malloc(writeSize);
// negative test
size = pclFileGetSize(1024);
x_fail_unless(size < 0 , "Got size, but should not");
- /*
+
ret = pclFileClose(fd);
x_fail_unless(ret == 0, "Failed to close file");
-*/
// test backup blacklist functionality
fdArray[0] = pclFileOpen(0xFF, "media/doNotBackupMe.txt_START", 1, 1);
avail = access("/Data/mnt-backup/lt-persistence_client_library_test/user/1/seat/1/media/doNotBackupMe.txt_START~", F_OK);
x_fail_unless(avail == -1, "1. Failed backup => backup available, but should not");
-
avail = access("/Data/mnt-backup/lt-persistence_client_library_test/user/1/seat/2/media/doNotBackupMe.txt_START~", F_OK);
x_fail_unless(avail == -1, "2. Failed backup => backup available, but should not");
free(writeBuffer);
#endif
- pclDeinitLibrary();
}
END_TEST
int handle = -1;
const char* path = "/Data/mnt-c/lt-persistence_client_library_test/user/1/seat/1/media/mediaDB_ReadWrite.db";
+ unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
+ (void)pclInitLibrary(gTheAppId, shutdownReg);
+
handle = open(path, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
if(write(handle, gWriteBackupTestData, strlen(gWriteBackupTestData)) == -1)
{
X_TEST_REPORT_TYPE(GOOD);
int fd_RW = 0, fd_RO = 0, rval = -1, handle = -1;
- int ret = 0;
char* wBuffer = " ==> Appended: Test Data - test_DataFileRecovery! ";
const char* path = "/Data/mnt-backup/lt-persistence_client_library_test/user/1/seat/1/media/mediaDB_ReadWrite.db~";
char rBuffer[1024] = {0};
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
#if 1
fd_RO = pclFileOpen(0xFF, "media/mediaDB_ReadOnly.db", 1, 1);
(void)pclFileClose(fd_RO);
#endif
-
- pclDeinitLibrary();
}
END_TEST
const char* pathToBackup = "/Data/mnt-backup/lt-persistence_client_library_test/user/1/seat/1/media/mediaDB_DataRecovery.db~";
const char* pathToChecksum = "/Data/mnt-backup/lt-persistence_client_library_test/user/1/seat/1/media/mediaDB_DataRecovery.db~.crc";
+ unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
+ (void)pclInitLibrary(gTheAppId, shutdownReg);
+
// create directory, even if exist
snprintf(createPath, 128, "%s", SOURCE_PATH );
while(gPathSegemnts[i] != NULL)
X_TEST_REPORT_TYPE(GOOD);
int handle = 0;
- int ret = 0;
unsigned char buffer[READ_SIZE] = {0};
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
-
handle = pclFileOpen(0xFF, "media/mediaDB_DataRecovery.db", 1, 1);
//printf("pclFileOpen => handle: %d\n", handle);
x_fail_unless(handle != -1, "Could not open file ==> /media/mediaDB_DataRecovery.db");
- ret = pclFileReadData(handle, buffer, READ_SIZE);
+ /*ret = */(void)pclFileReadData(handle, buffer, READ_SIZE);
//printf(" ** pclFileReadData => ist-buffer : %s | size: %d\n", buffer, ret);
//printf(" ** pclFileReadData => soll-buffer: %s | size: %d\n", gWriteRecoveryTestData, strlen(gWriteRecoveryTestData));
x_fail_unless(strncmp((char*)buffer, gWriteRecoveryTestData, strlen(gWriteRecoveryTestData)) == 0, "Recovery failed");
(void)pclFileClose(handle);
-
- pclDeinitLibrary();
-
}
END_TEST
int handleArray[4] = {0};
int ret = 0;
unsigned char buffer[READ_SIZE] = {0};
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
#if 1
// test multiple handles
handleArray[0] = pclFileOpen(0xFF, "media/mediaDB_write_01.db", 1, 1);
ret = pclFileClose(19);
x_fail_unless(ret == -1, "Could close file, but should not!!");
-
#endif
- pclDeinitLibrary();
}
END_TEST
X_TEST_REPORT_TYPE(GOOD);
int hd1 = -2, hd2 = -2, hd3 = -2, hd4 = -2, hd5 = -2, hd6 = -2, hd7 = -2, hd8 = -2, hd9 = -2, ret = 0;
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
#if 1
// open handles ----------------------------------------------------
hd1 = pclKeyHandleOpen(0xFF, "posHandle/last_position1", 0, 0);
ret = pclKeyHandleClose(hd9);
x_fail_unless(ret != -1, "Failed to close handle!!");
#endif
- pclDeinitLibrary();
}
END_TEST
int ret = 0;
unsigned char buffer[READ_SIZE] = {0};
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
-
#if 1
ret = pclKeyReadData(0xFF, "secured", 0, 0, buffer, READ_SIZE);
x_fail_unless(ret == 13579, "Failed query custom data size"); // plugin should return 13579
#endif
- pclDeinitLibrary();
}
END_TEST
int ret = 0;
unsigned char buffer[READ_SIZE] = {0};
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
#if 1
ret = pclKeyReadData(0xFF, "statusHandle/default01", 3, 2, buffer, READ_SIZE);
//printf(" --- test_ReadConfDefault => statusHandle/default01: %s => retIst: %d retSoll: %d\n", buffer, ret, strlen("DEFAULT_01!"));
x_fail_unless(ret == strlen("DEFAULT_01!"), "Invalid size");
#endif
- pclDeinitLibrary();
}
END_TEST
int ret = 0;
unsigned char buffer[READ_SIZE] = {0};
-
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
#if 1
ret = pclKeyReadData(0xFF, "statusHandle/confdefault01", 3, 2, buffer, READ_SIZE);
//printf(" --- test_ReadConfDefault => statusHandle/confdefault01: %s => retIst: %d retSoll: %d\n", buffer, ret, strlen("CONF_DEFAULT_01!"));
x_fail_unless(ret == strlen("CONF_DEFAULT_02!"), "Invalid size");
#endif
- pclDeinitLibrary();
}
END_TEST
const char* thePath = "/Data/mnt-c/lt-persistence_client_library_test/user/1/seat/1/media/mediaDB_create.db";
unsigned int pathSize = 0;
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
- ret = pclInitLibrary(gTheAppId, shutdownReg);
- x_fail_unless(ret <= 1, "Failed to init PCL");
#if 1
ret = pclFileCreatePath(0xFF, "media/mediaDB_create.db", 1, 1, &path, &pathSize);
pclFileReleasePath(ret);
#endif
- pclDeinitLibrary();
}
END_TEST
{
int handle = -1, ret = 0;
int negativeHandle = -17;
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
unsigned char buffer[128] = {0};
- (void)pclInitLibrary(gTheAppId, shutdownReg);
-
handle = pclKeyHandleOpen(0xFF, "posHandle/last_position", 0, 0);
x_fail_unless(handle >= 0, "Failed to open handle ==> /posHandle/last_position");
// close handle
ret = pclKeyHandleClose(handle);
-
- pclDeinitLibrary();
}
END_TEST
START_TEST(test_utf8_string)
{
int ret = 0, size = 0;
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
const char* utf8StringBuffer = "String °^° Ñ text";
unsigned char buffer[128] = {0};
- (void)pclInitLibrary(gTheAppId, shutdownReg);
-
ret = pclKeyReadData(0xFF, "utf8String", 3, 2, buffer, READ_SIZE);
x_fail_unless(ret == strlen(utf8StringBuffer), "Wrong read size");
x_fail_unless(strncmp((char*)buffer, utf8StringBuffer, ret-1) == 0, "Buffer not correctly read => 1");
size = pclKeyGetSize(0xFF, "utf8String", 3, 2);
x_fail_unless(size == strlen(utf8StringBuffer), "Invalid size");
-
- pclDeinitLibrary();
}
END_TEST
START_TEST(test_Notifications)
{
- unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
- (void)pclInitLibrary(gTheAppId, shutdownReg);
-
pclKeyRegisterNotifyOnChange(0x20, "address/home_address", 1, 1, myChangeCallback);
pclKeyUnRegisterNotifyOnChange(0x20, "address/home_address", 1, 1, myChangeCallback);
-
- pclDeinitLibrary();
}
END_TEST
tcase_set_timeout(tc_Notifications, 2);
suite_add_tcase(s, tc_persSetData);
+ tcase_add_checked_fixture(tc_persSetData, data_setup, data_teardown);
+
suite_add_tcase(s, tc_persGetData);
+ tcase_add_checked_fixture(tc_persGetData, data_setup, data_teardown);
+
+ suite_add_tcase(s, tc_persGetDataHandle);
+ tcase_add_checked_fixture(tc_persGetDataHandle, data_setup, data_teardown);
+
suite_add_tcase(s, tc_persSetDataNoPRCT);
+ tcase_add_checked_fixture(tc_persSetDataNoPRCT, data_setup, data_teardown);
+
suite_add_tcase(s, tc_persGetDataSize);
+ tcase_add_checked_fixture(tc_persGetDataSize, data_setup, data_teardown);
+
suite_add_tcase(s, tc_persDeleteData);
- suite_add_tcase(s, tc_persGetDataHandle);
+ tcase_add_checked_fixture(tc_persDeleteData, data_setup, data_teardown);
+
suite_add_tcase(s, tc_persDataHandle);
+ tcase_add_checked_fixture(tc_persDataHandle, data_setup, data_teardown);
+
suite_add_tcase(s, tc_persDataHandleOpen);
+ tcase_add_checked_fixture(tc_persDataHandleOpen, data_setup, data_teardown);
+
suite_add_tcase(s, tc_ReadDefault);
+ tcase_add_checked_fixture(tc_ReadDefault, data_setup, data_teardown);
+
suite_add_tcase(s, tc_ReadConfDefault);
+ tcase_add_checked_fixture(tc_ReadConfDefault, data_setup, data_teardown);
suite_add_tcase(s, tc_persDataFile);
tcase_add_checked_fixture(tc_persDataFile, data_setupBlacklist, data_teardown);
suite_add_tcase(s, tc_persDataFileRecovery);
tcase_add_checked_fixture(tc_persDataFileRecovery, data_setupRecovery, data_teardown);
-
suite_add_tcase(s, tc_GetPath);
+ tcase_add_checked_fixture(tc_GetPath, data_setup, data_teardown);
+
suite_add_tcase(s, tc_NegHandle);
+ tcase_add_checked_fixture(tc_NegHandle, data_setup, data_teardown);
+
suite_add_tcase(s, tc_utf8_string);
+ tcase_add_checked_fixture(tc_utf8_string, data_setup, data_teardown);
+
suite_add_tcase(s, tc_Notifications);
+ tcase_add_checked_fixture(tc_Notifications, data_setup, data_teardown);
+
suite_add_tcase(s, tc_Plugin);
+ tcase_add_checked_fixture(tc_Plugin, data_setup, data_teardown);
suite_add_tcase(s, tc_InitDeinit);