| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Author : Thibaut Oprinsen | ||
| 3 | Mail : thibaut.oprinsen@lapp.in2p3.fr | ||
| 4 | License : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | #include <iostream> | ||
| 8 | #include <fstream> | ||
| 9 | #include "phoenix_assert.h" | ||
| 10 | |||
| 11 | #include "CppTraitSetter.h" | ||
| 12 | #include "CppTraitGetter.h" | ||
| 13 | #include "CppTraitCopy.h" | ||
| 14 | #include "CppTraitTypeStream.h" | ||
| 15 | #include "CppTraitDataStream.h" | ||
| 16 | #include "CppTraitConfigStream.h" | ||
| 17 | #include "CppTraitCheckStream.h" | ||
| 18 | |||
| 19 | #include "generator_class_cpp.h" | ||
| 20 | |||
| 21 | ///Test the C++ Trait | ||
| 22 | 1 | void testCppTrait(){ | |
| 23 | |||
| 24 |
1/1✓ Branch 0 (2→3) taken 1 times.
|
1 | PClassConfig classConfig; |
| 25 |
2/2✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
|
1 | classConfig.setClassDocumentation("///@brief Test class Shadok"); |
| 26 |
2/2✓ Branch 0 (6→7) taken 1 times.
✓ Branch 2 (7→8) taken 1 times.
|
1 | classConfig.setName("Shadok"); |
| 27 |
5/5✓ Branch 0 (9→10) taken 1 times.
✓ Branch 2 (10→11) taken 1 times.
✓ Branch 4 (11→12) taken 1 times.
✓ Branch 6 (12→13) taken 1 times.
✓ Branch 8 (13→14) taken 1 times.
|
1 | classConfig.addAttribute(createClassAttribute("int", "age", "///Age of the Shadok")); |
| 28 |
5/5✓ Branch 0 (18→19) taken 1 times.
✓ Branch 2 (19→20) taken 1 times.
✓ Branch 4 (20→21) taken 1 times.
✓ Branch 6 (21→22) taken 1 times.
✓ Branch 8 (22→23) taken 1 times.
|
1 | classConfig.addAttribute(createClassAttribute("std::string", "name", "///Name of the Shadok")); |
| 29 | 1 | std::vector<PClassConfig> vecClassConfig; | |
| 30 |
1/1✓ Branch 0 (28→29) taken 1 times.
|
1 | vecClassConfig.push_back(classConfig); |
| 31 | |||
| 32 |
1/1✓ Branch 0 (29→30) taken 1 times.
|
1 | GeneratorMode mode; |
| 33 | 1 | mode.enableSetter = true; | |
| 34 | 1 | mode.enableGetter = true; | |
| 35 | 1 | mode.enableCopy = true; | |
| 36 | 1 | mode.enableTypeStream = true; | |
| 37 | 1 | mode.enableDataStream = true; | |
| 38 | 1 | mode.enableConfigStream = true; | |
| 39 | 1 | mode.enableCheckStream = true; | |
| 40 | |||
| 41 |
1/1✓ Branch 0 (30→31) taken 1 times.
|
1 | PTraitBackendManager manager; |
| 42 |
1/1✓ Branch 0 (31→32) taken 1 times.
|
1 | manager.addTraitBackend<CppTraitCopy>(); |
| 43 |
1/1✓ Branch 0 (32→33) taken 1 times.
|
1 | manager.addTraitBackend<CppTraitSetter>(); |
| 44 |
1/1✓ Branch 0 (33→34) taken 1 times.
|
1 | manager.addTraitBackend<CppTraitGetter>(); |
| 45 |
1/1✓ Branch 0 (34→35) taken 1 times.
|
1 | manager.addTraitBackend<CppTraitTypeStream>(); |
| 46 |
1/1✓ Branch 0 (35→36) taken 1 times.
|
1 | manager.addTraitBackend<CppTraitDataStream>(); |
| 47 |
1/1✓ Branch 0 (36→37) taken 1 times.
|
1 | manager.addTraitBackend<CppTraitConfigStream>(); |
| 48 |
1/1✓ Branch 0 (37→38) taken 1 times.
|
1 | manager.addTraitBackend<CppTraitCheckStream>(); |
| 49 | |||
| 50 |
9/9✓ Branch 0 (40→41) taken 1 times.
✓ Branch 2 (43→44) taken 1 times.
✓ Branch 4 (46→47) taken 1 times.
✓ Branch 6 (48→49) taken 1 times.
✓ Branch 8 (49→50) taken 1 times.
✓ Branch 10 (50→51) taken 1 times.
✓ Branch 12 (51→52) taken 1 times.
✓ Branch 14 (52→53) taken 1 times.
✓ Branch 16 (53→54) taken 1 times.
|
5 | phoenix_assert(generator_class_cpp(manager, vecClassConfig, PPath("./"), PPath("Shadok"), mode, PVecPath())); |
| 51 | 1 | } | |
| 52 | |||
| 53 | |||
| 54 | 1 | int main(int argc, char ** argv){ | |
| 55 | 1 | testCppTrait(); | |
| 56 | 1 | return 0; | |
| 57 | } | ||
| 58 |