-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from kenluobo/add_source_location_test_case
Add source location test case
- Loading branch information
Showing
8 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "utils/test.hpp" | ||
|
||
#include <cstdarg> | ||
|
||
//=========================================================== | ||
void out_args(const char *msg, ...) { | ||
va_list args; | ||
printf("%s\n", msg); | ||
|
||
va_start(args, msg); | ||
char *curr = NULL; | ||
while (NULL != (curr = va_arg(args, char *))) { | ||
printf("%s\n", curr); | ||
} | ||
va_end(args); | ||
} | ||
|
||
void test_va_args() { out_args("hello", "world", "!"); } | ||
|
||
//=========================================================== | ||
void test() { TEST(test_va_args); } | ||
|
||
//=========================================================== | ||
int main() { test(); } |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "utils/test.hpp" | ||
// #include <source_location> | ||
#include <experimental/source_location> | ||
|
||
//===================================================== | ||
void test_source_location_1(const std::experimental::source_location src_loc = | ||
std::experimental::source_location::current()) { | ||
out("filename: ", src_loc.file_name()); | ||
out("function name: ", src_loc.function_name()); | ||
out("line: ", src_loc.line()); | ||
out("column: ", src_loc.column()); | ||
} | ||
|
||
void test_source_location_2() { | ||
auto src_loc = std::experimental::source_location::current(); | ||
out("filename: ", src_loc.file_name()); | ||
out("function name: ", src_loc.function_name()); | ||
out("line: ", src_loc.line()); | ||
out("column: ", src_loc.column()); | ||
} | ||
|
||
//===================================================== | ||
void test() { | ||
TEST(test_source_location_1); | ||
TEST(test_source_location_2); | ||
} | ||
|
||
//===================================================== | ||
int main() { test(); } |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "utils/test.hpp" | ||
|
||
#include <experimental/compare> | ||
|
||
/= == == == == == == == == == == == == == == == == == == == == == == == == == == | ||
void test_compare(){ | ||
|
||
} | ||
|
||
/= == == == == == == == == == == == == == == == == == == == == == == == == == == | ||
void test(){ | ||
// todo | ||
} | ||
|
||
/= == == == == == == == == == == == == == == == == == == == == == == == == == == | ||
int main() { | ||
test(); | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.