MCPcopy Create free account
hub / github.com/apache/cloudberry / assert_equals_range_base

Function assert_equals_range_base

gpcontrib/orafce/plunit.c:288–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288static bool
289assert_equals_range_base(FunctionCallInfo fcinfo)
290{
291 float8 expected_value;
292 float8 actual_value;
293 float8 range_value;
294
295 range_value = PG_GETARG_FLOAT8(2);
296 if (range_value < 0)
297 ereport(ERROR,
298 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
299 errmsg("cannot set range to negative number")));
300
301 expected_value = PG_GETARG_FLOAT8(0);
302 actual_value = PG_GETARG_FLOAT8(1);
303
304 return fabs(expected_value - actual_value) < range_value;
305}
306
307Datum
308plunit_assert_equals_range_message(PG_FUNCTION_ARGS)

Calls 2

errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected