* plunit.assert_equals * plunit.assert_equals_message * plunit.assert_equals_range * plunit.assert_equals_range_message * * Syntax: * PROCEDURE assert_equals(expected anyelement,actual anyelement, * message varchar default ''); * PROCEDURE assert_equals(expected double precision, actual double precision, * range double precision, mes
| 195 | * |
| 196 | ****************************************************************/ |
| 197 | static char * |
| 198 | assert_get_message(FunctionCallInfo fcinfo, int nargs, char *message) |
| 199 | { |
| 200 | char *result; |
| 201 | |
| 202 | if (PG_NARGS() == nargs) |
| 203 | { |
| 204 | text *msg; |
| 205 | |
| 206 | if (PG_ARGISNULL(nargs - 1)) |
| 207 | ereport(ERROR, |
| 208 | (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), |
| 209 | errmsg("message is NULL"), |
| 210 | errdetail("Message may not be NULL."))); |
| 211 | |
| 212 | msg = PG_GETARG_TEXT_P(nargs - 1); |
| 213 | result = text_to_cstring(msg); |
| 214 | } |
| 215 | else |
| 216 | result = message; |
| 217 | |
| 218 | return result; |
| 219 | } |
| 220 | |
| 221 | |
| 222 | static bool |
no test coverage detected