This library contains code that extends and simplifies different operations
for C language based programs.
Revisión | aa3ad582f8e4235f1326d1b28f74dc9d8d36e9a1 (tree) |
---|---|
Tiempo | 2022-08-31 06:35:39 |
Autor | Sergey Gusarov <laborer2008@gmai...> |
Commiter | Sergey Gusarov |
Implemented test_console, added more comments to the console module
@@ -51,13 +51,22 @@ | ||
51 | 51 | |
52 | 52 | CT_BEGIN_NAMESPACE |
53 | 53 | |
54 | -// Reads an integer | |
54 | +/** | |
55 | + * @brief Reads an integer from stdin | |
56 | + * @return false on error | |
57 | + */ | |
55 | 58 | extern CT_SHARED_API bool consoleGetInteger(uint* const pValue) CT_NOEXCEPT; |
56 | 59 | |
57 | -// Reads an integer and check the value | |
60 | +/** | |
61 | + * @brief Reads an integer from stdin and check the value | |
62 | + * @return false on error | |
63 | + */ | |
58 | 64 | extern CT_SHARED_API bool consoleGetIntegerMinMax(uint* const pValue, const uint min, const uint max) CT_NOEXCEPT; |
59 | 65 | |
60 | -// Reads an hexadecimal number | |
66 | +/** | |
67 | + * @brief Reads an hexadecimal number from stdin and check the value | |
68 | + * @return false on error | |
69 | + */ | |
61 | 70 | extern CT_SHARED_API bool consoleGetHexa32(uint* const pValue) CT_NOEXCEPT; |
62 | 71 | |
63 | 72 | CT_END_NAMESPACE |
@@ -12,6 +12,7 @@ | ||
12 | 12 | #include "tests/unity_headers.h" |
13 | 13 | |
14 | 14 | #include <ctools/console.h> |
15 | +#include <ctools/pointer.h> | |
15 | 16 | |
16 | 17 | |
17 | 18 | void setUp(void) |
@@ -24,4 +25,16 @@ | ||
24 | 25 | |
25 | 26 | void testCompile(void) |
26 | 27 | { |
28 | + CT_USING_CT_NAMESPACE | |
29 | + | |
30 | + bool status; | |
31 | + | |
32 | + status = consoleGetInteger(CT_NULL); | |
33 | + TEST_ASSERT_FALSE(status); | |
34 | + | |
35 | + status = consoleGetIntegerMinMax(CT_NULL, 0, 9); | |
36 | + TEST_ASSERT_FALSE(status); | |
37 | + | |
38 | + status = consoleGetHexa32(CT_NULL); | |
39 | + TEST_ASSERT_FALSE(status); | |
27 | 40 | } |