This library contains code that extends and simplifies different operations
for C language based programs.
Revisión | c415e873fee1dd34035b578510faad48ea8e692a (tree) |
---|---|
Tiempo | 2017-01-02 11:13:50 |
Autor | s.gusarov |
Commiter | s.gusarov |
Added version module
@@ -0,0 +1,22 @@ | ||
1 | +/* | |
2 | + * @author Sergey Gusarov <laborer2008 (at) gmail.com> | |
3 | + * @section LICENSE | |
4 | + * This Source Code Form is subject to the terms of the Mozilla Public | |
5 | + * License, v. 2.0. If a copy of the MPL was not distributed with this | |
6 | + * file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
7 | + * | |
8 | + * @section DESCRIPTION | |
9 | + * | |
10 | + */ | |
11 | + | |
12 | +#pragma once | |
13 | + | |
14 | +#include "ctools/stringify.h" | |
15 | + | |
16 | +#ifdef CT_VER_STR_DOT | |
17 | +# error CT_VER_STR_DOT must be undefined | |
18 | +#endif | |
19 | + | |
20 | + | |
21 | +#define CT_VER_STR_DOT(hi, lo, build)\ | |
22 | + CT_STRINGIFY(hi) "." CT_STRINGIFY(lo) "." CT_STRINGIFY(build) |
@@ -0,0 +1,36 @@ | ||
1 | +/* | |
2 | + * @author Sergey Gusarov <laborer2008 (at) gmail.com> | |
3 | + * @section LICENSE | |
4 | + * This Source Code Form is subject to the terms of the Mozilla Public | |
5 | + * License, v. 2.0. If a copy of the MPL was not distributed with this | |
6 | + * file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
7 | + * | |
8 | + * @section DESCRIPTION | |
9 | + * | |
10 | + */ | |
11 | + | |
12 | +#include "tests/unity_headers.h" | |
13 | + | |
14 | +#include <ctools/predef/external_headers.h> | |
15 | + | |
16 | +CT_BEGIN_EXTERNAL_HEADERS | |
17 | +# include <string.h> | |
18 | +CT_END_EXTERNAL_HEADERS | |
19 | + | |
20 | +#include <ctools/version.h> | |
21 | + | |
22 | + | |
23 | +void setUp(void) | |
24 | +{ | |
25 | +} | |
26 | + | |
27 | +void tearDown(void) | |
28 | +{ | |
29 | +} | |
30 | + | |
31 | +void testCompile(void) | |
32 | +{ | |
33 | + const char* const kVersion = CT_VER_STR_DOT(0, 1, 20); | |
34 | + | |
35 | + TEST_ASSERT_TRUE(strcmp(kVersion, "0.1.20") == 0); | |
36 | +} |