GCC Code Coverage Report


Directory: src/gate/
File: src/gate/tech/tests/gatetech_cpp_test/test_virtualization.cpp
Date: 2026-03-20 22:56:14
Exec Total Coverage
Lines: 8 31 25.8%
Functions: 3 5 60.0%
Branches: 11 185 5.9%

Line Branch Exec Source
1 #include "gate/tests.hpp"
2 #include "gate/tech/virtualization.hpp"
3
4 using namespace gate;
5 using namespace gate::tech;
6
7 static void testVirtualizationSandbox(VirtualizationSandbox& sandbox)
8 {
9 GATEXX_TEST_CHECK(sandbox.c_impl() != NULL);
10 GATEXX_TEST_CHECK(!sandbox.getId().empty());
11 GATEXX_TEST_CHECK(!sandbox.getName().empty());
12
13 Property settings;
14 GATEXX_TEST_CHECK_NOTHROW(settings = sandbox.getSettings());
15
16 enumint_t status;
17 GATEXX_TEST_CHECK_NOTHROW(status = sandbox.getStatus());
18 }
19
20 static void testVirtualizationProvider(VirtualizationProvider& prov)
21 {
22 GATEXX_TEST_CHECK(!prov.getInterfaceName().empty());
23 GATEXX_TEST_CHECK(!prov.getName().empty());
24 GATEXX_TEST_CHECK(prov.c_impl() != NULL);
25
26 Property settings;
27 GATEXX_TEST_CHECK_NOTHROW(settings = prov.getSettings());
28
29 Array<String> ids;
30 GATEXX_TEST_CHECK_NOTHROW(ids = prov.listSandboxIds());
31
32 GATEXX_ENUMERATE(String const, e, ids.enumerate())
33 {
34 String const& sandboxId = *e;
35 try
36 {
37 VirtualizationSandbox sandbox = prov.getSandbox(sandboxId);
38 testVirtualizationSandbox(sandbox);
39 }
40 catch (...)
41 {
42 }
43 }
44 }
45
46
2/7
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
6 GATEXX_TEST_UNIT(Virtualization)
47 {
48 4 Array<VirtualizationProvider::Info> infos;
49
50
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(infos = VirtualizationProvider::list());
51
52
2/2
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 1 times.
4 GATEXX_ENUMERATE(VirtualizationProvider::Info const, e, infos.enumerate())
53 {
54
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 VirtualizationProvider::Info const& info = *e;
55
56 try
57 {
58
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
2 VirtualizationProvider prov = VirtualizationProvider::create(info.Name);
59 testVirtualizationProvider(prov);
60 }
61
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 catch (...)
62 {
63 }
64
65 }
66 2 }
67