Changeset 00e3ad2 in mainline


Ignore:
Timestamp:
2012-11-24T12:11:46Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a9f730a
Parents:
2f33fbc
Message:

Make it clear that the test templates are for binary operators.

File:
1 edited

Legend:

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

    r2f33fbc r00e3ad2  
    4444
    4545typedef int32_t cmptype_t;
    46 typedef void (* float_op_t)(float, float, float *, float_t *);
    47 typedef void (* double_op_t)(double, double, double *, double_t *);
     46typedef void (* float_binary_op_t)(float, float, float *, float_t *);
     47typedef void (* double_binary_op_t)(double, double, double *, double_t *);
    4848typedef void (* double_cmp_op_t)(double, double, cmptype_t *, cmptype_t *);
    49 typedef void (* template_t)(void *, unsigned, unsigned, cmptype_t *,
     49typedef void (* template_binary_t)(void *, unsigned, unsigned, cmptype_t *,
    5050    cmptype_t *);
    5151
     
    8181
    8282static void
    83 float_template(void *f, unsigned i, unsigned j, cmptype_t *pic,
     83float_template_binary(void *f, unsigned i, unsigned j, cmptype_t *pic,
    8484    cmptype_t *pisc)
    8585{
     
    8787        float_t sc;
    8888
    89         float_op_t op = (float_op_t) f;
     89        float_binary_op_t op = (float_binary_op_t) f;
    9090       
    9191        op(fop_a[i], fop_b[j], &c, &sc);
     
    9696
    9797static void
    98 double_template(void *f, unsigned i, unsigned j, cmptype_t *pic,
     98double_template_binary(void *f, unsigned i, unsigned j, cmptype_t *pic,
    9999    cmptype_t *pisc)
    100100{
     
    102102        double_t sc;
    103103
    104         double_op_t op = (double_op_t) f;
     104        double_binary_op_t op = (double_binary_op_t) f;
    105105       
    106106        op(dop_a[i], dop_b[j], &c, &sc);
     
    119119}
    120120
    121 static bool test_template(template_t template, void *f)
     121static bool test_template_binary(template_binary_t template, void *f)
    122122{
    123123        bool correct = true;
     
    267267        const char *err = NULL;
    268268
    269         if (!test_template(float_template, float_add_operator)) {
     269        if (!test_template_binary(float_template_binary, float_add_operator)) {
    270270                err = "Float addition failed";
    271271                TPRINTF("%s\n", err);
    272272        }
    273         if (!test_template(float_template, float_mul_operator)) {
     273        if (!test_template_binary(float_template_binary, float_mul_operator)) {
    274274                err = "Float multiplication failed";
    275275                TPRINTF("%s\n", err);
    276276        }
    277         if (!test_template(float_template, float_div_operator)) {
     277        if (!test_template_binary(float_template_binary, float_div_operator)) {
    278278                err = "Float division failed";
    279279                TPRINTF("%s\n", err);
    280280        }
    281         if (!test_template(double_template, double_add_operator)) {
     281        if (!test_template_binary(double_template_binary, double_add_operator)) {
    282282                err = "Double addition failed";
    283283                TPRINTF("%s\n", err);
    284284        }
    285         if (!test_template(double_template, double_mul_operator)) {
     285        if (!test_template_binary(double_template_binary, double_mul_operator)) {
    286286                err = "Double multiplication failed";
    287287                TPRINTF("%s\n", err);
    288288        }
    289         if (!test_template(double_template, double_div_operator)) {
     289        if (!test_template_binary(double_template_binary, double_div_operator)) {
    290290                err = "Double division failed";
    291291                TPRINTF("%s\n", err);
    292292        }
    293         if (!test_template(double_compare_template, double_cmp_operator)) {
     293        if (!test_template_binary(double_compare_template, double_cmp_operator)) {
    294294                err = "Double comparison failed";
    295295                TPRINTF("%s\n", err);
Note: See TracChangeset for help on using the changeset viewer.