Changeset 48974d6 in mainline for uspace/lib/c/test/sprintf.c
- Timestamp:
- 2018-03-26T12:46:44Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ce35f0
- Parents:
- 5a01f7d
- git-author:
- Jiri Svoboda <jiri@…> (2018-03-25 18:45:28)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-03-26 12:46:44)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/test/sprintf.c
r5a01f7d r48974d6 54 54 55 55 56 SPRINTF_TEST(no_formatting, "This is a test.", "This is a test.") 56 SPRINTF_TEST(no_formatting, "This is a test.", "This is a test."); 57 57 58 58 59 59 60 SPRINTF_TEST(string_plain, "some text", "%s", "some text") 60 SPRINTF_TEST(string_plain, "some text", "%s", "some text"); 61 61 62 SPRINTF_TEST(string_dynamic_width, " tex", "%*.*s", 5, 3, "text") 62 SPRINTF_TEST(string_dynamic_width, " tex", "%*.*s", 5, 3, "text"); 63 63 64 SPRINTF_TEST(string_dynamic_width_align_left, "text ", "%-*.*s", 7, 7, "text") 64 SPRINTF_TEST(string_dynamic_width_align_left, "text ", "%-*.*s", 7, 7, "text"); 65 65 66 SPRINTF_TEST(string_pad, " text", "%8.10s", "text") 66 SPRINTF_TEST(string_pad, " text", "%8.10s", "text"); 67 67 68 SPRINTF_TEST(string_pad_but_cut, " very lon", "%10.8s", "very long text") 68 SPRINTF_TEST(string_pad_but_cut, " very lon", "%10.8s", "very long text"); 69 69 70 70 71 71 72 SPRINTF_TEST(char_basic, "[a]", "[%c]", 'a') 72 SPRINTF_TEST(char_basic, "[a]", "[%c]", 'a'); 73 73 74 74 … … 76 76 SPRINTF_TEST(int_various_padding, "[1] [ 02] [03 ] [004] [005]", 77 77 "[%d] [%3.2d] [%-3.2d] [%2.3d] [%-2.3d]", 78 1, 2, 3, 4, 5) 78 1, 2, 3, 4, 5); 79 79 80 80 SPRINTF_TEST(int_negative_various_padding, "[-1] [-02] [-03] [-004] [-005]", 81 81 "[%d] [%3.2d] [%-3.2d] [%2.3d] [%-2.3d]", 82 -1, -2, -3, -4, -5) 82 -1, -2, -3, -4, -5); 83 83 84 84 SPRINTF_TEST(long_negative_various_padding, "[-1] [-02] [-03] [-004] [-005]", 85 85 "[%lld] [%3.2lld] [%-3.2lld] [%2.3lld] [%-2.3lld]", 86 86 (long long) -1, (long long) -2, (long long) -3, (long long) -4, 87 (long long) -5) 87 (long long) -5); 88 88 89 89 SPRINTF_TEST(int_as_hex, "[0x11] [0x012] [0x013] [0x00014] [0x00015]", 90 90 "[%#x] [%#5.3x] [%#-5.3x] [%#3.5x] [%#-3.5x]", 91 17, 18, 19, 20, 21) 91 17, 18, 19, 20, 21); 92 92 93 93
Note:
See TracChangeset
for help on using the changeset viewer.