summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2013-07-27 23:11:02 +0000
committerKinsey Moore <kmoore@digium.com>2013-07-27 23:11:02 +0000
commitd8956f690e7fe2d3b7799c16d0d44bbcbe25d83f (patch)
tree437bcde14739627193195953a5f8742eaa216333 /tests
parentfc05248bd1158d587d2339c56ed27be57d333d86 (diff)
Rename everything Stasis-HTTP to ARI
This renames all files and API calls from several variants of Stasis-HTTP to ARI including: * Stasis-HTTP -> ARI * STASIS_HTTP -> ARI * stasis_http -> ari (ast_ari for global symbols, file names as well) * stasis http -> ARI Review: https://reviewboard.asterisk.org/r/2706/ (closes issue ASTERISK-22136) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'tests')
-rw-r--r--tests/test_ari.c (renamed from tests/test_stasis_http.c)108
-rw-r--r--tests/test_ari_model.c80
2 files changed, 94 insertions, 94 deletions
diff --git a/tests/test_stasis_http.c b/tests/test_ari.c
index 68bc4e7b7..f984c3d2d 100644
--- a/tests/test_stasis_http.c
+++ b/tests/test_ari.c
@@ -17,7 +17,7 @@
*/
/*!
- * \file \brief Test Stasis HTTP API.
+ * \file \brief Test ARI API.
* \author\verbatim David M. Lee, II <dlee@digium.com> \endverbatim
*
* \ingroup tests
@@ -25,7 +25,7 @@
/*** MODULEINFO
<depend>TEST_FRAMEWORK</depend>
- <depend>res_stasis_http</depend>
+ <depend>res_ari</depend>
<support_level>core</support_level>
***/
@@ -35,7 +35,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/module.h"
#include "asterisk/test.h"
-#include "asterisk/stasis_http.h"
+#include "asterisk/ari.h"
/*!@{*/
@@ -62,7 +62,7 @@ static void handler(const char *name,
struct ast_variable *get_params,
struct ast_variable *path_vars,
struct ast_variable *headers,
- struct stasis_http_response *response)
+ struct ast_ari_response *response)
{
struct ast_json *message = ast_json_pack("{s: s, s: {}, s: {}, s: {}}",
"name", name,
@@ -98,7 +98,7 @@ static void handler(const char *name,
static void name(struct ast_variable *get_params, \
struct ast_variable *path_vars, \
struct ast_variable *headers, \
- struct stasis_http_response *response) \
+ struct ast_ari_response *response) \
{ \
handler(#name, response_code, get_params, path_vars, headers, response); \
}
@@ -149,20 +149,20 @@ static struct stasis_rest_handlers test_root = {
/*!
* \internal
- * \c stasis_http_response constructor.
+ * \c ast_ari_response constructor.
*/
-static struct stasis_http_response *response_alloc(void)
+static struct ast_ari_response *response_alloc(void)
{
- struct stasis_http_response *resp = ast_calloc(1, sizeof(struct stasis_http_response));
+ struct ast_ari_response *resp = ast_calloc(1, sizeof(struct ast_ari_response));
resp->headers = ast_str_create(24);
return resp;
}
/*!
* \internal
- * \c stasis_http_response destructor.
+ * \c ast_ari_response destructor.
*/
-static void response_free(struct stasis_http_response *resp)
+static void response_free(struct ast_ari_response *resp)
{
if (!resp) {
return;
@@ -179,7 +179,7 @@ static void response_free(struct stasis_http_response *resp)
static void *setup_invocation_test(void) {
int r;
invocation_count = 0;
- r = stasis_http_add_handler(&test_root);
+ r = ast_ari_add_handler(&test_root);
ast_assert(r == 0);
return &invocation_count;
}
@@ -192,13 +192,13 @@ static void tear_down_invocation_test(void *ignore) {
if (!ignore) {
return;
}
- stasis_http_remove_handler(&test_root);
+ ast_ari_remove_handler(&test_root);
}
AST_TEST_DEFINE(get_docs)
{
- RAII_VAR(struct stasis_http_response *, response, NULL, response_free);
+ RAII_VAR(struct ast_ari_response *, response, NULL, response_free);
RAII_VAR(struct ast_variable *, headers, NULL, ast_variables_destroy);
struct ast_json *basePathJson;
const char *basePath;
@@ -206,9 +206,9 @@ AST_TEST_DEFINE(get_docs)
switch (cmd) {
case TEST_INIT:
info->name = __func__;
- info->category = "/stasis/http/";
+ info->category = "/res/ari/";
info->summary = "Test simple API get.";
- info->description = "Test Stasis HTTP binding logic.";
+ info->description = "Test ARI binding logic.";
return AST_TEST_NOT_RUN;
case TEST_EXECUTE:
break;
@@ -216,7 +216,7 @@ AST_TEST_DEFINE(get_docs)
response = response_alloc();
headers = ast_variable_new("Host", "stasis.asterisk.org", __FILE__);
- stasis_http_get_docs("resources.json", headers, response);
+ ast_ari_get_docs("resources.json", headers, response);
ast_test_validate(test, 200 == response->response_code);
/* basePath should be relative to the Host header */
@@ -230,23 +230,23 @@ AST_TEST_DEFINE(get_docs)
AST_TEST_DEFINE(get_docs_nohost)
{
- RAII_VAR(struct stasis_http_response *, response, NULL, response_free);
+ RAII_VAR(struct ast_ari_response *, response, NULL, response_free);
struct ast_variable *headers = NULL;
struct ast_json *basePathJson;
switch (cmd) {
case TEST_INIT:
info->name = __func__;
- info->category = "/stasis/http/";
+ info->category = "/res/ari/";
info->summary = "Test API get without a Host header";
- info->description = "Test Stasis HTTP binding logic.";
+ info->description = "Test ARI binding logic.";
return AST_TEST_NOT_RUN;
case TEST_EXECUTE:
break;
}
response = response_alloc();
- stasis_http_get_docs("resources.json", headers, response);
+ ast_ari_get_docs("resources.json", headers, response);
ast_test_validate(test, 200 == response->response_code);
/* basePath should be relative to the Host header */
@@ -258,22 +258,22 @@ AST_TEST_DEFINE(get_docs_nohost)
AST_TEST_DEFINE(get_docs_notfound)
{
- RAII_VAR(struct stasis_http_response *, response, NULL, response_free);
+ RAII_VAR(struct ast_ari_response *, response, NULL, response_free);
struct ast_variable *headers = NULL;
switch (cmd) {
case TEST_INIT:
info->name = __func__;
- info->category = "/stasis/http/";
+ info->category = "/res/ari/";
info->summary = "Test API get for invalid resource";
- info->description = "Test Stasis HTTP binding logic.";
+ info->description = "Test ARI binding logic.";
return AST_TEST_NOT_RUN;
case TEST_EXECUTE:
break;
}
response = response_alloc();
- stasis_http_get_docs("i-am-not-a-resource.json", headers, response);
+ ast_ari_get_docs("i-am-not-a-resource.json", headers, response);
ast_test_validate(test, 404 == response->response_code);
return AST_TEST_PASS;
@@ -281,22 +281,22 @@ AST_TEST_DEFINE(get_docs_notfound)
AST_TEST_DEFINE(get_docs_hackerz)
{
- RAII_VAR(struct stasis_http_response *, response, NULL, response_free);
+ RAII_VAR(struct ast_ari_response *, response, NULL, response_free);
struct ast_variable *headers = NULL;
switch (cmd) {
case TEST_INIT:
info->name = __func__;
- info->category = "/stasis/http/";
+ info->category = "/res/ari/";
info->summary = "Test API get for a file outside the rest-api path";
- info->description = "Test Stasis HTTP binding logic.";
+ info->description = "Test ARI binding logic.";
return AST_TEST_NOT_RUN;
case TEST_EXECUTE:
break;
}
response = response_alloc();
- stasis_http_get_docs("../../../../sbin/asterisk", headers, response);
+ ast_ari_get_docs("../../../../sbin/asterisk", headers, response);
ast_test_validate(test, 404 == response->response_code);
return AST_TEST_PASS;
@@ -305,7 +305,7 @@ AST_TEST_DEFINE(get_docs_hackerz)
AST_TEST_DEFINE(invoke_get)
{
RAII_VAR(void *, fixture, NULL, tear_down_invocation_test);
- RAII_VAR(struct stasis_http_response *, response, NULL, response_free);
+ RAII_VAR(struct ast_ari_response *, response, NULL, response_free);
RAII_VAR(struct ast_json *, expected, NULL, ast_json_unref);
struct ast_variable *get_params = NULL;
struct ast_variable *headers = NULL;
@@ -313,9 +313,9 @@ AST_TEST_DEFINE(invoke_get)
switch (cmd) {
case TEST_INIT:
info->name = __func__;
- info->category = "/stasis/http/";
+ info->category = "/res/ari/";
info->summary = "Test simple GET of an HTTP resource.";
- info->description = "Test Stasis HTTP binding logic.";
+ info->description = "Test ARI binding logic.";
return AST_TEST_NOT_RUN;
case TEST_EXECUTE:
break;
@@ -343,7 +343,7 @@ AST_TEST_DEFINE(invoke_get)
"head2", "head-two",
"path_vars");
- stasis_http_invoke(NULL, "foo", AST_HTTP_GET, get_params, headers, response);
+ ast_ari_invoke(NULL, "foo", AST_HTTP_GET, get_params, headers, response);
ast_test_validate(test, 1 == invocation_count);
ast_test_validate(test, 200 == response->response_code);
@@ -355,7 +355,7 @@ AST_TEST_DEFINE(invoke_get)
AST_TEST_DEFINE(invoke_wildcard)
{
RAII_VAR(void *, fixture, NULL, tear_down_invocation_test);
- RAII_VAR(struct stasis_http_response *, response, NULL, response_free);
+ RAII_VAR(struct ast_ari_response *, response, NULL, response_free);
RAII_VAR(struct ast_json *, expected, NULL, ast_json_unref);
struct ast_variable *get_params = NULL;
struct ast_variable *headers = NULL;
@@ -363,9 +363,9 @@ AST_TEST_DEFINE(invoke_wildcard)
switch (cmd) {
case TEST_INIT:
info->name = __func__;
- info->category = "/stasis/http/";
+ info->category = "/res/ari/";
info->summary = "Test GET of a wildcard resource.";
- info->description = "Test Stasis HTTP binding logic.";
+ info->description = "Test ARI binding logic.";
return AST_TEST_NOT_RUN;
case TEST_EXECUTE:
break;
@@ -380,7 +380,7 @@ AST_TEST_DEFINE(invoke_wildcard)
"path_vars",
"bam", "foshizzle");
- stasis_http_invoke(NULL, "foo/foshizzle", AST_HTTP_GET, get_params, headers, response);
+ ast_ari_invoke(NULL, "foo/foshizzle", AST_HTTP_GET, get_params, headers, response);
ast_test_validate(test, 1 == invocation_count);
ast_test_validate(test, 200 == response->response_code);
@@ -392,7 +392,7 @@ AST_TEST_DEFINE(invoke_wildcard)
AST_TEST_DEFINE(invoke_delete)
{
RAII_VAR(void *, fixture, NULL, tear_down_invocation_test);
- RAII_VAR(struct stasis_http_response *, response, NULL, response_free);
+ RAII_VAR(struct ast_ari_response *, response, NULL, response_free);
RAII_VAR(struct ast_json *, expected, NULL, ast_json_unref);
struct ast_variable *get_params = NULL;
struct ast_variable *headers = NULL;
@@ -400,9 +400,9 @@ AST_TEST_DEFINE(invoke_delete)
switch (cmd) {
case TEST_INIT:
info->name = __func__;
- info->category = "/stasis/http/";
+ info->category = "/res/ari/";
info->summary = "Test DELETE of an HTTP resource.";
- info->description = "Test Stasis HTTP binding logic.";
+ info->description = "Test ARI binding logic.";
return AST_TEST_NOT_RUN;
case TEST_EXECUTE:
break;
@@ -417,7 +417,7 @@ AST_TEST_DEFINE(invoke_delete)
"path_vars",
"bam", "foshizzle");
- stasis_http_invoke(NULL, "foo/foshizzle/bang", AST_HTTP_DELETE, get_params, headers, response);
+ ast_ari_invoke(NULL, "foo/foshizzle/bang", AST_HTTP_DELETE, get_params, headers, response);
ast_test_validate(test, 1 == invocation_count);
ast_test_validate(test, 204 == response->response_code);
@@ -429,7 +429,7 @@ AST_TEST_DEFINE(invoke_delete)
AST_TEST_DEFINE(invoke_post)
{
RAII_VAR(void *, fixture, NULL, tear_down_invocation_test);
- RAII_VAR(struct stasis_http_response *, response, NULL, response_free);
+ RAII_VAR(struct ast_ari_response *, response, NULL, response_free);
RAII_VAR(struct ast_json *, expected, NULL, ast_json_unref);
struct ast_variable *get_params = NULL;
struct ast_variable *headers = NULL;
@@ -437,9 +437,9 @@ AST_TEST_DEFINE(invoke_post)
switch (cmd) {
case TEST_INIT:
info->name = __func__;
- info->category = "/stasis/http/";
+ info->category = "/res/ari/";
info->summary = "Test POST of an HTTP resource.";
- info->description = "Test Stasis HTTP binding logic.";
+ info->description = "Test ARI binding logic.";
return AST_TEST_NOT_RUN;
case TEST_EXECUTE:
break;
@@ -467,7 +467,7 @@ AST_TEST_DEFINE(invoke_post)
"head2", "head-two",
"path_vars");
- stasis_http_invoke(NULL, "foo/bar", AST_HTTP_POST, get_params, headers, response);
+ ast_ari_invoke(NULL, "foo/bar", AST_HTTP_POST, get_params, headers, response);
ast_test_validate(test, 1 == invocation_count);
ast_test_validate(test, 200 == response->response_code);
@@ -479,16 +479,16 @@ AST_TEST_DEFINE(invoke_post)
AST_TEST_DEFINE(invoke_bad_post)
{
RAII_VAR(void *, fixture, NULL, tear_down_invocation_test);
- RAII_VAR(struct stasis_http_response *, response, NULL, response_free);
+ RAII_VAR(struct ast_ari_response *, response, NULL, response_free);
struct ast_variable *get_params = NULL;
struct ast_variable *headers = NULL;
switch (cmd) {
case TEST_INIT:
info->name = __func__;
- info->category = "/stasis/http/";
+ info->category = "/res/ari/";
info->summary = "Test POST on a resource that doesn't support it.";
- info->description = "Test Stasis HTTP binding logic.";
+ info->description = "Test ARI binding logic.";
return AST_TEST_NOT_RUN;
case TEST_EXECUTE:
break;
@@ -496,7 +496,7 @@ AST_TEST_DEFINE(invoke_bad_post)
fixture = setup_invocation_test();
response = response_alloc();
- stasis_http_invoke(NULL, "foo", AST_HTTP_POST, get_params, headers, response);
+ ast_ari_invoke(NULL, "foo", AST_HTTP_POST, get_params, headers, response);
ast_test_validate(test, 0 == invocation_count);
ast_test_validate(test, 405 == response->response_code);
@@ -507,16 +507,16 @@ AST_TEST_DEFINE(invoke_bad_post)
AST_TEST_DEFINE(invoke_not_found)
{
RAII_VAR(void *, fixture, NULL, tear_down_invocation_test);
- RAII_VAR(struct stasis_http_response *, response, NULL, response_free);
+ RAII_VAR(struct ast_ari_response *, response, NULL, response_free);
struct ast_variable *get_params = NULL;
struct ast_variable *headers = NULL;
switch (cmd) {
case TEST_INIT:
info->name = __func__;
- info->category = "/stasis/http/";
+ info->category = "/res/ari/";
info->summary = "Test GET on a resource that does not exist.";
- info->description = "Test Stasis HTTP binding logic.";
+ info->description = "Test ARI binding logic.";
return AST_TEST_NOT_RUN;
case TEST_EXECUTE:
break;
@@ -524,7 +524,7 @@ AST_TEST_DEFINE(invoke_not_found)
fixture = setup_invocation_test();
response = response_alloc();
- stasis_http_invoke(NULL, "foo/fizzle/i-am-not-a-resource", AST_HTTP_GET, get_params, headers, response);
+ ast_ari_invoke(NULL, "foo/fizzle/i-am-not-a-resource", AST_HTTP_GET, get_params, headers, response);
ast_test_validate(test, 0 == invocation_count);
ast_test_validate(test, 404 == response->response_code);
@@ -562,8 +562,8 @@ static int load_module(void)
return AST_MODULE_LOAD_SUCCESS;
}
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Stasis HTTP testing",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ARI testing",
.load = load_module,
.unload = unload_module,
- .nonoptreq = "res_stasis_http",
+ .nonoptreq = "res_ari",
);
diff --git a/tests/test_ari_model.c b/tests/test_ari_model.c
index e881881c9..1e293d791 100644
--- a/tests/test_ari_model.c
+++ b/tests/test_ari_model.c
@@ -36,7 +36,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/utils.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
-#include "../res/stasis_http/ari_model_validators.h"
+#include "../res/ari/ari_model_validators.h"
AST_TEST_DEFINE(validate_byte)
{
@@ -58,34 +58,34 @@ AST_TEST_DEFINE(validate_byte)
uut = ast_json_integer_create(-128);
ast_test_validate(test, NULL != uut);
- ast_test_validate(test, ari_validate_byte(uut));
+ ast_test_validate(test, ast_ari_validate_byte(uut));
res = ast_json_integer_set(uut, 0);
ast_test_validate(test, 0 == res);
- ast_test_validate(test, ari_validate_byte(uut));
+ ast_test_validate(test, ast_ari_validate_byte(uut));
res = ast_json_integer_set(uut, 255);
ast_test_validate(test, 0 == res);
- ast_test_validate(test, ari_validate_byte(uut));
+ ast_test_validate(test, ast_ari_validate_byte(uut));
res = ast_json_integer_set(uut, -129);
ast_test_validate(test, 0 == res);
- ast_test_validate(test, !ari_validate_byte(uut));
+ ast_test_validate(test, !ast_ari_validate_byte(uut));
res = ast_json_integer_set(uut, 256);
ast_test_validate(test, 0 == res);
- ast_test_validate(test, !ari_validate_byte(uut));
+ ast_test_validate(test, !ast_ari_validate_byte(uut));
str = ast_json_string_create("not a byte");
ast_test_validate(test, NULL != str);
- ast_test_validate(test, !ari_validate_byte(str));
+ ast_test_validate(test, !ast_ari_validate_byte(str));
/* Even if the string has an integral value */
res = ast_json_string_set(str, "0");
ast_test_validate(test, 0 == res);
- ast_test_validate(test, !ari_validate_byte(str));
+ ast_test_validate(test, !ast_ari_validate_byte(str));
- ast_test_validate(test, !ari_validate_byte(ast_json_null()));
+ ast_test_validate(test, !ast_ari_validate_byte(ast_json_null()));
return AST_TEST_PASS;
}
@@ -107,24 +107,24 @@ AST_TEST_DEFINE(validate_boolean)
break;
}
- ast_test_validate(test, ari_validate_boolean(ast_json_true()));
- ast_test_validate(test, ari_validate_boolean(ast_json_false()));
+ ast_test_validate(test, ast_ari_validate_boolean(ast_json_true()));
+ ast_test_validate(test, ast_ari_validate_boolean(ast_json_false()));
str = ast_json_string_create("not a bool");
ast_test_validate(test, NULL != str);
- ast_test_validate(test, !ari_validate_boolean(str));
+ ast_test_validate(test, !ast_ari_validate_boolean(str));
/* Even if the string has a boolean value */
res = ast_json_string_set(str, "true");
ast_test_validate(test, 0 == res);
- ast_test_validate(test, !ari_validate_boolean(str));
+ ast_test_validate(test, !ast_ari_validate_boolean(str));
/* Even if the string has a boolean text in it */
res = ast_json_string_set(str, "true");
ast_test_validate(test, 0 == res);
- ast_test_validate(test, !ari_validate_boolean(str));
+ ast_test_validate(test, !ast_ari_validate_boolean(str));
- ast_test_validate(test, !ari_validate_boolean(ast_json_null()));
+ ast_test_validate(test, !ast_ari_validate_boolean(ast_json_null()));
return AST_TEST_PASS;
}
@@ -149,34 +149,34 @@ AST_TEST_DEFINE(validate_int)
uut = ast_json_integer_create(-2147483648LL);
ast_test_validate(test, NULL != uut);
- ast_test_validate(test, ari_validate_int(uut));
+ ast_test_validate(test, ast_ari_validate_int(uut));
res = ast_json_integer_set(uut, 0);
ast_test_validate(test, 0 == res);
- ast_test_validate(test, ari_validate_int(uut));
+ ast_test_validate(test, ast_ari_validate_int(uut));
res = ast_json_integer_set(uut, 2147483647LL);
ast_test_validate(test, 0 == res);
- ast_test_validate(test, ari_validate_int(uut));
+ ast_test_validate(test, ast_ari_validate_int(uut));
res = ast_json_integer_set(uut, -2147483649LL);
ast_test_validate(test, 0 == res);
- ast_test_validate(test, !ari_validate_int(uut));
+ ast_test_validate(test, !ast_ari_validate_int(uut));
res = ast_json_integer_set(uut, 2147483648LL);
ast_test_validate(test, 0 == res);
- ast_test_validate(test, !ari_validate_int(uut));
+ ast_test_validate(test, !ast_ari_validate_int(uut));
str = ast_json_string_create("not a int");
ast_test_validate(test, NULL != str);
- ast_test_validate(test, !ari_validate_int(str));
+ ast_test_validate(test, !ast_ari_validate_int(str));
/* Even if the string has an integral value */
res = ast_json_string_set(str, "0");
ast_test_validate(test, 0 == res);
- ast_test_validate(test, !ari_validate_int(str));
+ ast_test_validate(test, !ast_ari_validate_int(str));
- ast_test_validate(test, !ari_validate_int(ast_json_null()));
+ ast_test_validate(test, !ast_ari_validate_int(ast_json_null()));
return AST_TEST_PASS;
}
@@ -201,18 +201,18 @@ AST_TEST_DEFINE(validate_long)
uut = ast_json_integer_create(0);
ast_test_validate(test, NULL != uut);
- ast_test_validate(test, ari_validate_long(uut));
+ ast_test_validate(test, ast_ari_validate_long(uut));
str = ast_json_string_create("not a long");
ast_test_validate(test, NULL != str);
- ast_test_validate(test, !ari_validate_long(str));
+ ast_test_validate(test, !ast_ari_validate_long(str));
/* Even if the string has an integral value */
res = ast_json_string_set(str, "0");
ast_test_validate(test, 0 == res);
- ast_test_validate(test, !ari_validate_long(str));
+ ast_test_validate(test, !ast_ari_validate_long(str));
- ast_test_validate(test, !ari_validate_long(ast_json_null()));
+ ast_test_validate(test, !ast_ari_validate_long(ast_json_null()));
return AST_TEST_PASS;
}
@@ -237,13 +237,13 @@ AST_TEST_DEFINE(validate_string)
uut = ast_json_string_create("text");
ast_test_validate(test, NULL != uut);
- ast_test_validate(test, ari_validate_string(uut));
+ ast_test_validate(test, ast_ari_validate_string(uut));
res = ast_json_string_set(uut, "");
ast_test_validate(test, 0 == res);
- ast_test_validate(test, ari_validate_string(uut));
+ ast_test_validate(test, ast_ari_validate_string(uut));
- ast_test_validate(test, !ari_validate_string(ast_json_null()));
+ ast_test_validate(test, !ast_ari_validate_string(ast_json_null()));
return AST_TEST_PASS;
}
@@ -341,7 +341,7 @@ AST_TEST_DEFINE(validate_date)
for (i = 0; i < ARRAY_LEN(valid_dates); ++i) {
res = ast_json_string_set(uut, valid_dates[i]);
ast_test_validate(test, 0 == res);
- if (!ari_validate_date(uut)) {
+ if (!ast_ari_validate_date(uut)) {
ast_test_status_update(test,
"Expected '%s' to be a valid date\n",
valid_dates[i]);
@@ -352,7 +352,7 @@ AST_TEST_DEFINE(validate_date)
for (i = 0; i < ARRAY_LEN(invalid_dates); ++i) {
res = ast_json_string_set(uut, invalid_dates[i]);
ast_test_validate(test, 0 == res);
- if (ari_validate_date(uut)) {
+ if (ast_ari_validate_date(uut)) {
ast_test_status_update(test,
"Expected '%s' to be an invalid date\n",
invalid_dates[i]);
@@ -360,7 +360,7 @@ AST_TEST_DEFINE(validate_date)
}
}
- ast_test_validate(test, !ari_validate_string(ast_json_null()));
+ ast_test_validate(test, !ast_ari_validate_string(ast_json_null()));
return test_res;
}
@@ -385,21 +385,21 @@ AST_TEST_DEFINE(validate_list)
uut = ast_json_array_create();
ast_test_validate(test, NULL != uut);
- ast_test_validate(test, ari_validate_list(uut, ari_validate_string));
- ast_test_validate(test, ari_validate_list(uut, ari_validate_int));
+ ast_test_validate(test, ast_ari_validate_list(uut, ast_ari_validate_string));
+ ast_test_validate(test, ast_ari_validate_list(uut, ast_ari_validate_int));
res = ast_json_array_append(uut, ast_json_string_create(""));
ast_test_validate(test, 0 == res);
- ast_test_validate(test, ari_validate_list(uut, ari_validate_string));
- ast_test_validate(test, !ari_validate_list(uut, ari_validate_int));
+ ast_test_validate(test, ast_ari_validate_list(uut, ast_ari_validate_string));
+ ast_test_validate(test, !ast_ari_validate_list(uut, ast_ari_validate_int));
res = ast_json_array_append(uut, ast_json_integer_create(0));
ast_test_validate(test, 0 == res);
- ast_test_validate(test, !ari_validate_list(uut, ari_validate_string));
- ast_test_validate(test, !ari_validate_list(uut, ari_validate_int));
+ ast_test_validate(test, !ast_ari_validate_list(uut, ast_ari_validate_string));
+ ast_test_validate(test, !ast_ari_validate_list(uut, ast_ari_validate_int));
ast_test_validate(test,
- !ari_validate_list(ast_json_null(), ari_validate_string));
+ !ast_ari_validate_list(ast_json_null(), ast_ari_validate_string));
return AST_TEST_PASS;
}