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

Function assert_get_message

gpcontrib/orafce/plunit.c:197–219  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

195 *
196 ****************************************************************/
197static char *
198assert_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
222static bool

Calls 4

text_to_cstringFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50
errdetailFunction · 0.50

Tested by

no test coverage detected