Changeset 3bacee1 in mainline for uspace/lib/posix/test/scanf.c


Ignore:
Timestamp:
2018-04-12T16:27:17Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3cf22f9
Parents:
76d0981d
git-author:
Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
git-committer:
Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
Message:

Make ccheck-fix again and commit more good files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/test/scanf.c

    r76d0981d r3bacee1  
    4949 */
    5050
    51 PCUT_TEST(int_decimal) {
     51PCUT_TEST(int_decimal)
     52{
    5253        int number;
    5354        int rc = sscanf("4242", "%d", &number);
     
    5657}
    5758
    58 PCUT_TEST(int_negative_decimal) {
     59PCUT_TEST(int_negative_decimal)
     60{
    5961        int number;
    6062        int rc = sscanf("-53", "%d", &number);
     
    6971 */
    7072
    71 PCUT_TEST(int_misc) {
     73PCUT_TEST(int_misc)
     74{
    7275        unsigned char uhh;
    7376        signed char shh;
     
    8386
    8487        int rc = sscanf(
    85                 "\n j tt % \t -121314 98765 aqw 0765 0x77 0xABCDEF88 -99 884",
    86                 " j tt %%%3hhd%1hhu%3hd %3hu%u aqw%n %lo%llx %p %li %lld",
    87                 &shh, &uhh, &sh, &uh, &udef, &sdef, &ul, &ull, &p, &sl, &sll);
     88            "\n j tt % \t -121314 98765 aqw 0765 0x77 0xABCDEF88 -99 884",
     89            " j tt %%%3hhd%1hhu%3hd %3hu%u aqw%n %lo%llx %p %li %lld",
     90            &shh, &uhh, &sh, &uh, &udef, &sdef, &ul, &ull, &p, &sl, &sll);
    8891
    8992        PCUT_ASSERT_INT_EQUALS(10, rc);
     
    102105}
    103106
    104 PCUT_TEST(double_misc) {
     107PCUT_TEST(double_misc)
     108{
    105109        float f;
    106110        double d;
     
    108112
    109113        int rc = sscanf(
    110                 "\n \t\t1.0 -0x555.AP10 1234.5678e12",
    111                 "%f %lf %Lf",
    112                 &f, &d, &ld);
     114            "\n \t\t1.0 -0x555.AP10 1234.5678e12",
     115            "%f %lf %Lf",
     116            &f, &d, &ld);
    113117
    114118        PCUT_ASSERT_INT_EQUALS(3, rc);
     
    119123}
    120124
    121 PCUT_TEST(str_misc) {
     125PCUT_TEST(str_misc)
     126{
    122127        char str[20];
    123128        char *pstr;
    124129
    125130        int rc = sscanf(
    126                 "\n\n\thello world    \n",
    127                 "%5s %ms",
    128                 str, &pstr);
     131            "\n\n\thello world    \n",
     132            "%5s %ms",
     133            str, &pstr);
    129134
    130135        PCUT_ASSERT_INT_EQUALS(2, rc);
     
    136141}
    137142
    138 PCUT_TEST(str_matchers) {
     143PCUT_TEST(str_matchers)
     144{
    139145        char scanset[20];
    140146        char *pscanset;
    141147
    142148        int rc = sscanf(
    143                 "\n\n\th-e-l-l-o world-]    \n",
    144                 " %9[-eh-o] %m[^]-]",
    145                 scanset, &pscanset);
     149            "\n\n\th-e-l-l-o world-]    \n",
     150            " %9[-eh-o] %m[^]-]",
     151            scanset, &pscanset);
    146152
    147153        PCUT_ASSERT_INT_EQUALS(2, rc);
     
    153159}
    154160
    155 PCUT_TEST(char_misc) {
     161PCUT_TEST(char_misc)
     162{
    156163        char seq[20];
    157164        char *pseq;
    158165
    159166        int rc = sscanf(
    160                 "\n\n\thello world    \n",
    161                 " %5c %mc",
    162                 seq, &pseq);
     167            "\n\n\thello world    \n",
     168            " %5c %mc",
     169            seq, &pseq);
    163170
    164171        PCUT_ASSERT_INT_EQUALS(2, rc);
Note: See TracChangeset for help on using the changeset viewer.