-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: make code compatible for cppcheck (#75)
- add a CI job for it
- Loading branch information
Showing
9 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,26 @@ | ||
// Include all. | ||
#include <emio/emio.hpp> // NOLINT(misc-include-cleaner): required to parse all headers with static analysers | ||
#include <emio/emio.hpp> | ||
|
||
consteval emio::result<void> compile_time_test() { | ||
emio::static_buffer<128> buf; | ||
EMIO_TRYV(emio::format_to(buf, "abc")); | ||
return emio::format_to(buf, "abc {}", 13); | ||
} | ||
|
||
emio::result<void> test() { | ||
EMIO_TRYV(compile_time_test()); | ||
if (emio::format("abc").size() != 3) { | ||
return emio::err::invalid_data; | ||
} | ||
if (emio::format("{}", "abc").size() != 3) { | ||
return emio::err::invalid_data; | ||
} | ||
return emio::format(emio::runtime("abc {}"), 13); | ||
} | ||
|
||
int main() { | ||
if (test().has_error()) { | ||
return 1; | ||
} | ||
return 0; | ||
} |