aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-10-10 12:17:11 +0200
committerMarcel Holtmann <marcel@holtmann.org>2010-10-10 12:17:11 +0200
commitab07dd401ee8e477b980acf1f1ceb9ade6b96909 (patch)
tree0f4e5665e320d58864f039ff243bb31342e9d1ea
parent82cf3cc54c633a0260339e82eb05143d15eba07c (diff)
downloadpacrunner-ab07dd401ee8e477b980acf1f1ceb9ade6b96909.tar.gz
Add Javascript test case for massive execution
-rw-r--r--unit/test-mozjs.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/unit/test-mozjs.c b/unit/test-mozjs.c
index ec4f3b7..606d05a 100644
--- a/unit/test-mozjs.c
+++ b/unit/test-mozjs.c
@@ -37,7 +37,8 @@ void pacrunner_debug(const char *format, ...)
{
}
-#define MULTIPLE_COUNT 100
+#define MULTIPLE_COUNT 500
+#define MASSIVE_COUNT MULTIPLE_COUNT * 100
#define EXAMPLE_URL "http://www.example.com/site/test.html"
#define EXAMPLE_HOST "www.example.com"
@@ -127,6 +128,25 @@ static void test_multiple_execute_with_direct_pac(void)
__pacrunner_mozjs_cleanup();
}
+static void test_massive_execute_with_direct_pac(void)
+{
+ const char *result;
+ int i;
+
+ __pacrunner_mozjs_init();
+
+ g_assert(__pacrunner_mozjs_set(NULL, DIRECT_PAC) == 0);
+
+ for (i = 0; i < MASSIVE_COUNT; i++) {
+ result = __pacrunner_mozjs_execute(EXAMPLE_URL, EXAMPLE_HOST);
+ g_test_message("result %d: %s\n", i, result);
+ }
+
+ __pacrunner_mozjs_clear();
+
+ __pacrunner_mozjs_cleanup();
+}
+
int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
@@ -141,6 +161,8 @@ int main(int argc, char **argv)
test_single_execute_with_direct_pac);
g_test_add_func("/mozjs/multiple-execute-with-direct-pac",
test_multiple_execute_with_direct_pac);
+ g_test_add_func("/mozjs/massive-execute-with-direct-pac",
+ test_massive_execute_with_direct_pac);
return g_test_run();
}