summaryrefslogtreecommitdiff
path: root/gp11/tests
diff options
context:
space:
mode:
Diffstat (limited to 'gp11/tests')
-rw-r--r--gp11/tests/Makefile.am8
-rw-r--r--gp11/tests/test-gp11-mechanism.c2
-rw-r--r--gp11/tests/unit-test-gp11-attributes.c2
-rw-r--r--gp11/tests/unit-test-gp11-crypto.c30
-rw-r--r--gp11/tests/unit-test-gp11-module.c2
-rw-r--r--gp11/tests/unit-test-gp11-object.c18
-rw-r--r--gp11/tests/unit-test-gp11-session.c20
-rw-r--r--gp11/tests/unit-test-gp11-slot.c2
8 files changed, 42 insertions, 42 deletions
diff --git a/gp11/tests/Makefile.am b/gp11/tests/Makefile.am
index b896cd9..5c23f3e 100644
--- a/gp11/tests/Makefile.am
+++ b/gp11/tests/Makefile.am
@@ -1,6 +1,6 @@
# Keep these in the order they should be tested
-UNIT_AUTO = \
+TESTING_FILES = \
unit-test-gp11-attributes.c \
test-gp11-mechanism.c \
unit-test-gp11-module.c \
@@ -9,11 +9,11 @@ UNIT_AUTO = \
unit-test-gp11-object.c \
unit-test-gp11-crypto.c
-UNIT_FLAGS = \
+TESTING_FLAGS = \
-I$(top_srcdir)/gp11/ \
-DEXTERNAL_TEST
-UNIT_LIBS = \
+TESTING_LIBS = \
$(GIO_LIBS) \
$(top_builddir)/gp11/libgp11.la \
libgp11-test-module.la
@@ -21,7 +21,7 @@ UNIT_LIBS = \
EXTRA_DIST = \
gp11-test.h
-include $(top_srcdir)/tests/gtest.make
+include $(top_srcdir)/testing/testing.make
# ------------------------------------------------------------------------
diff --git a/gp11/tests/test-gp11-mechanism.c b/gp11/tests/test-gp11-mechanism.c
index 68543a2..23eeddb 100644
--- a/gp11/tests/test-gp11-mechanism.c
+++ b/gp11/tests/test-gp11-mechanism.c
@@ -2,7 +2,7 @@
#include <glib.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gp11-test.h"
#define MECH_TYPE 55
diff --git a/gp11/tests/unit-test-gp11-attributes.c b/gp11/tests/unit-test-gp11-attributes.c
index fc5619f..48d8be1 100644
--- a/gp11/tests/unit-test-gp11-attributes.c
+++ b/gp11/tests/unit-test-gp11-attributes.c
@@ -2,7 +2,7 @@
#include <glib.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gp11-test.h"
#define ATTR_TYPE 55
diff --git a/gp11/tests/unit-test-gp11-crypto.c b/gp11/tests/unit-test-gp11-crypto.c
index ed3806c..8f9fccb 100644
--- a/gp11/tests/unit-test-gp11-crypto.c
+++ b/gp11/tests/unit-test-gp11-crypto.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include <glib.h>
@@ -44,7 +44,7 @@ fetch_async_result (GObject *source, GAsyncResult *result, gpointer user_data)
{
*((GAsyncResult**)user_data) = result;
g_object_ref (result);
- test_wait_stop ();
+ testing_wait_stop ();
}
static GP11Object*
@@ -159,7 +159,7 @@ DEFINE_TEST(encrypt)
/* Asynchronous one */
gp11_session_encrypt_async (session, key, mech, (const guchar*)"second chance", 14, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
/* Get the result */
@@ -206,7 +206,7 @@ DEFINE_TEST(decrypt)
/* Asynchronous one */
gp11_session_decrypt_async (session, key, mech, (const guchar*)"FAT CHANCE", 11, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
/* Get the result */
@@ -279,7 +279,7 @@ DEFINE_TEST(sign)
/* Asynchronous one */
gp11_session_sign_async (session, key, mech, (const guchar*)"Conrad", 7, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
/* Get the result */
@@ -330,7 +330,7 @@ DEFINE_TEST(verify)
/* Asynchronous one */
gp11_session_verify_async (session, key, mech, (const guchar*)"Labarbara", 10,
(const guchar*)"my-prefix:Labarbara", 20, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_verify_finish (session, result, &error);
SUCCESS_RES (ret, error);
@@ -340,7 +340,7 @@ DEFINE_TEST(verify)
result = NULL;
gp11_session_verify_async (session, key, mech, (const guchar*)"Labarbara", 10,
(const guchar*)"my-prefix:Labarxoro", 20, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_verify_finish (session, result, &error);
FAIL_RES (ret, error);
@@ -385,7 +385,7 @@ DEFINE_TEST(generate_key_pair)
/* Asynchronous one */
mech->type = CKM_GENERATE;
gp11_session_generate_key_pair_async (session, mech, pub_attrs, prv_attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_generate_key_pair_finish (session, result, &pub_key, &prv_key, &error);
SUCCESS_RES (ret, error);
@@ -398,7 +398,7 @@ DEFINE_TEST(generate_key_pair)
mech->type = 0;
pub_key = prv_key = NULL;
gp11_session_generate_key_pair_async (session, mech, pub_attrs, prv_attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_generate_key_pair_finish (session, result, &pub_key, &prv_key, &error);
FAIL_RES (ret, error);
@@ -449,7 +449,7 @@ DEFINE_TEST(wrap_key)
/* Asynchronous one */
mech->type = CKM_WRAP;
gp11_session_wrap_key_async (session, wrapper, mech, wrapped, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
output = gp11_session_wrap_key_finish (session, result, &n_output, &error);
SUCCESS_RES (output, error);
@@ -463,7 +463,7 @@ DEFINE_TEST(wrap_key)
mech->type = 0;
n_output = 0;
gp11_session_wrap_key_async (session, wrapper, mech, wrapped, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
output = gp11_session_wrap_key_finish (session, result, &n_output, &error);
FAIL_RES (output, error);
@@ -510,7 +510,7 @@ DEFINE_TEST(unwrap_key)
/* Asynchronous one */
mech->type = CKM_WRAP;
gp11_session_unwrap_key_async (session, wrapper, mech, "special", 7, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
unwrapped = gp11_session_unwrap_key_finish (session, result, &error);
SUCCESS_RES (unwrapped, error);
@@ -523,7 +523,7 @@ DEFINE_TEST(unwrap_key)
result = NULL;
mech->type = 0;
gp11_session_unwrap_key_async (session, wrapper, mech, "special", 6, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
unwrapped = gp11_session_unwrap_key_finish (session, result, &error);
FAIL_RES (unwrapped, error);
@@ -570,7 +570,7 @@ g_printerr ("derived is: %lu", gp11_object_get_handle (derived));
/* Asynchronous one */
mech->type = CKM_DERIVE;
gp11_session_derive_key_async (session, wrapper, mech, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
derived = gp11_session_derive_key_finish (session, result, &error);
SUCCESS_RES (derived, error);
@@ -583,7 +583,7 @@ g_printerr ("derived is: %lu", gp11_object_get_handle (derived));
result = NULL;
mech->type = 0;
gp11_session_derive_key_async (session, wrapper, mech, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
derived = gp11_session_derive_key_finish (session, result, &error);
FAIL_RES (derived, error);
diff --git a/gp11/tests/unit-test-gp11-module.c b/gp11/tests/unit-test-gp11-module.c
index 8fabc2d..7ff14a1 100644
--- a/gp11/tests/unit-test-gp11-module.c
+++ b/gp11/tests/unit-test-gp11-module.c
@@ -2,7 +2,7 @@
#include <glib.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gp11-test.h"
static GP11Module *module = NULL;
diff --git a/gp11/tests/unit-test-gp11-object.c b/gp11/tests/unit-test-gp11-object.c
index a0f8eb2..d5d0a98 100644
--- a/gp11/tests/unit-test-gp11-object.c
+++ b/gp11/tests/unit-test-gp11-object.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include <glib.h>
@@ -94,7 +94,7 @@ fetch_async_result (GObject *source, GAsyncResult *result, gpointer user_data)
{
*((GAsyncResult**)user_data) = result;
g_object_ref (result);
- test_wait_stop ();
+ testing_wait_stop ();
}
DEFINE_TEST(create_object)
@@ -139,7 +139,7 @@ DEFINE_TEST(create_object)
/* Using async */
gp11_session_create_object_async (session, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
object = gp11_session_create_object_finish (session, result, &err);
@@ -205,7 +205,7 @@ DEFINE_TEST(destroy_object)
/* Using async */
gp11_object_destroy_async (object, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_object_destroy_finish (object, result, &err);
@@ -247,7 +247,7 @@ DEFINE_TEST(get_attributes)
/* Async */
attrs = gp11_attributes_new_empty (CKA_CLASS, CKA_LABEL, GP11_INVALID);
gp11_object_get_async (object, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
attrs_ret = gp11_object_get_finish (object, result, &err);
@@ -289,7 +289,7 @@ DEFINE_TEST(get_data_attribute)
/* Async */
gp11_object_get_data_async (object, CKA_CLASS, NULL, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
klass = gp11_object_get_data_finish (object, result, &n_data, &err);
@@ -348,7 +348,7 @@ DEFINE_TEST(set_attributes)
/* Async */
gp11_object_set_async (object, templ, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_object_set_finish (object, result, &err);
@@ -399,7 +399,7 @@ DEFINE_TEST(find_objects)
/* Async, None */
gp11_attributes_add_string (templ, CKA_LABEL, "blah blah");
gp11_session_find_objects_async (session, templ, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
objects = gp11_session_find_objects_finish (session, result, &err);
@@ -436,7 +436,7 @@ DEFINE_TEST(explicit_sessions)
/* Async */
gp11_object_get_data_async (object, CKA_CLASS, NULL, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
klass = gp11_object_get_data_finish (object, result, &n_data, &err);
diff --git a/gp11/tests/unit-test-gp11-session.c b/gp11/tests/unit-test-gp11-session.c
index 0299ce5..d03d45a 100644
--- a/gp11/tests/unit-test-gp11-session.c
+++ b/gp11/tests/unit-test-gp11-session.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include <glib.h>
@@ -73,7 +73,7 @@ fetch_async_result (GObject *source, GAsyncResult *result, gpointer user_data)
{
*((GAsyncResult**)user_data) = result;
g_object_ref (result);
- test_wait_stop ();
+ testing_wait_stop ();
}
DEFINE_TEST(open_close_session)
@@ -90,7 +90,7 @@ DEFINE_TEST(open_close_session)
/* Test opening async */
gp11_slot_open_session_async (slot, 0, NULL, NULL, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
/* Get the result */
@@ -132,7 +132,7 @@ DEFINE_TEST(open_reused)
/* Test opening async */
gp11_slot_open_session_async (slot, 0, NULL, NULL, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
sess = gp11_slot_open_session_finish (slot, result, &err);
SUCCESS_RES (sess, err);
@@ -177,7 +177,7 @@ DEFINE_TEST(init_set_pin)
/* init pin async */
gp11_session_init_pin_async (session, (guchar*)"booo", 4, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_init_pin_finish (session, result, &err);
SUCCESS_RES (ret, err);
@@ -186,7 +186,7 @@ DEFINE_TEST(init_set_pin)
/* set pin async */
gp11_session_set_pin_async (session, (guchar*)"booo", 4, (guchar*)"tooo", 4, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_set_pin_finish (session, result, &err);
SUCCESS_RES (ret, err);
@@ -217,7 +217,7 @@ DEFINE_TEST(login_logout)
/* login async */
gp11_session_login_async (session, CKU_USER, (guchar*)"booo", 4, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_login_finish (session, result, &err);
@@ -228,7 +228,7 @@ DEFINE_TEST(login_logout)
/* logout async */
gp11_session_logout_async (session, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_logout_finish (session, result, &err);
@@ -298,7 +298,7 @@ DEFINE_TEST(auto_login)
/* Now try the same thing, but asyncronously */
gp11_slot_open_session_async (slot, CKF_RW_SESSION, NULL, NULL, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
new_session = gp11_slot_open_session_finish (slot, result, &err);
SUCCESS_RES (new_session, err);
@@ -307,7 +307,7 @@ DEFINE_TEST(auto_login)
result = NULL;
gp11_session_create_object_async (session, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
object = gp11_session_create_object_finish (session, result, &err);
SUCCESS_RES (object, err);
diff --git a/gp11/tests/unit-test-gp11-slot.c b/gp11/tests/unit-test-gp11-slot.c
index 175cc36..1fcda58 100644
--- a/gp11/tests/unit-test-gp11-slot.c
+++ b/gp11/tests/unit-test-gp11-slot.c
@@ -2,7 +2,7 @@
#include <glib.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gp11-test.h"
static GP11Module *module = NULL;