| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Auteur : Pierre Aubert | ||
| 3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
| 4 | Licence : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | #include "AbstractDataFunction.h" | ||
| 8 | #include "FunctionCall.h" | ||
| 9 | #include "phoenix_assert.h" | ||
| 10 | |||
| 11 | ///@brief test function | ||
| 12 | class TestDataFunction : public AbstractDataFunction{ | ||
| 13 | public: | ||
| 14 | 1 | TestDataFunction(const PString& name) | |
| 15 | 1 | :AbstractDataFunction(name){} | |
| 16 | |||
| 17 | ///Call of the function | ||
| 18 | 1 | virtual bool call(PLog&, const Data&) override { return true; } | |
| 19 | }; | ||
| 20 | |||
| 21 | 1 | int main(int argc, char ** argv){ | |
| 22 |
2/2✓ Branch 0 (2→3) taken 1 times.
✓ Branch 2 (3→4) taken 1 times.
|
1 | TestDataFunction function("initialName"); |
| 23 |
1/1✓ Branch 0 (5→6) taken 1 times.
|
1 | PLog log; |
| 24 |
1/1✓ Branch 0 (6→7) taken 1 times.
|
1 | Data data; |
| 25 | 1 | function.call(log, data); | |
| 26 | // Test the setName and getName methods | ||
| 27 |
2/2✓ Branch 0 (8→9) taken 1 times.
✓ Branch 2 (9→10) taken 1 times.
|
1 | function.setName("testFunction"); |
| 28 |
6/6✓ Branch 0 (13→14) taken 1 times.
✓ Branch 2 (16→17) taken 1 times.
✓ Branch 4 (19→20) taken 1 times.
✓ Branch 6 (20→21) taken 1 times.
✓ Branch 8 (21→22) taken 1 times.
✓ Branch 10 (22→23) taken 1 times.
|
5 | phoenix_assert(function.getName() == "testFunction"); |
| 29 | 1 | return 0; | |
| 30 | 1 | } | |
| 31 |