File: test_xmath.c

package info (click to toggle)
siridb-server 2.0.53-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,612 kB
  • sloc: ansic: 47,501; python: 6,263; sh: 254; makefile: 149
file content (26 lines) | stat: -rw-r--r-- 586 bytes parent folder | download | duplicates (4)
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
26
#include "../test.h"
#include <xmath/xmath.h>


int main()
{
    test_start("xmath");

    /* xmath_ipow */
    {
        _assert (xmath_ipow(1000, 0) == 1);
        _assert (xmath_ipow(1000, 1) == 1000);
        _assert (xmath_ipow(1000, 2) == 1000000);
        _assert (xmath_ipow(1000, 3) == 1000000000);
        _assert (xmath_ipow(2, 8) == 256);
    }

    /* xmath_max_size */
    {
        _assert (xmath_max_size(3, 10, 20, 30) == 30);
        _assert (xmath_max_size(3, 30, 20, 10) == 30);
        _assert (xmath_max_size(3, 10, 30, 20) == 30);
    }

    return test_end();
}