GCC Code Coverage Report


Directory: ./
File: demos/non_existing_segment.cpp
Date: 2022-06-30 06:29:57
Exec Total Coverage
Lines: 0 6 0.0%
Branches: 0 14 0.0%

Line Branch Exec Source
1 /**
2 * @file non_existing_segment.cpp
3 * @author Vincent Berenz
4 * @license License BSD-3-Clause
5 * @copyright Copyright (c) 2020, New York University and Max Planck
6 * Gesellschaft.
7 * @date 2020-10-22
8 *
9 * @brief checks exceptions are throwm when
10 * reading non existing segment
11 */
12
13 #include <signal.h>
14 #include <unistd.h>
15 #include <iostream>
16 #include <vector>
17 #include "shared_memory/shared_memory.hpp"
18
19 int main()
20 {
21 std::string segment_id{"non_existing_segment_demo"};
22
23 shared_memory::clear_shared_memory(segment_id);
24
25 double value;
26 try
27 {
28 shared_memory::get<double>(segment_id, segment_id, value, false);
29 }
30 catch (const shared_memory::Non_existing_segment_exception &)
31 {
32 }
33
34 shared_memory::get<double>(segment_id, segment_id, value, true);
35 }
36