File: minunit.c

package info (click to toggle)
libhdr-histogram 0.11.8-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 796 kB
  • sloc: ansic: 5,642; cpp: 133; sh: 13; makefile: 6
file content (25 lines) | stat: -rw-r--r-- 452 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>

#include "minunit.h"

bool compare_double(double a, double b, double delta)
{
    if (fabs(a - b) < delta)
    {
        return true;
    }
    
    printf("[compare_double] fabs(%f, %f) < %f == false\n", a, b, delta);
    return false;
}

bool compare_int64(int64_t a, int64_t b)
{
    if (a == b)
    {
        return true;
    }
    
    printf("[compare_int64] %" PRIu64 " == %" PRIu64 " == false\n", a, b);
    return false;
}