PhoenixSwarm  6.1.0
Persistent processing programs exchanging data over sockets
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1/***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : LGPL-3.0-only
5****************************************/
6
7#include "Shadok.h"
8
10
14bool checkShadokEquality(Shadok & var, Shadok & reference){
15 bool b(true);
16 b &= var.getAge() == reference.getAge();
17 return b;
18}
19
21
25bool checkShadokEqualityConst(const Shadok & var, const Shadok & reference){
26 bool b(true);
27 b &= var.getAge() == reference.getAge();
28 return b;
29}
30
33 Shadok reference;
34 //Let's use the setters
35 reference.setAge(42);
36 Shadok varCopy(reference);
37 Shadok varEqual;
38 varEqual = reference;
39 bool b(true);
40 b &= checkShadokEquality(varCopy, reference);
41 b &= checkShadokEqualityConst(varCopy, reference);
42 b &= checkShadokEquality(varEqual, reference);
43 b &= checkShadokEqualityConst(varEqual, reference);
44 b &= phoenix_getTypeToStr<Shadok>() == "Shadok";
45 return b;
46}
47
48int main(int argc, char ** argv){
49 bool b(checkShadokCopy());
50 return b - 1;
51}
int main(int argc, char **argv)
Definition main.cpp:21
bool checkShadokCopy()
Check copy of class Shadok.
Definition main.cpp:32
bool checkShadokEqualityConst(const Shadok &var, const Shadok &reference)
Check the equality between two Shadok classes.
Definition main.cpp:25
bool checkShadokEquality(Shadok &var, Shadok &reference)
Check the equality between two Shadok classes.
Definition main.cpp:14
Test Shadok.
Definition Shadok.h:15
void setAge(int age)
Sets the age of the Shadok.
Definition Shadok.cpp:47
int getAge() const
Gets the age of the Shadok.
Definition Shadok.cpp:61