PR: Build concept exercises + fix concept exercise that does not build

I wanted to fix issue #878, but noticed that the doctor-data exercise was not built or tested when the track was built. It turned out that this was the case for all concept exercises. I am assuming this is NOT by design.

I did the following:

  • Change the build such that it builds both “concept” and “practice” exercises.
  • Fix a concept exercise freelancer-rates that did not build.
  • Fix a typo in the text that comes with the freelancer-rates exercise.

freelancer-rates failed to build because of the following line of code:

int rounded_up{std::ceil(after_discount)};

Narrowing conversions (ceil() returns a double) are not allowed with list-initialization.

I tested the build of the track with cmake . && make on Ubuntu 22.04.

Sure it was. And I just tested it again and the exemplar solution passes all the tests (Ubuntu 22.04).

If you use a modified script from the practice exercises, to use it for the concept exercises, you might expect the working solution in the example.* files. For concept exercises, the files are named exemplar.*.

If that does not solve the problem, please post the solutions you have used to run your tests.

Ok, maybe I am missing something. Can you build freelancer-rates?

Cheers
Peter

Good catch. I had to verify that the narrowing error also shows on Ubuntu20.04, for which the track is designed. I did not have a 20.04 machine at hand until now. I’m surprised it did not come up in the GitHub Action tests.

I made a PR for the fix.

Can you look at my PR? Build concept exercises + fix concept exercise that does not build. by heijp06 · Pull Request #915 · exercism/cpp · GitHub

It explains why the GitHub Actions do not notice this.

Concept exercises are not built or tested.