MCPcopy Create free account
hub / github.com/COVESA/vsomeip / TEST

Function TEST

test/unit_tests/security_tests/ut_load.cpp:16–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16TEST(load, No_element) {
17 // Test object path
18 std::unique_ptr<vsomeip_v3::policy_manager_impl> its_manager(new vsomeip_v3::policy_manager_impl);
19
20 // Set element
21 std::vector<vsomeip_v3::configuration_element> empty_element = {}; // elements
22 std::vector<vsomeip_v3::configuration_element> full_element = {};
23
24 // Check element and full element size init =zero
25 ASSERT_TRUE(empty_element.size() == 0) << " Initial element size is not zero";
26 ASSERT_TRUE(full_element.size() == 0) << " Initial full element size is not zero";
27
28 // After load try again and check size
29 std::set<std::string> its_failed;
30 std::vector<std::string> dir_skip;
31 utility::read_data(utility::get_all_files_in_dir(utility::get_policies_path(), dir_skip), full_element,
32 its_failed); // check if this is load without for cicle
33
34 // Load each e into policy_elements
35 for (const auto& e : full_element) {
36 its_manager->load(e, false); // for each e in policy_elements vector load e
37 };
38
39 // Check size of full_element after load >0
40 ASSERT_TRUE(full_element.size() > 0) << "Full element size is zero after load, should be >0 since policy was loaded";
41
42 // Compare full element greater than element
43 ASSERT_GT(full_element.size(), empty_element.size()) << "Full element is not greater than unit element";
44}
45
46TEST(load, _lazy_load) {
47 // Test object path

Callers

nothing calls this directly

Calls 5

read_dataFunction · 0.85
is_auditMethod · 0.80
sizeMethod · 0.45
loadMethod · 0.45
is_enabledMethod · 0.45

Tested by

no test coverage detected