Skip to content

Commit

Permalink
Modified DatabaseQueueTests for the new physical entities discovery o…
Browse files Browse the repository at this point in the history
…n participant discovery callback

Signed-off-by: Jesus Perez <[email protected]>
  • Loading branch information
jepemi committed Sep 13, 2023
1 parent c7582bb commit f2bdef9
Show file tree
Hide file tree
Showing 3 changed files with 1,075 additions and 999 deletions.
9 changes: 5 additions & 4 deletions src/cpp/database/database_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ EntityId DatabaseEntityQueue::process_participant(
std::shared_ptr<User> user;
std::shared_ptr<Process> process;
bool graph_updated = false;
bool new_participant_inserted = false;
bool should_link_process_participant = false;

try
{
Expand Down Expand Up @@ -114,7 +114,7 @@ EntityId DatabaseEntityQueue::process_participant(
info.app_metadata);

participant_id = database_->insert(participant);
new_participant_inserted = true;
should_link_process_participant = true;

}
else
Expand Down Expand Up @@ -193,9 +193,10 @@ EntityId DatabaseEntityQueue::process_participant(
if (!process)
{
process.reset(new Process(process_name, process_pid, user));
database_->insert(std::static_pointer_cast<Entity>(process));
process->id = database_->insert(std::static_pointer_cast<Entity>(process));
should_link_process_participant = true;
}
if (new_participant_inserted)
if (should_link_process_participant)
{
database_->link_participant_with_process(participant_id, process->id);
}
Expand Down
16 changes: 8 additions & 8 deletions test/unittest/DatabaseQueue/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ if(GTEST_FOUND AND GMOCK_FOUND)
set(DATABASEQUEUE_TEST_LIST
start_stop_flush
push_participant
push_participant_participant_exists
push_participant_no_process_exists
push_participant_no_process_exists_process_insert_throws
push_participant_no_process_no_user_exists
push_participant_no_process_no_user_exists_user_insert_throws
push_participant_no_process_no_user_no_host_exists
push_participant_no_user_no_host_exists_host_insert_throws
push_participant_data_wrong_processname_format
push_datawriter
push_datawriter_topic_does_not_exist
push_datawriter_locator_does_not_exist
Expand Down Expand Up @@ -95,14 +103,6 @@ if(GTEST_FOUND AND GMOCK_FOUND)
push_discovery_times_no_entity
push_sample_datas
push_sample_datas_no_writer
push_physical_data_no_participant_exists
push_physical_data_no_process_exists
push_physical_data_no_process_exists_process_insert_throws
push_physical_data_no_process_no_user_exists
push_physical_data_no_process_no_user_exists_user_insert_throws
push_physical_data_no_process_no_user_no_host_exists
push_physical_data_no_process_no_user_no_host_exists_host_insert_throws
push_physical_data_wrong_processname_format
)

foreach(test_name ${DATABASEQUEUE_TEST_LIST})
Expand Down
Loading

0 comments on commit f2bdef9

Please sign in to comment.