We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e323378 commit 2b7c6e3Copy full SHA for 2b7c6e3
SampleProjects/TestSomething/test/clientServer.cpp
@@ -20,10 +20,13 @@ unittest(Client) {
20
}
21
22
unittest(Client_copy_constructor) {
23
- Client client1;
24
- Client client2;
25
- client2 = client1;
26
- assertTrue(true);
+ { // Client object contains a reference to a String object
+ Client c1; // Constructor instantiates a String (s1)
+ Client c2; // Constructor instantiates a String (s2)
+ c2 = c1; // Does c2 get a reference to s1 or a copy of it?
27
+ } // End of scope calls destructor on c1 and c2
28
+ assertTrue(true); // Was s1 deleted once (with c1) or twice (also with c2)?
29
+ // Was s2 deleted at all (should be during assignment)?
30
31
32
unittest(IPAddress) {
0 commit comments