File: test_I_abs.cc

package info (click to toggle)
cln 1.3.7-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,996 kB
  • sloc: cpp: 80,860; sh: 5,138; ansic: 3,174; makefile: 1,274
file content (13 lines) | stat: -rw-r--r-- 227 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "test_I.h"

int test_I_abs (int iterations)
{
	int error = 0;
	int i;
	// Check against "-".
	for (i = iterations; i > 0; i--) {
		cl_I a = testrandom_I();
		ASSERT1(abs(a) == (a < 0 ? -a : a), a);
	}
	return error;
}