Skip to content

Commit

Permalink
Added an example re: checking the version.
Browse files Browse the repository at this point in the history
  • Loading branch information
artob committed Jul 26, 2020
1 parent 1371d6b commit b5378e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ $ sudo make install

### Checking the library version

```c++
std::printf("Dogma for C++ %d.%d.%d\n",
dogma::version::major, dogma::version::minor, dogma::version::patch);
```
### Miscellaneous examples
## Reference
Expand Down
8 changes: 8 additions & 0 deletions test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@

#include <cassert> // for assert()
#include <cerrno> // for errno, EDOM
#include <cstdio> // for std::printf()
#include <cstdlib> // for EXIT_SUCCESS

using namespace dogma;

static void example_version(void) {
std::printf("Dogma for C++ %d.%d.%d\n",
dogma::version::major, dogma::version::minor, dogma::version::patch);
}

static void test_Angle_radians(void) {
assert(Angle::from_radians(0).radians() == 0);
assert(Angle::from_radians(0.5 * M_PI).radians() == 0.5 * M_PI);
Expand Down Expand Up @@ -58,6 +64,8 @@ static void test_Longitude(void) {
}

int main(void) {
example_version();

test_Angle();
test_Latitude();
test_Longitude();
Expand Down

0 comments on commit b5378e8

Please sign in to comment.