aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/test/all_SUITE_data/ei_runner.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/erl_interface/test/all_SUITE_data/ei_runner.c')
-rw-r--r--lib/erl_interface/test/all_SUITE_data/ei_runner.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/erl_interface/test/all_SUITE_data/ei_runner.c b/lib/erl_interface/test/all_SUITE_data/ei_runner.c
index 92d01f1753..cd7a67c57c 100644
--- a/lib/erl_interface/test/all_SUITE_data/ei_runner.c
+++ b/lib/erl_interface/test/all_SUITE_data/ei_runner.c
@@ -198,8 +198,8 @@ void free_packet(char* packet)
* ----- ----------------------------
* [$b|Bytes] {bytes, Bytes}
* [$e] eot
- * [$f] test_server:fail()
- * [$f|Reason] test_server:fail(Reason)
+ * [$f] ct:fail()
+ * [$f|Reason] ct:fail(Reason)
* [$t|EncodedTerm] {term, Term}
* [$N] 'NULL'
* [$m|Message] io:format("~s", [Message]) (otherwise ignored)
@@ -211,7 +211,7 @@ void free_packet(char* packet)
* you implement a test case entirely in C code.
*
* If the ok argument is zero, a [$f] reply will be sent to the
- * Erlang side (causing test_server:fail() to be called); otherwise,
+ * Erlang side (causing ct:fail() to be called); otherwise,
* the atom 'eot' will be sent to Erlang.
*
* If you need to provide more details on a failure, use the fail() function.
@@ -251,16 +251,21 @@ do_report(file, line, ok)
/*
- * This function causes a call to test_server:fail(Reason) on the
+ * This function causes a call to ct:fail(Reason) on the
* Erlang side.
*/
-void do_fail(char* file, int line, char* reason)
+void do_fail(const char* file, int line, const char* reason, ...)
{
+ va_list ap;
char sbuf[2048];
+ char* sp = sbuf;
- sbuf[0] = 'f';
- sprintf(sbuf+1, "%s, line %d: %s", file, line, reason);
+ *sp++ = 'f';
+ sp += sprintf(sp, "%s, line %d: ", file, line);
+ va_start(ap, reason);
+ sp += vsprintf(sp, reason, ap);
+ va_end(ap);
reply(sbuf, 1+strlen(sbuf+1));
}