| 13 | }; |
| 14 | |
| 15 | struct Greeting |
| 16 | { |
| 17 | Nationality nationality; |
| 18 | explicit Greeting() : nationality(British) |
| 19 | { |
| 20 | } |
| 21 | |
| 22 | explicit Greeting(Nationality nationality_) : nationality(nationality_) |
| 23 | { |
| 24 | } |
| 25 | |
| 26 | std::string getGreeting() const |
| 27 | { |
| 28 | return getGreetingFor(nationality); |
| 29 | } |
| 30 | |
| 31 | std::string getGreetingFor(Nationality aNationality) const |
| 32 | { |
| 33 | switch (aNationality) |
| 34 | { |
| 35 | case British: |
| 36 | return "Cheers"; |
| 37 | case American: |
| 38 | return "Howdy"; |
| 39 | case French: |
| 40 | return "Bonjour"; |
| 41 | default: |
| 42 | return "Unknown"; |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | std::string getNationality() const |
| 47 | { |
| 48 | switch (nationality) |
| 49 | { |
| 50 | case British: |
| 51 | return "British"; |
| 52 | case American: |
| 53 | return "American"; |
| 54 | case French: |
| 55 | return "French"; |
| 56 | default: |
| 57 | return "Unknown"; |
| 58 | } |
| 59 | } |
| 60 | }; |
| 61 | |
| 62 | // begin-snippet: doctest_multiple_output_files_hard_coded |
| 63 | TEST_CASE("MultipleOutputFiles-ForOneObject") |
no outgoing calls
no test coverage detected