Changeset 7a9ef81 in mainline


Ignore:
Timestamp:
2014-12-16T21:54:56Z (9 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
26cf7a6
Parents:
f892ed3b
Message:

make the float2 test more informative

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/float/float2.c

    rf892ed3b r7a9ef81  
    5757const char *test_float2(void)
    5858{
     59        bool fail = false;
     60       
    5961        for (unsigned int i = 0; i < OPERANDS; i++) {
    6062                double res = trunc(arguments[i]);
     
    6365               
    6466                if (res_int != corr_int) {
    65                         TPRINTF("Double truncation failed (%" PRId64 " != %" PRId64 ")\n",
    66                             res_int, corr_int);
    67                         return "Double truncation failed";
     67                        TPRINTF("Double truncation failed (%" PRId64 " != %" PRId64
     68                            ", arg %u)\n", res_int, corr_int, i);
     69                        fail = true;
    6870                }
    6971        }
     
    7577               
    7678                if (res_int != corr_int) {
    77                         TPRINTF("Double sine failed (%" PRId64 " != %" PRId64 ")\n",
    78                             res_int, corr_int);
    79                         return "Double sine failed";
     79                        TPRINTF("Double sine failed (%" PRId64 " != %" PRId64
     80                            ", arg %u)\n", res_int, corr_int, i);
     81                        fail = true;
    8082                }
    8183        }
     
    8789               
    8890                if (res_int != corr_int) {
    89                         TPRINTF("Double cosine failed (%" PRId64 " != %" PRId64 ")\n",
    90                             res_int, corr_int);
    91                         return "Double cosine failed";
     91                        TPRINTF("Double cosine failed (%" PRId64 " != %" PRId64
     92                            ", arg %u)\n", res_int, corr_int, i);
     93                        fail = true;
    9294                }
    9395        }
    9496       
     97        if (fail)
     98                return "Floating point imprecision";
     99       
    95100        return NULL;
    96101}
Note: See TracChangeset for help on using the changeset viewer.