[gnome-keyring/trust-store] [testing] Preprocess test files before searching for tests.
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring/trust-store] [testing] Preprocess test files before searching for tests.
- Date: Thu, 25 Nov 2010 03:24:20 +0000 (UTC)
commit 7e72a23ee92c7ac3aff1669015de3e7b5aff93a0
Author: Stef Walter <stefw collabora co uk>
Date: Wed Nov 24 16:12:16 2010 +0000
[testing] Preprocess test files before searching for tests.
* Allows tests to be commented out or ifdefed.
* Faster building of tests.
* Other cleanup of tests.
.gitignore | 1 +
daemon/dbus/tests/test-secret-util.c | 2 +-
egg/tests/Makefile.am | 6 +-
egg/tests/test-asn1.c | 46 ++++----
egg/tests/test-dn.c | 12 +-
egg/tests/test-padding.c | 30 +++---
egg/tests/unit-test-asn1.c | 34 +++---
egg/tests/unit-test-cleanup.c | 8 +-
egg/tests/unit-test-dh.c | 20 ++--
egg/tests/unit-test-hex.c | 8 +-
egg/tests/unit-test-oid.c | 2 +-
egg/tests/unit-test-openssl.c | 6 +-
egg/tests/unit-test-secmem.c | 14 +-
egg/tests/unit-test-spawn.c | 10 +-
egg/tests/unit-test-symkey.c | 12 +-
gck/tests/test-gck-attributes.c | 56 +++++-----
gck/tests/test-gck-crypto.c | 22 ++--
gck/tests/test-gck-enumerator.c | 18 ++--
gck/tests/test-gck-module.c | 14 +-
gck/tests/test-gck-modules.c | 22 ++--
gck/tests/test-gck-object.c | 20 ++--
gck/tests/test-gck-session.c | 16 ++--
gck/tests/test-gck-slot.c | 18 ++--
gck/tests/test-gck-uri.c | 30 +++---
gcr/tests/test-trust.c | 18 ++--
gcr/tests/unit-test-certificate.c | 30 +++---
gcr/tests/unit-test-parser.c | 6 +-
pkcs11/gkm/tests/Makefile.am | 12 +-
pkcs11/gkm/tests/unit-test-attributes.c | 122 ++++++++++----------
pkcs11/gkm/tests/unit-test-credential.c | 22 ++--
pkcs11/gkm/tests/unit-test-data-asn1.c | 6 +-
pkcs11/gkm/tests/unit-test-data-der.c | 36 +++---
pkcs11/gkm/tests/unit-test-file-tracker.c | 10 +-
pkcs11/gkm/tests/unit-test-memory-store.c | 34 +++---
pkcs11/gkm/tests/unit-test-object.c | 18 ++--
pkcs11/gkm/tests/unit-test-secret.c | 14 +-
pkcs11/gkm/tests/unit-test-sexp.c | 8 +-
pkcs11/gkm/tests/unit-test-store.c | 8 +-
pkcs11/gkm/tests/unit-test-timer.c | 16 ++--
pkcs11/gkm/tests/unit-test-transaction.c | 32 +++---
pkcs11/gnome2-store/tests/Makefile.am | 4 +-
pkcs11/gnome2-store/tests/test-module.c | 2 +-
pkcs11/gnome2-store/tests/unit-test-gnome2-file.c | 42 ++++----
pkcs11/roots-store/tests/Makefile.am | 2 -
pkcs11/roots-store/tests/test-module.c | 2 +-
pkcs11/secret-store/tests/Makefile.am | 6 +-
.../secret-store/tests/unit-test-secret-binary.c | 16 ++--
.../tests/unit-test-secret-collection.c | 44 ++++----
.../secret-store/tests/unit-test-secret-compat.c | 8 +-
pkcs11/secret-store/tests/unit-test-secret-data.c | 18 ++--
.../secret-store/tests/unit-test-secret-fields.c | 44 ++++----
pkcs11/secret-store/tests/unit-test-secret-item.c | 40 +++---
.../secret-store/tests/unit-test-secret-object.c | 30 +++---
.../secret-store/tests/unit-test-secret-search.c | 22 ++--
.../secret-store/tests/unit-test-secret-textual.c | 14 +-
pkcs11/ssh-store/tests/Makefile.am | 5 +-
pkcs11/ssh-store/tests/test-ssh-module.c | 2 +-
pkcs11/ssh-store/tests/unit-test-private-key.c | 8 +-
pkcs11/ssh-store/tests/unit-test-ssh-openssh.c | 4 +-
pkcs11/wrap-layer/tests/Makefile.am | 4 +-
pkcs11/wrap-layer/tests/test-create-credential.c | 10 +-
pkcs11/wrap-layer/tests/test-init-pin.c | 6 +-
pkcs11/wrap-layer/tests/test-login-auto.c | 10 +-
pkcs11/wrap-layer/tests/test-login-hints.c | 2 +-
pkcs11/wrap-layer/tests/test-login-keyring.c | 28 +++---
pkcs11/wrap-layer/tests/test-login-specific.c | 10 +-
pkcs11/wrap-layer/tests/test-login-user.c | 18 ++--
pkcs11/wrap-layer/tests/test-set-pin.c | 6 +-
pkcs11/xdg-store/tests/Makefile.am | 9 +-
pkcs11/xdg-store/tests/test-xdg-module.c | 2 +-
pkcs11/xdg-store/tests/test-xdg-trust.c | 26 ++--
testing/testing-build.sh | 78 +++++++------
testing/testing.h | 46 +++-----
testing/testing.make | 41 +++++--
ui/tests/unit-test-util.c | 14 +-
75 files changed, 730 insertions(+), 712 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 4d55f54..ab6ec39 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
*~
*.o
+*.i
*.la
*.lo
*.a
diff --git a/daemon/dbus/tests/test-secret-util.c b/daemon/dbus/tests/test-secret-util.c
index 8a981e7..7ed48e9 100644
--- a/daemon/dbus/tests/test-secret-util.c
+++ b/daemon/dbus/tests/test-secret-util.c
@@ -29,7 +29,7 @@
#include <glib.h>
-DEFINE_TEST(secret_util_build_path)
+TESTING_TEST(secret_util_build_path)
{
const gchar *identifier = "par_d\xc3\xa9""faut";
gchar *result;
diff --git a/egg/tests/Makefile.am b/egg/tests/Makefile.am
index 2e7e692..013f0ef 100644
--- a/egg/tests/Makefile.am
+++ b/egg/tests/Makefile.am
@@ -1,6 +1,9 @@
asn1-def-test.c: test.asn
$(ASN1PARSER) -o asn1-def-test.c $(srcdir)/test.asn
+TESTING_SOURCES = \
+ asn1-def-test.c
+
# Test files should be listed in order they need to run
TESTING_FILES = \
test-asn1.c \
@@ -14,8 +17,7 @@ TESTING_FILES = \
unit-test-symkey.c \
unit-test-openssl.c \
unit-test-dh.c \
- unit-test-spawn.c \
- asn1-def-test.c
+ unit-test-spawn.c
UNIT_PROMPT =
diff --git a/egg/tests/test-asn1.c b/egg/tests/test-asn1.c
index 460b76c..8e2ac79 100644
--- a/egg/tests/test-asn1.c
+++ b/egg/tests/test-asn1.c
@@ -55,7 +55,7 @@ const gchar ENUM_THREE[] = "\x0A\x01\x03";
#define XL(x) G_N_ELEMENTS (x) - 1
-DEFINE_TEST(asn1_boolean)
+TESTING_TEST(asn1_boolean)
{
GNode *asn;
gboolean value;
@@ -92,7 +92,7 @@ DEFINE_TEST(asn1_boolean)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_integer)
+TESTING_TEST(asn1_integer)
{
GNode *asn;
gulong value;
@@ -120,7 +120,7 @@ DEFINE_TEST(asn1_integer)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_octet_string)
+TESTING_TEST(asn1_octet_string)
{
GNode *asn;
gchar *value;
@@ -148,7 +148,7 @@ DEFINE_TEST(asn1_octet_string)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_generalized_time)
+TESTING_TEST(asn1_generalized_time)
{
GNode *asn;
glong value;
@@ -175,7 +175,7 @@ DEFINE_TEST(asn1_generalized_time)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_implicit)
+TESTING_TEST(asn1_implicit)
{
GNode *asn;
gchar *value;
@@ -193,7 +193,7 @@ DEFINE_TEST(asn1_implicit)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_explicit)
+TESTING_TEST(asn1_explicit)
{
GNode *asn;
gchar *value;
@@ -211,7 +211,7 @@ DEFINE_TEST(asn1_explicit)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_bit_string_decode)
+TESTING_TEST(asn1_bit_string_decode)
{
GNode *asn;
guchar *bits;
@@ -235,7 +235,7 @@ DEFINE_TEST(asn1_bit_string_decode)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_bit_string_decode_bad)
+TESTING_TEST(asn1_bit_string_decode_bad)
{
GNode *asn;
@@ -249,7 +249,7 @@ DEFINE_TEST(asn1_bit_string_decode_bad)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_bit_string_decode_ulong)
+TESTING_TEST(asn1_bit_string_decode_ulong)
{
GNode *asn;
gulong bits;
@@ -271,7 +271,7 @@ DEFINE_TEST(asn1_bit_string_decode_ulong)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_bit_string_encode_decode)
+TESTING_TEST(asn1_bit_string_encode_decode)
{
GNode *asn;
guchar bits[] = { 0x5d, 0x6e, 0x83 };
@@ -305,7 +305,7 @@ DEFINE_TEST(asn1_bit_string_encode_decode)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_bit_string_encode_decode_ulong)
+TESTING_TEST(asn1_bit_string_encode_decode_ulong)
{
GNode *asn;
gulong check, bits = 0x0101b977;
@@ -335,7 +335,7 @@ DEFINE_TEST(asn1_bit_string_encode_decode_ulong)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_bit_string_encode_decode_zero)
+TESTING_TEST(asn1_bit_string_encode_decode_zero)
{
GNode *asn;
gpointer data;
@@ -357,7 +357,7 @@ DEFINE_TEST(asn1_bit_string_encode_decode_zero)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_have)
+TESTING_TEST(asn1_have)
{
GNode *asn;
guchar *data;
@@ -391,7 +391,7 @@ test_is_freed (gpointer unused)
is_freed = TRUE;
}
-DEFINE_TEST(asn1_any_set_raw)
+TESTING_TEST(asn1_any_set_raw)
{
GNode *asn, *node;
guchar *data;
@@ -428,7 +428,7 @@ DEFINE_TEST(asn1_any_set_raw)
g_assert (is_freed);
}
-DEFINE_TEST(asn1_any_set_raw_explicit)
+TESTING_TEST(asn1_any_set_raw_explicit)
{
GNode *asn, *node;
guchar *data;
@@ -465,7 +465,7 @@ DEFINE_TEST(asn1_any_set_raw_explicit)
g_assert (is_freed);
}
-DEFINE_TEST(asn1_choice_not_chosen)
+TESTING_TEST(asn1_choice_not_chosen)
{
GNode *asn, *node;
guchar *data;
@@ -531,19 +531,19 @@ perform_asn1_any_choice_set_raw (const gchar *choice, const gchar *encoding, gsi
g_assert (is_freed);
}
-DEFINE_TEST(asn1_any_choice_set_raw_short_tag)
+TESTING_TEST(asn1_any_choice_set_raw_short_tag)
{
const gchar ENCODING[] = "\xBE\x0C\x04\x0A""farnsworth";
perform_asn1_any_choice_set_raw ("choiceShortTag", ENCODING, XL (ENCODING));
}
-DEFINE_TEST(asn1_any_choice_set_raw_long_tag)
+TESTING_TEST(asn1_any_choice_set_raw_long_tag)
{
const gchar ENCODING[] = "\xBF\x1F\x0C\x04\x0A""farnsworth";
perform_asn1_any_choice_set_raw ("choiceLongTag", ENCODING, XL (ENCODING));
}
-DEFINE_TEST(asn1_append)
+TESTING_TEST(asn1_append)
{
GNode *asn;
GNode *child;
@@ -576,7 +576,7 @@ DEFINE_TEST(asn1_append)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_append_and_clear)
+TESTING_TEST(asn1_append_and_clear)
{
GNode *asn;
gpointer data;
@@ -606,7 +606,7 @@ DEFINE_TEST(asn1_append_and_clear)
g_free (data);
}
-DEFINE_TEST(asn1_setof)
+TESTING_TEST(asn1_setof)
{
GNode *asn;
gpointer data;
@@ -642,7 +642,7 @@ DEFINE_TEST(asn1_setof)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(asn1_setof_empty)
+TESTING_TEST(asn1_setof_empty)
{
GNode *asn;
gpointer data;
@@ -667,7 +667,7 @@ DEFINE_TEST(asn1_setof_empty)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST (asn1_enumerated)
+TESTING_TEST (asn1_enumerated)
{
GNode *asn;
gpointer data;
diff --git a/egg/tests/test-dn.c b/egg/tests/test-dn.c
index aa0a61c..0ac7a95 100644
--- a/egg/tests/test-dn.c
+++ b/egg/tests/test-dn.c
@@ -42,7 +42,7 @@ static GNode* asn1_cert = NULL;
static guchar *data_cert = NULL;
static gsize n_data_cert = 0;
-DEFINE_SETUP(dn_cert)
+TESTING_SETUP(dn_cert)
{
data_cert = testing_data_read ("test-certificate-1.der", &n_data_cert);
@@ -53,14 +53,14 @@ DEFINE_SETUP(dn_cert)
g_assert_not_reached ();
}
-DEFINE_TEARDOWN(dn_cert)
+TESTING_TEARDOWN(dn_cert)
{
egg_asn1x_destroy (asn1_cert);
g_free (data_cert);
data_cert = NULL;
}
-DEFINE_TEST(read_dn)
+TESTING_TEST(read_dn)
{
gchar *dn;
@@ -71,7 +71,7 @@ DEFINE_TEST(read_dn)
g_free (dn);
}
-DEFINE_TEST(dn_value)
+TESTING_TEST(dn_value)
{
const guchar value[] = { 0x13, 0x1a, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x50, 0x72, 0x65, 0x6d, 0x69, 0x75, 0x6d, 0x20, 0x43, 0x41 };
gsize n_value = 28;
@@ -118,7 +118,7 @@ concatenate_dn (guint index, GQuark oid, const guchar *value, gsize n_value, gpo
g_free (text);
}
-DEFINE_TEST(parse_dn)
+TESTING_TEST(parse_dn)
{
GString *dn = g_string_new ("");
last_index = 1;
@@ -130,7 +130,7 @@ DEFINE_TEST(parse_dn)
g_string_free (dn, TRUE);
}
-DEFINE_TEST(read_dn_part)
+TESTING_TEST(read_dn_part)
{
GNode *node;
gchar *value;
diff --git a/egg/tests/test-padding.c b/egg/tests/test-padding.c
index a42729e..3a11f46 100644
--- a/egg/tests/test-padding.c
+++ b/egg/tests/test-padding.c
@@ -55,21 +55,21 @@ test_padding (EggPadding padding, gsize block, gconstpointer input,
g_assert_cmpsize (n_output, ==, n_result);
}
-DEFINE_TEST(zero_padding)
+TESTING_TEST(zero_padding)
{
guchar padded[] = { 0x00, 0x00, 0x00, 0x00, 'T', 'E', 'S', 'T' };
gchar raw[] = "TEST";
test_padding (egg_padding_zero_pad, 8, raw, 4, padded, 8);
}
-DEFINE_TEST(zero_padding_no_data)
+TESTING_TEST(zero_padding_no_data)
{
guchar padded[] = { };
gchar raw[] = "";
test_padding (egg_padding_zero_pad, 8, raw, 0, padded, 0);
}
-DEFINE_TEST(pkcs1_one_padding)
+TESTING_TEST(pkcs1_one_padding)
{
guchar padded[] = { 0x00, 0x01, 0xFF, 0x00, 'T', 'E', 'S', 'T' };
gchar raw[] = "TEST";
@@ -77,7 +77,7 @@ DEFINE_TEST(pkcs1_one_padding)
test_padding (egg_padding_pkcs1_unpad_01, 8, padded, 8, raw, 4);
}
-DEFINE_TEST(pkcs1_one_padding_no_data)
+TESTING_TEST(pkcs1_one_padding_no_data)
{
guchar padded[] = { 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00 };
gchar raw[] = "";
@@ -85,7 +85,7 @@ DEFINE_TEST(pkcs1_one_padding_no_data)
test_padding (egg_padding_pkcs1_unpad_01, 8, padded, 8, raw, 0);
}
-DEFINE_TEST(pkcs1_two_padding)
+TESTING_TEST(pkcs1_two_padding)
{
guchar padded[] = { 0x00, 0x02, 0x77, 0x66, 0x55, 0x00, 'T', 'E', };
gchar raw[] = "TE";
@@ -111,31 +111,31 @@ DEFINE_TEST(pkcs1_two_padding)
g_assert (result[7] == 'E');
}
-DEFINE_TEST(pkcs1_padding_invalid_prefix)
+TESTING_TEST(pkcs1_padding_invalid_prefix)
{
guchar padded[] = { 0x01, 0x04, 0x04, 0x04 };
test_padding (egg_padding_pkcs1_unpad_01, 4, padded, 4, NULL, 0);
}
-DEFINE_TEST(pkcs1_padding_invalid_type)
+TESTING_TEST(pkcs1_padding_invalid_type)
{
guchar padded[] = { 0x00, 0x03, 0xFF, 0x00, 'T', 'E', 'S', 'T' };
test_padding (egg_padding_pkcs1_unpad_01, 8, padded, 8, NULL, 0);
}
-DEFINE_TEST(pkcs1_padding_invalid_no_zero)
+TESTING_TEST(pkcs1_padding_invalid_no_zero)
{
guchar padded[] = { 0x00, 0x01, 0xFF, 0xFF, 'T', 'E', 'S', 'T' };
test_padding (egg_padding_pkcs1_unpad_01, 8, padded, 8, NULL, 0);
}
-DEFINE_TEST(pkcs1_padding_invalid_length)
+TESTING_TEST(pkcs1_padding_invalid_length)
{
guchar padded[] = { 0x00, 0x01, 0xFF, 0xFF, 'T', 'E', 'S' };
test_padding (egg_padding_pkcs1_unpad_01, 8, padded, 7, NULL, 0);
}
-DEFINE_TEST(pkcs7_padding)
+TESTING_TEST(pkcs7_padding)
{
guchar padded[] = { 'T', 'E', 'S', 'T', 0x04, 0x04, 0x04, 0x04 };
gchar raw[] = "TEST";
@@ -144,7 +144,7 @@ DEFINE_TEST(pkcs7_padding)
test_padding (egg_padding_pkcs7_unpad, 8, padded, 8, raw, 4);
}
-DEFINE_TEST(pkcs7_padding_equal_block)
+TESTING_TEST(pkcs7_padding_equal_block)
{
guchar padded[] = { 'T', 'E', 'S', 'T', 'T', 'E', 'S', 'T', 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 };
gchar raw[] = "TESTTEST";
@@ -153,7 +153,7 @@ DEFINE_TEST(pkcs7_padding_equal_block)
test_padding (egg_padding_pkcs7_unpad, 8, padded, 16, raw, 8);
}
-DEFINE_TEST(pkcs7_padding_zero)
+TESTING_TEST(pkcs7_padding_zero)
{
guchar padded[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 };
gchar raw[] = "";
@@ -162,20 +162,20 @@ DEFINE_TEST(pkcs7_padding_zero)
test_padding (egg_padding_pkcs7_unpad, 8, padded, 8, raw, 0);
}
-DEFINE_TEST(pkcs7_padding_invalid_zero)
+TESTING_TEST(pkcs7_padding_invalid_zero)
{
guchar padded[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
test_padding (egg_padding_pkcs7_unpad, 8, padded, 8, NULL, 0);
}
-DEFINE_TEST(pkcs7_padding_invalid_too_long)
+TESTING_TEST(pkcs7_padding_invalid_too_long)
{
guchar padded[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 };
test_padding (egg_padding_pkcs7_unpad, 4, padded, 8, NULL, 0);
test_padding (egg_padding_pkcs7_unpad, 4, padded, 4, NULL, 0);
}
-DEFINE_TEST(pkcs7_padding_invalid_different)
+TESTING_TEST(pkcs7_padding_invalid_different)
{
guchar padded[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 };
test_padding (egg_padding_pkcs7_unpad, 8, padded, 8, NULL, 0);
diff --git a/egg/tests/unit-test-asn1.c b/egg/tests/unit-test-asn1.c
index c4171d4..a284506 100644
--- a/egg/tests/unit-test-asn1.c
+++ b/egg/tests/unit-test-asn1.c
@@ -43,7 +43,7 @@ static GNode *asn1_cert = NULL;
static guchar *data_cert = NULL;
static gsize n_data_cert = 0;
-DEFINE_SETUP(asn1_tree)
+TESTING_SETUP(asn1_tree)
{
data_cert = testing_data_read ("test-certificate-1.der", &n_data_cert);
@@ -54,19 +54,19 @@ DEFINE_SETUP(asn1_tree)
egg_asn1x_assert_not_reached (asn1_cert);
}
-DEFINE_TEARDOWN(asn1_tree)
+TESTING_TEARDOWN(asn1_tree)
{
egg_asn1x_destroy (asn1_cert);
g_free (data_cert);
data_cert = NULL;
}
-DEFINE_TEST(node_name)
+TESTING_TEST(node_name)
{
g_assert_cmpstr (egg_asn1x_name (asn1_cert), ==, "Certificate");
}
-DEFINE_TEST(asn1_integers)
+TESTING_TEST(asn1_integers)
{
GNode *asn;
guchar *data;
@@ -112,7 +112,7 @@ DEFINE_TEST(asn1_integers)
g_free (data);
}
-DEFINE_TEST(boolean)
+TESTING_TEST(boolean)
{
GNode *asn = NULL;
gboolean value, ret;
@@ -153,7 +153,7 @@ DEFINE_TEST(boolean)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(write_value)
+TESTING_TEST(write_value)
{
GNode *asn = NULL;
guchar *data;
@@ -180,7 +180,7 @@ DEFINE_TEST(write_value)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(element_length_content)
+TESTING_TEST(element_length_content)
{
GNode *asn = NULL;
gchar *buffer;
@@ -223,7 +223,7 @@ DEFINE_TEST(element_length_content)
g_free (buffer);
}
-DEFINE_TEST(read_element)
+TESTING_TEST(read_element)
{
GNode *asn = NULL;
guchar *buffer;
@@ -254,7 +254,7 @@ DEFINE_TEST(read_element)
g_free (buffer);
}
-DEFINE_TEST(oid)
+TESTING_TEST(oid)
{
GNode *asn = NULL;
GQuark oid, check;
@@ -334,7 +334,7 @@ static const TimeTestData utc_time_test_data[] = {
{ NULL, 0 }
};
-DEFINE_TEST(general_time)
+TESTING_TEST(general_time)
{
time_t when;
const TimeTestData *data;
@@ -352,7 +352,7 @@ DEFINE_TEST(general_time)
}
}
-DEFINE_TEST(utc_time)
+TESTING_TEST(utc_time)
{
time_t when;
const TimeTestData *data;
@@ -370,7 +370,7 @@ DEFINE_TEST(utc_time)
}
}
-DEFINE_TEST(read_time)
+TESTING_TEST(read_time)
{
glong time;
@@ -378,7 +378,7 @@ DEFINE_TEST(read_time)
g_assert_cmpint (time, ==, 820454400);
}
-DEFINE_TEST(read_date)
+TESTING_TEST(read_date)
{
GDate date;
if (!egg_asn1x_get_time_as_date (egg_asn1x_node (asn1_cert, "tbsCertificate", "validity", "notAfter", NULL), &date))
@@ -388,7 +388,7 @@ DEFINE_TEST(read_date)
g_assert_cmpint (date.year, ==, 2020);
}
-DEFINE_TEST(create_by_oid)
+TESTING_TEST(create_by_oid)
{
/* id-at-initials = X520initials */
GNode *node = egg_asn1x_create (pkix_asn1_tab, "2.5.4.43");
@@ -397,13 +397,13 @@ DEFINE_TEST(create_by_oid)
egg_asn1x_destroy (node);
}
-DEFINE_TEST(create_by_oid_invalid)
+TESTING_TEST(create_by_oid_invalid)
{
GNode *node = egg_asn1x_create (pkix_asn1_tab, "23.23.23.23");
g_assert (node == NULL);
}
-DEFINE_TEST(create_by_bad_order)
+TESTING_TEST(create_by_bad_order)
{
/*
* In pkix.asn the definition for parts of this oid
@@ -417,7 +417,7 @@ DEFINE_TEST(create_by_bad_order)
egg_asn1x_destroy (node);
}
-DEFINE_TEST(count)
+TESTING_TEST(count)
{
GNode *node;
diff --git a/egg/tests/unit-test-cleanup.c b/egg/tests/unit-test-cleanup.c
index 680b22f..45216ce 100644
--- a/egg/tests/unit-test-cleanup.c
+++ b/egg/tests/unit-test-cleanup.c
@@ -43,7 +43,7 @@ cleanup_callback (gpointer user_data)
param->value = NULL;
}
-DEFINE_TEST(cleanup)
+TESTING_TEST(cleanup)
{
CleanupParam param;
@@ -76,7 +76,7 @@ order_callback (gpointer user_data)
--order_value;
}
-DEFINE_TEST(order)
+TESTING_TEST(order)
{
OrderParam param[8];
int i;
@@ -116,7 +116,7 @@ reregister_callback (gpointer user_data)
egg_cleanup_register (second_callback, NULL);
}
-DEFINE_TEST(reregister)
+TESTING_TEST(reregister)
{
cleaned_up = FALSE;
@@ -140,7 +140,7 @@ remove_callback (gpointer user_data)
test_cleaned_up = TRUE;
}
-DEFINE_TEST(remove)
+TESTING_TEST(remove)
{
egg_cleanup_register (remove_callback, NULL);
egg_cleanup_register (remove_callback, DATA);
diff --git a/egg/tests/unit-test-dh.c b/egg/tests/unit-test-dh.c
index e08d4e8..583ffb5 100644
--- a/egg/tests/unit-test-dh.c
+++ b/egg/tests/unit-test-dh.c
@@ -32,7 +32,7 @@
#include <gcrypt.h>
-DEFINE_TEST(dh_perform)
+TESTING_TEST(dh_perform)
{
gcry_mpi_t p, g;
gcry_mpi_t x1, X1;
@@ -69,7 +69,7 @@ DEFINE_TEST(dh_perform)
egg_secure_free (k2);
}
-DEFINE_TEST(dh_short_pair)
+TESTING_TEST(dh_short_pair)
{
gcry_mpi_t p, g;
gcry_mpi_t x1, X1;
@@ -126,43 +126,43 @@ test_dh_default (const gchar *name, guint bits)
gcry_mpi_release (g);
}
-DEFINE_TEST(dh_default_768)
+TESTING_TEST(dh_default_768)
{
test_dh_default ("ietf-ike-grp-modp-768", 768);
}
-DEFINE_TEST(dh_default_1024)
+TESTING_TEST(dh_default_1024)
{
test_dh_default ("ietf-ike-grp-modp-1024", 1024);
}
-DEFINE_TEST(dh_default_1536)
+TESTING_TEST(dh_default_1536)
{
test_dh_default ("ietf-ike-grp-modp-1536", 1536);
}
-DEFINE_TEST(dh_default_2048)
+TESTING_TEST(dh_default_2048)
{
test_dh_default ("ietf-ike-grp-modp-2048", 2048);
}
-DEFINE_TEST(dh_default_3072)
+TESTING_TEST(dh_default_3072)
{
test_dh_default ("ietf-ike-grp-modp-3072", 3072);
}
-DEFINE_TEST(dh_default_4096)
+TESTING_TEST(dh_default_4096)
{
test_dh_default ("ietf-ike-grp-modp-4096", 4096);
}
-DEFINE_TEST(dh_default_8192)
+TESTING_TEST(dh_default_8192)
{
test_dh_default ("ietf-ike-grp-modp-8192", 8192);
}
-DEFINE_TEST(dh_default_bad)
+TESTING_TEST(dh_default_bad)
{
gboolean ret;
gcry_mpi_t p, g;
diff --git a/egg/tests/unit-test-hex.c b/egg/tests/unit-test-hex.c
index 23e3944..fd32f47 100644
--- a/egg/tests/unit-test-hex.c
+++ b/egg/tests/unit-test-hex.c
@@ -33,7 +33,7 @@ static const guchar TEST_DATA[] = { 0x05, 0xD6, 0x95, 0x96, 0x10, 0x12, 0xAE, 0x
static const gchar *TEST_HEX = "05D695961012AE35";
static const gchar *TEST_HEX_DELIM = "05 D6 95 96 10 12 AE 35";
-DEFINE_TEST(hex_encode)
+TESTING_TEST(hex_encode)
{
gchar *hex;
@@ -42,7 +42,7 @@ DEFINE_TEST(hex_encode)
g_assert_cmpstr (hex, ==, TEST_HEX);
}
-DEFINE_TEST(hex_encode_spaces)
+TESTING_TEST(hex_encode_spaces)
{
gchar *hex;
@@ -57,7 +57,7 @@ DEFINE_TEST(hex_encode_spaces)
g_assert_cmpstr (hex, ==, TEST_HEX_DELIM);
}
-DEFINE_TEST(hex_decode)
+TESTING_TEST(hex_decode)
{
guchar *data;
gsize n_data;
@@ -82,7 +82,7 @@ DEFINE_TEST(hex_decode)
g_free (data);
}
-DEFINE_TEST(hex_decode_fail)
+TESTING_TEST(hex_decode_fail)
{
guchar *data;
gsize n_data;
diff --git a/egg/tests/unit-test-oid.c b/egg/tests/unit-test-oid.c
index 7d9c4e2..4630c7e 100644
--- a/egg/tests/unit-test-oid.c
+++ b/egg/tests/unit-test-oid.c
@@ -29,7 +29,7 @@
#include <glib.h>
-DEFINE_TEST(oid_tests)
+TESTING_TEST(oid_tests)
{
GQuark oid;
diff --git a/egg/tests/unit-test-openssl.c b/egg/tests/unit-test-openssl.c
index 29f4474..7b8153b 100644
--- a/egg/tests/unit-test-openssl.c
+++ b/egg/tests/unit-test-openssl.c
@@ -70,7 +70,7 @@ parse_reference (GQuark type, const guchar *data, gsize n_data,
g_assert ("invalid amount of data returned from openssl decrypt" && n_refdata == n_data);
}
-DEFINE_TEST(parse_reference)
+TESTING_TEST(parse_reference)
{
guchar *input;
gsize n_input;
@@ -84,7 +84,7 @@ DEFINE_TEST(parse_reference)
g_assert ("parse_reference() wasn't called" && refdata != NULL);
}
-DEFINE_TEST(write_reference)
+TESTING_TEST(write_reference)
{
const gchar *dekinfo;
guchar *encrypted;
@@ -107,7 +107,7 @@ DEFINE_TEST(write_reference)
static const guchar *TEST_DATA = (guchar*)"ABCDEFGHIJKLMNOPQRSTUVWXYZ123";
const gsize TEST_DATA_L = 29;
-DEFINE_TEST(openssl_roundtrip)
+TESTING_TEST(openssl_roundtrip)
{
const gchar *dekinfo;
gboolean res;
diff --git a/egg/tests/unit-test-secmem.c b/egg/tests/unit-test-secmem.c
index 7afd649..84b68be 100644
--- a/egg/tests/unit-test-secmem.c
+++ b/egg/tests/unit-test-secmem.c
@@ -58,7 +58,7 @@ find_non_zero (gpointer mem, gsize len)
return G_MAXSIZE;
}
-DEFINE_TEST(secmem_alloc_free)
+TESTING_TEST(secmem_alloc_free)
{
gpointer p;
gboolean ret;
@@ -75,7 +75,7 @@ DEFINE_TEST(secmem_alloc_free)
egg_secure_free_full (p, 0);
}
-DEFINE_TEST(secmem_realloc_across)
+TESTING_TEST(secmem_realloc_across)
{
gpointer p, p2;
@@ -90,7 +90,7 @@ DEFINE_TEST(secmem_realloc_across)
g_assert_cmpint (G_MAXSIZE, ==, find_non_zero (p2, 16200));
}
-DEFINE_TEST(secmem_alloc_two)
+TESTING_TEST(secmem_alloc_two)
{
gpointer p, p2;
gboolean ret;
@@ -114,7 +114,7 @@ DEFINE_TEST(secmem_alloc_two)
egg_secure_free_full (p, 0);
}
-DEFINE_TEST(secmem_realloc)
+TESTING_TEST(secmem_realloc)
{
gchar *str = "a test string to see if realloc works properly";
gpointer p, p2;
@@ -138,7 +138,7 @@ DEFINE_TEST(secmem_realloc)
g_assert (p == NULL);
}
-DEFINE_TEST(secmem_multialloc)
+TESTING_TEST(secmem_multialloc)
{
GPtrArray *memory;
gpointer data;
@@ -205,7 +205,7 @@ DEFINE_TEST(secmem_multialloc)
egg_secure_warnings = 1;
}
-DEFINE_TEST(secmem_clear)
+TESTING_TEST(secmem_clear)
{
gpointer p;
@@ -220,7 +220,7 @@ DEFINE_TEST(secmem_clear)
egg_secure_free_full (p, 0);
}
-DEFINE_TEST(secmem_strclear)
+TESTING_TEST(secmem_strclear)
{
gchar *str;
diff --git a/egg/tests/unit-test-spawn.c b/egg/tests/unit-test-spawn.c
index 29c4d7c..e34ff3a 100644
--- a/egg/tests/unit-test-spawn.c
+++ b/egg/tests/unit-test-spawn.c
@@ -160,7 +160,7 @@ static EggSpawnCallbacks null_callbacks = {
child_setup,
};
-DEFINE_TEST(test_spawn_sync)
+TESTING_TEST(test_spawn_sync)
{
GError *error = NULL;
gboolean ret;
@@ -187,7 +187,7 @@ DEFINE_TEST(test_spawn_sync)
g_assert_cmpstr (data.error, ==, "1\n2\n3\n4\n5\n");
}
-DEFINE_TEST(test_spawn_sync_error)
+TESTING_TEST(test_spawn_sync_error)
{
GError *error = NULL;
gboolean ret;
@@ -202,7 +202,7 @@ DEFINE_TEST(test_spawn_sync_error)
}
-DEFINE_TEST(test_spawn_async)
+TESTING_TEST(test_spawn_async)
{
GError *error = NULL;
EchoData data;
@@ -232,7 +232,7 @@ DEFINE_TEST(test_spawn_async)
g_assert_cmpstr (data.error, ==, "1\n2\n3\n4\n5\n");
}
-DEFINE_TEST(test_spawn_async_none)
+TESTING_TEST(test_spawn_async_none)
{
GError *error = NULL;
EchoData data;
@@ -259,7 +259,7 @@ DEFINE_TEST(test_spawn_async_none)
g_assert (!data.output);
}
-DEFINE_TEST(test_spawn_async_error)
+TESTING_TEST(test_spawn_async_error)
{
GError *error = NULL;
guint ret;
diff --git a/egg/tests/unit-test-symkey.c b/egg/tests/unit-test-symkey.c
index 89313f5..c3cf722 100644
--- a/egg/tests/unit-test-symkey.c
+++ b/egg/tests/unit-test-symkey.c
@@ -33,12 +33,12 @@
#include <gcrypt.h>
-DEFINE_SETUP(crypto_setup)
+TESTING_SETUP(crypto_setup)
{
egg_libgcrypt_initialize ();
}
-DEFINE_TEARDOWN(crypto_setup)
+TESTING_TEARDOWN(crypto_setup)
{
}
@@ -122,7 +122,7 @@ static const struct {
#define N_GENERATION_TESTS (sizeof (all_generation_tests) / sizeof (all_generation_tests[0]))
-DEFINE_TEST(generate_key_simple)
+TESTING_TEST(generate_key_simple)
{
int i;
gboolean ret;
@@ -148,7 +148,7 @@ DEFINE_TEST(generate_key_simple)
}
}
-DEFINE_TEST(generate_key_pkcs12)
+TESTING_TEST(generate_key_pkcs12)
{
int i;
gboolean ret;
@@ -174,7 +174,7 @@ DEFINE_TEST(generate_key_pkcs12)
}
}
-DEFINE_TEST(generate_key_pbkdf2)
+TESTING_TEST(generate_key_pbkdf2)
{
int i;
gboolean ret;
@@ -200,7 +200,7 @@ DEFINE_TEST(generate_key_pbkdf2)
}
}
-DEFINE_TEST(generate_key_pbe)
+TESTING_TEST(generate_key_pbe)
{
int i;
gboolean ret;
diff --git a/gck/tests/test-gck-attributes.c b/gck/tests/test-gck-attributes.c
index be6998c..020f224 100644
--- a/gck/tests/test-gck-attributes.c
+++ b/gck/tests/test-gck-attributes.c
@@ -9,7 +9,7 @@
#define ATTR_DATA "TEST DATA"
#define N_ATTR_DATA ((gsize)9)
-DEFINE_TEST(init_memory)
+TESTING_TEST(init_memory)
{
GckAttribute attr;
@@ -23,7 +23,7 @@ DEFINE_TEST(init_memory)
gck_attribute_clear (&attr);
}
-DEFINE_TEST(value_to_boolean)
+TESTING_TEST(value_to_boolean)
{
CK_BBOOL data = CK_TRUE;
gboolean result = FALSE;
@@ -45,7 +45,7 @@ DEFINE_TEST(value_to_boolean)
g_assert_not_reached ();
}
-DEFINE_TEST(value_to_ulong)
+TESTING_TEST(value_to_ulong)
{
CK_ULONG data = 34343;
gulong result = 0;
@@ -67,7 +67,7 @@ DEFINE_TEST(value_to_ulong)
g_assert_not_reached ();
}
-DEFINE_TEST(init_boolean)
+TESTING_TEST(init_boolean)
{
GckAttribute attr;
@@ -79,7 +79,7 @@ DEFINE_TEST(init_boolean)
gck_attribute_clear (&attr);
}
-DEFINE_TEST(init_date)
+TESTING_TEST(init_date)
{
GckAttribute attr;
CK_DATE ck_date;
@@ -98,7 +98,7 @@ DEFINE_TEST(init_date)
gck_attribute_clear (&attr);
}
-DEFINE_TEST(init_ulong)
+TESTING_TEST(init_ulong)
{
GckAttribute attr;
@@ -110,7 +110,7 @@ DEFINE_TEST(init_ulong)
gck_attribute_clear (&attr);
}
-DEFINE_TEST(init_string)
+TESTING_TEST(init_string)
{
GckAttribute attr;
@@ -122,7 +122,7 @@ DEFINE_TEST(init_string)
gck_attribute_clear (&attr);
}
-DEFINE_TEST(init_invalid)
+TESTING_TEST(init_invalid)
{
GckAttribute attr;
@@ -135,7 +135,7 @@ DEFINE_TEST(init_invalid)
gck_attribute_clear (&attr);
}
-DEFINE_TEST(init_empty)
+TESTING_TEST(init_empty)
{
GckAttribute attr;
@@ -147,7 +147,7 @@ DEFINE_TEST(init_empty)
gck_attribute_clear (&attr);
}
-DEFINE_TEST(new_memory)
+TESTING_TEST(new_memory)
{
GckAttribute *attr;
@@ -159,7 +159,7 @@ DEFINE_TEST(new_memory)
gck_attribute_free (attr);
}
-DEFINE_TEST(new_boolean)
+TESTING_TEST(new_boolean)
{
GckAttribute *attr;
@@ -171,7 +171,7 @@ DEFINE_TEST(new_boolean)
gck_attribute_free (attr);
}
-DEFINE_TEST(new_date)
+TESTING_TEST(new_date)
{
GckAttribute *attr;
CK_DATE ck_date;
@@ -190,7 +190,7 @@ DEFINE_TEST(new_date)
gck_attribute_free (attr);
}
-DEFINE_TEST(new_ulong)
+TESTING_TEST(new_ulong)
{
GckAttribute *attr;
@@ -202,7 +202,7 @@ DEFINE_TEST(new_ulong)
gck_attribute_free (attr);
}
-DEFINE_TEST(new_string)
+TESTING_TEST(new_string)
{
GckAttribute *attr;
@@ -214,7 +214,7 @@ DEFINE_TEST(new_string)
gck_attribute_free (attr);
}
-DEFINE_TEST(new_invalid)
+TESTING_TEST(new_invalid)
{
GckAttribute *attr;
@@ -228,7 +228,7 @@ DEFINE_TEST(new_invalid)
gck_attribute_free (attr);
}
-DEFINE_TEST(new_empty)
+TESTING_TEST(new_empty)
{
GckAttribute *attr;
@@ -240,7 +240,7 @@ DEFINE_TEST(new_empty)
gck_attribute_free (attr);
}
-DEFINE_TEST(get_boolean)
+TESTING_TEST(get_boolean)
{
GckAttribute *attr;
@@ -249,7 +249,7 @@ DEFINE_TEST(get_boolean)
gck_attribute_free (attr);
}
-DEFINE_TEST(get_date)
+TESTING_TEST(get_date)
{
GckAttribute *attr;
CK_DATE ck_date;
@@ -265,7 +265,7 @@ DEFINE_TEST(get_date)
gck_attribute_free (attr);
}
-DEFINE_TEST(get_ulong)
+TESTING_TEST(get_ulong)
{
GckAttribute *attr;
@@ -274,7 +274,7 @@ DEFINE_TEST(get_ulong)
gck_attribute_free (attr);
}
-DEFINE_TEST(get_string)
+TESTING_TEST(get_string)
{
GckAttribute *attr;
gchar *value;
@@ -292,7 +292,7 @@ DEFINE_TEST(get_string)
gck_attribute_free (attr);
}
-DEFINE_TEST(dup_attribute)
+TESTING_TEST(dup_attribute)
{
GckAttribute attr, *dup;
@@ -308,7 +308,7 @@ DEFINE_TEST(dup_attribute)
g_assert (dup == NULL);
}
-DEFINE_TEST(copy_attribute)
+TESTING_TEST(copy_attribute)
{
GckAttribute attr, copy;
@@ -320,7 +320,7 @@ DEFINE_TEST(copy_attribute)
gck_attribute_clear (©);
}
-DEFINE_TEST(new_attributes)
+TESTING_TEST(new_attributes)
{
GckAttributes *attrs;
@@ -390,7 +390,7 @@ test_attributes_contents (GckAttributes *attrs, gboolean extras)
g_assert (attr->value == NULL);
}
-DEFINE_TEST(new_empty_attributes)
+TESTING_TEST(new_empty_attributes)
{
GckAttributes *attrs = gck_attributes_new_empty (101UL, 202UL, 303UL, 404UL, GCK_INVALID);
GckAttribute *attr;
@@ -405,7 +405,7 @@ DEFINE_TEST(new_empty_attributes)
}
}
-DEFINE_TEST(add_data_attributes)
+TESTING_TEST(add_data_attributes)
{
GckAttributes *attrs;
GDate *date = g_date_new_dmy (11, 12, 2008);
@@ -422,7 +422,7 @@ DEFINE_TEST(add_data_attributes)
gck_attributes_unref (attrs);
}
-DEFINE_TEST(add_attributes)
+TESTING_TEST(add_attributes)
{
GckAttributes *attrs;
GckAttribute attr;
@@ -462,7 +462,7 @@ DEFINE_TEST(add_attributes)
gck_attributes_unref (attrs);
}
-DEFINE_TEST(add_all_attributes)
+TESTING_TEST(add_all_attributes)
{
GckAttributes *attrs;
GckAttributes *copy;
@@ -486,7 +486,7 @@ DEFINE_TEST(add_all_attributes)
}
-DEFINE_TEST(find_attributes)
+TESTING_TEST(find_attributes)
{
GckAttribute *attr;
GDate check, *date = g_date_new_dmy (13, 12, 2008);
diff --git a/gck/tests/test-gck-crypto.c b/gck/tests/test-gck-crypto.c
index ae9e2a6..05f9615 100644
--- a/gck/tests/test-gck-crypto.c
+++ b/gck/tests/test-gck-crypto.c
@@ -19,7 +19,7 @@ on_discard_handle_ignore (GckSession *self, CK_OBJECT_HANDLE handle, gpointer un
return TRUE;
}
-DEFINE_SETUP(crypto_session)
+TESTING_SETUP(crypto_session)
{
GError *err = NULL;
GList *slots;
@@ -46,7 +46,7 @@ DEFINE_SETUP(crypto_session)
gck_list_unref_free (slots);
}
-DEFINE_TEARDOWN(crypto_session)
+TESTING_TEARDOWN(crypto_session)
{
g_object_unref (session);
g_object_unref (module);
@@ -147,7 +147,7 @@ authenticate_object (GckSlot *module, GckObject *object, gchar *label, gchar **p
return TRUE;
}
-DEFINE_TEST(encrypt)
+TESTING_TEST(encrypt)
{
GckMechanism mech = { CKM_MOCK_CAPITALIZE, NULL, 0 };
GError *error = NULL;
@@ -184,7 +184,7 @@ DEFINE_TEST(encrypt)
g_object_unref (key);
}
-DEFINE_TEST(decrypt)
+TESTING_TEST(decrypt)
{
GckMechanism mech = { CKM_MOCK_CAPITALIZE, NULL, 0 };
GError *error = NULL;
@@ -221,7 +221,7 @@ DEFINE_TEST(decrypt)
g_object_unref (key);
}
-DEFINE_TEST(login_context_specific)
+TESTING_TEST(login_context_specific)
{
/* The test module won't let us sign without doing a login, check that */
@@ -243,7 +243,7 @@ DEFINE_TEST(login_context_specific)
g_object_unref (key);
}
-DEFINE_TEST(sign)
+TESTING_TEST(sign)
{
GckMechanism mech = { CKM_MOCK_PREFIX, "my-prefix:", 10 };
GError *error = NULL;
@@ -283,7 +283,7 @@ DEFINE_TEST(sign)
g_object_unref (key);
}
-DEFINE_TEST(verify)
+TESTING_TEST(verify)
{
GckMechanism mech = { CKM_MOCK_PREFIX, "my-prefix:", 10 };
GError *error = NULL;
@@ -330,7 +330,7 @@ DEFINE_TEST(verify)
g_object_unref (key);
}
-DEFINE_TEST(generate_key_pair)
+TESTING_TEST(generate_key_pair)
{
GckMechanism mech = { CKM_MOCK_GENERATE, "generate", 9 };
GckAttributes *pub_attrs, *prv_attrs;
@@ -388,7 +388,7 @@ DEFINE_TEST(generate_key_pair)
gck_attributes_unref (prv_attrs);
}
-DEFINE_TEST(wrap_key)
+TESTING_TEST(wrap_key)
{
GckMechanism mech = { CKM_MOCK_WRAP, "wrap", 4 };
GError *error = NULL;
@@ -450,7 +450,7 @@ DEFINE_TEST(wrap_key)
g_object_unref (wrapped);
}
-DEFINE_TEST(unwrap_key)
+TESTING_TEST(unwrap_key)
{
GckMechanism mech = { CKM_MOCK_WRAP, "wrap", 4 };
GError *error = NULL;
@@ -500,7 +500,7 @@ DEFINE_TEST(unwrap_key)
gck_attributes_unref (attrs);
}
-DEFINE_TEST(derive_key)
+TESTING_TEST(derive_key)
{
GckMechanism mech = { CKM_MOCK_DERIVE, "derive", 6 };
GError *error = NULL;
diff --git a/gck/tests/test-gck-enumerator.c b/gck/tests/test-gck-enumerator.c
index 01332ad..699b061 100644
--- a/gck/tests/test-gck-enumerator.c
+++ b/gck/tests/test-gck-enumerator.c
@@ -8,7 +8,7 @@
static GList *modules = NULL;
-DEFINE_SETUP(enumerator)
+TESTING_SETUP(enumerator)
{
GckModule *module;
GError *err = NULL;
@@ -20,13 +20,13 @@ DEFINE_SETUP(enumerator)
modules = g_list_append (NULL, module);
}
-DEFINE_TEARDOWN(enumerator)
+TESTING_TEARDOWN(enumerator)
{
gck_list_unref_free (modules);
modules = NULL;
}
-DEFINE_TEST(enumerator_create)
+TESTING_TEST(enumerator_create)
{
GckEnumerator *en;
@@ -35,7 +35,7 @@ DEFINE_TEST(enumerator_create)
g_object_unref (en);
}
-DEFINE_TEST(enumerator_next)
+TESTING_TEST(enumerator_next)
{
GError *error = NULL;
GckEnumerator *en;
@@ -51,7 +51,7 @@ DEFINE_TEST(enumerator_next)
g_object_unref (en);
}
-DEFINE_TEST(enumerator_next_and_resume)
+TESTING_TEST(enumerator_next_and_resume)
{
GError *error = NULL;
GckEnumerator *en;
@@ -75,7 +75,7 @@ DEFINE_TEST(enumerator_next_and_resume)
g_object_unref (en);
}
-DEFINE_TEST(enumerator_next_n)
+TESTING_TEST(enumerator_next_n)
{
GError *error = NULL;
GckEnumerator *en;
@@ -102,7 +102,7 @@ fetch_async_result (GObject *source, GAsyncResult *result, gpointer user_data)
testing_wait_stop ();
}
-DEFINE_TEST(enumerator_next_async)
+TESTING_TEST(enumerator_next_async)
{
GAsyncResult *result = NULL;
GError *error = NULL;
@@ -127,7 +127,7 @@ DEFINE_TEST(enumerator_next_async)
g_object_unref (en);
}
-DEFINE_TEST(enumerator_attributes)
+TESTING_TEST(enumerator_attributes)
{
GckAttributes *attrs;
GError *error = NULL;
@@ -149,7 +149,7 @@ DEFINE_TEST(enumerator_attributes)
g_object_unref (en);
}
-DEFINE_TEST(enumerator_token_match)
+TESTING_TEST(enumerator_token_match)
{
GckTokenInfo *token;
GError *error = NULL;
diff --git a/gck/tests/test-gck-module.c b/gck/tests/test-gck-module.c
index 210ea64..da3574b 100644
--- a/gck/tests/test-gck-module.c
+++ b/gck/tests/test-gck-module.c
@@ -7,7 +7,7 @@
static GckModule *module = NULL;
-DEFINE_SETUP(load_module)
+TESTING_SETUP(load_module)
{
GError *err = NULL;
@@ -16,12 +16,12 @@ DEFINE_SETUP(load_module)
SUCCESS_RES (module, err);
}
-DEFINE_TEARDOWN(load_module)
+TESTING_TEARDOWN(load_module)
{
g_object_unref (module);
}
-DEFINE_TEST(invalid_modules)
+TESTING_TEST(invalid_modules)
{
GckModule *invalid;
GError *err = NULL;
@@ -35,7 +35,7 @@ DEFINE_TEST(invalid_modules)
FAIL_RES (invalid, err);
}
-DEFINE_TEST(module_equals_hash)
+TESTING_TEST(module_equals_hash)
{
GckModule *other;
GObject *obj;
@@ -58,7 +58,7 @@ DEFINE_TEST(module_equals_hash)
g_object_unref (obj);
}
-DEFINE_TEST(module_props)
+TESTING_TEST(module_props)
{
gchar *path;
@@ -68,7 +68,7 @@ DEFINE_TEST(module_props)
g_free (path);
}
-DEFINE_TEST(module_info)
+TESTING_TEST(module_info)
{
GckModuleInfo *info;
@@ -123,7 +123,7 @@ for_first_object (GckObject *object, gpointer user_data)
}
#endif
-DEFINE_TEST(module_enumerate)
+TESTING_TEST(module_enumerate)
{
#if 0
GckSession *session;
diff --git a/gck/tests/test-gck-modules.c b/gck/tests/test-gck-modules.c
index 8436301..06dd93e 100644
--- a/gck/tests/test-gck-modules.c
+++ b/gck/tests/test-gck-modules.c
@@ -7,7 +7,7 @@
static GList *modules = NULL;
-DEFINE_SETUP(modules)
+TESTING_SETUP(modules)
{
GckModule *module;
GError *err = NULL;
@@ -19,13 +19,13 @@ DEFINE_SETUP(modules)
modules = g_list_append (NULL, module);
}
-DEFINE_TEARDOWN(modules)
+TESTING_TEARDOWN(modules)
{
gck_list_unref_free (modules);
modules = NULL;
}
-DEFINE_TEST(modules_enumerate_objects)
+TESTING_TEST(modules_enumerate_objects)
{
GckAttributes *attrs;
GError *error = NULL;
@@ -48,7 +48,7 @@ DEFINE_TEST(modules_enumerate_objects)
}
-DEFINE_TEST(modules_token_for_uri)
+TESTING_TEST(modules_token_for_uri)
{
GckSlot *slot;
GError *error = NULL;
@@ -59,7 +59,7 @@ DEFINE_TEST(modules_token_for_uri)
g_object_unref (slot);
}
-DEFINE_TEST(modules_token_for_uri_not_found)
+TESTING_TEST(modules_token_for_uri_not_found)
{
GckSlot *slot;
GError *error = NULL;
@@ -69,7 +69,7 @@ DEFINE_TEST(modules_token_for_uri_not_found)
g_assert (error == NULL);
}
-DEFINE_TEST(modules_token_for_uri_error)
+TESTING_TEST(modules_token_for_uri_error)
{
GckSlot *slot;
GError *error = NULL;
@@ -81,7 +81,7 @@ DEFINE_TEST(modules_token_for_uri_error)
g_error_free (error);
}
-DEFINE_TEST(modules_object_for_uri)
+TESTING_TEST(modules_object_for_uri)
{
GckObject *object;
GError *error = NULL;
@@ -91,7 +91,7 @@ DEFINE_TEST(modules_object_for_uri)
g_object_unref (object);
}
-DEFINE_TEST(modules_object_for_uri_not_found)
+TESTING_TEST(modules_object_for_uri_not_found)
{
GckObject *object;
GError *error = NULL;
@@ -101,7 +101,7 @@ DEFINE_TEST(modules_object_for_uri_not_found)
g_assert (error == NULL);
}
-DEFINE_TEST(modules_object_for_uri_error)
+TESTING_TEST(modules_object_for_uri_error)
{
GckObject *object;
GError *error = NULL;
@@ -113,7 +113,7 @@ DEFINE_TEST(modules_object_for_uri_error)
g_error_free (error);
}
-DEFINE_TEST(modules_objects_for_uri)
+TESTING_TEST(modules_objects_for_uri)
{
GList *objects;
GError *error = NULL;
@@ -126,7 +126,7 @@ DEFINE_TEST(modules_objects_for_uri)
gck_list_unref_free (objects);
}
-DEFINE_TEST(modules_enumerate_uri)
+TESTING_TEST(modules_enumerate_uri)
{
GckEnumerator *en;
GList *objects;
diff --git a/gck/tests/test-gck-object.c b/gck/tests/test-gck-object.c
index 08266fc..7fc4a53 100644
--- a/gck/tests/test-gck-object.c
+++ b/gck/tests/test-gck-object.c
@@ -13,7 +13,7 @@ static GckSlot *slot = NULL;
static GckSession *session = NULL;
static GckObject *object = NULL;
-DEFINE_SETUP(prep_object)
+TESTING_SETUP(prep_object)
{
GError *err = NULL;
GList *slots;
@@ -37,7 +37,7 @@ DEFINE_SETUP(prep_object)
g_assert (object != NULL);
}
-DEFINE_TEARDOWN(prep_object)
+TESTING_TEARDOWN(prep_object)
{
g_object_unref (object);
g_object_unref (session);
@@ -45,7 +45,7 @@ DEFINE_TEARDOWN(prep_object)
g_object_unref (module);
}
-DEFINE_TEST(object_props)
+TESTING_TEST(object_props)
{
GckSession *sess;
GckModule *mod;
@@ -58,7 +58,7 @@ DEFINE_TEST(object_props)
g_assert (handle == 2);
}
-DEFINE_TEST(object_equals_hash)
+TESTING_TEST(object_equals_hash)
{
GckSlot *other_slot;
GckSession *other_session;
@@ -102,7 +102,7 @@ fetch_async_result (GObject *source, GAsyncResult *result, gpointer user_data)
testing_wait_stop ();
}
-DEFINE_TEST(create_object)
+TESTING_TEST(create_object)
{
GAsyncResult *result = NULL;
GckAttributes *attrs;
@@ -139,7 +139,7 @@ DEFINE_TEST(create_object)
gck_attributes_unref (attrs);
}
-DEFINE_TEST(destroy_object)
+TESTING_TEST(destroy_object)
{
GAsyncResult *result = NULL;
GckAttributes *attrs;
@@ -177,7 +177,7 @@ DEFINE_TEST(destroy_object)
g_object_unref (object);
}
-DEFINE_TEST(get_attributes)
+TESTING_TEST(get_attributes)
{
GAsyncResult *result = NULL;
GckAttributes *attrs;
@@ -225,7 +225,7 @@ DEFINE_TEST(get_attributes)
gck_attributes_unref (attrs);
}
-DEFINE_TEST(get_data_attribute)
+TESTING_TEST(get_data_attribute)
{
GAsyncResult *result = NULL;
CK_OBJECT_CLASS_PTR klass;
@@ -266,7 +266,7 @@ DEFINE_TEST(get_data_attribute)
}
-DEFINE_TEST(set_attributes)
+TESTING_TEST(set_attributes)
{
GAsyncResult *result = NULL;
GckAttributes *attrs, *templ;
@@ -312,7 +312,7 @@ DEFINE_TEST(set_attributes)
}
}
-DEFINE_TEST(find_objects)
+TESTING_TEST(find_objects)
{
GAsyncResult *result = NULL;
GckAttributes *templ, *attrs;
diff --git a/gck/tests/test-gck-session.c b/gck/tests/test-gck-session.c
index 4fcc464..1608800 100644
--- a/gck/tests/test-gck-session.c
+++ b/gck/tests/test-gck-session.c
@@ -12,7 +12,7 @@ static GckModule *module = NULL;
static GckSlot *slot = NULL;
static GckSession *session = NULL;
-DEFINE_SETUP(load_session)
+TESTING_SETUP(load_session)
{
GError *err = NULL;
GList *slots;
@@ -32,14 +32,14 @@ DEFINE_SETUP(load_session)
SUCCESS_RES(session, err);
}
-DEFINE_TEARDOWN(load_session)
+TESTING_TEARDOWN(load_session)
{
g_object_unref (session);
g_object_unref (slot);
g_object_unref (module);
}
-DEFINE_TEST(session_props)
+TESTING_TEST(session_props)
{
GckModule *mod;
GckSlot *sl;
@@ -55,7 +55,7 @@ DEFINE_TEST(session_props)
g_assert (gck_session_get_handle (session) == handle);
}
-DEFINE_TEST(session_info)
+TESTING_TEST(session_info)
{
GckSessionInfo *info;
@@ -76,7 +76,7 @@ fetch_async_result (GObject *source, GAsyncResult *result, gpointer user_data)
testing_wait_stop ();
}
-DEFINE_TEST(open_close_session)
+TESTING_TEST(open_close_session)
{
GckSession *sess;
GAsyncResult *result = NULL;
@@ -101,7 +101,7 @@ DEFINE_TEST(open_close_session)
g_object_unref (sess);
}
-DEFINE_TEST(init_set_pin)
+TESTING_TEST(init_set_pin)
{
GAsyncResult *result = NULL;
GError *err = NULL;
@@ -135,7 +135,7 @@ DEFINE_TEST(init_set_pin)
}
-DEFINE_TEST(login_logout)
+TESTING_TEST(login_logout)
{
GAsyncResult *result = NULL;
GError *err = NULL;
@@ -185,7 +185,7 @@ authenticate_token (GckModule *module, GckSlot *slot, gchar *label, gchar **pass
return TRUE;
}
-DEFINE_TEST(auto_login)
+TESTING_TEST(auto_login)
{
GckObject *object;
GckSession *new_session;
diff --git a/gck/tests/test-gck-slot.c b/gck/tests/test-gck-slot.c
index f8fb189..0778d74 100644
--- a/gck/tests/test-gck-slot.c
+++ b/gck/tests/test-gck-slot.c
@@ -9,7 +9,7 @@
static GckModule *module = NULL;
static GckSlot *slot = NULL;
-DEFINE_SETUP(load_slots)
+TESTING_SETUP(load_slots)
{
GError *err = NULL;
GList *slots;
@@ -27,13 +27,13 @@ DEFINE_SETUP(load_slots)
}
-DEFINE_TEARDOWN(load_slots)
+TESTING_TEARDOWN(load_slots)
{
g_object_unref (slot);
g_object_unref (module);
}
-DEFINE_TEST(slot_info)
+TESTING_TEST(slot_info)
{
GckSlotInfo *info;
GckTokenInfo *token;
@@ -88,7 +88,7 @@ DEFINE_TEST(slot_info)
gck_list_unref_free (slots);
}
-DEFINE_TEST(slot_props)
+TESTING_TEST(slot_props)
{
GckModule *mod;
CK_SLOT_ID slot_id;
@@ -100,7 +100,7 @@ DEFINE_TEST(slot_props)
g_object_unref (mod);
}
-DEFINE_TEST(slot_equals_hash)
+TESTING_TEST(slot_equals_hash)
{
GckModule *other_mod;
GckSlot *other_slot;
@@ -127,7 +127,7 @@ DEFINE_TEST(slot_equals_hash)
g_object_unref (other_slot);
}
-DEFINE_TEST(slot_mechanisms)
+TESTING_TEST(slot_mechanisms)
{
GckMechanisms *mechs;
GckMechanismInfo *info;
@@ -147,7 +147,7 @@ DEFINE_TEST(slot_mechanisms)
gck_mechanisms_free (mechs);
}
-DEFINE_TEST(token_info_match_null)
+TESTING_TEST(token_info_match_null)
{
GckTokenInfo *match;
GckTokenInfo *token;
@@ -164,7 +164,7 @@ DEFINE_TEST(token_info_match_null)
gck_token_info_free (token);
}
-DEFINE_TEST(token_info_match_label)
+TESTING_TEST(token_info_match_label)
{
GckTokenInfo *match;
GckTokenInfo *token;
@@ -183,7 +183,7 @@ DEFINE_TEST(token_info_match_label)
gck_token_info_free (token);
}
-DEFINE_TEST(token_info_match_different)
+TESTING_TEST(token_info_match_different)
{
GckTokenInfo *match;
GckTokenInfo *token;
diff --git a/gck/tests/test-gck-uri.c b/gck/tests/test-gck-uri.c
index b129f13..03b8a2b 100644
--- a/gck/tests/test-gck-uri.c
+++ b/gck/tests/test-gck-uri.c
@@ -6,24 +6,24 @@
#include "gck-test.h"
#include "gck-private.h"
-DEFINE_SETUP(uri)
+TESTING_SETUP(uri)
{
}
-DEFINE_TEARDOWN(uri)
+TESTING_TEARDOWN(uri)
{
}
-DEFINE_TEST(uri_parse)
+TESTING_TEST(uri_parse)
{
GError *error = NULL;
if (!gck_uri_parse ("pkcs11:", NULL, NULL, &error))
g_assert_not_reached ();
}
-DEFINE_TEST(uri_parse_bad_scheme)
+TESTING_TEST(uri_parse_bad_scheme)
{
GError *error = NULL;
if (gck_uri_parse ("http:\\example.com\test", NULL, NULL, &error))
@@ -32,7 +32,7 @@ DEFINE_TEST(uri_parse_bad_scheme)
g_error_free (error);
}
-DEFINE_TEST(uri_parse_with_label)
+TESTING_TEST(uri_parse_with_label)
{
GError *error = NULL;
GckAttributes *attrs;
@@ -47,7 +47,7 @@ DEFINE_TEST(uri_parse_with_label)
g_assert_cmpstr (value, ==, "Test Label");
g_free (value);
}
-DEFINE_TEST(uri_parse_with_label_and_klass)
+TESTING_TEST(uri_parse_with_label_and_klass)
{
GError *error = NULL;
GckAttributes *attrs;
@@ -68,7 +68,7 @@ DEFINE_TEST(uri_parse_with_label_and_klass)
g_free (value);
}
-DEFINE_TEST(uri_parse_with_id)
+TESTING_TEST(uri_parse_with_id)
{
GError *error = NULL;
GckAttributes *attrs;
@@ -86,7 +86,7 @@ DEFINE_TEST(uri_parse_with_id)
gck_attributes_unref (attrs);
}
-DEFINE_TEST(uri_parse_with_bad_string_encoding)
+TESTING_TEST(uri_parse_with_bad_string_encoding)
{
GError *error = NULL;
if (gck_uri_parse ("pkcs11:object=Test%", NULL, NULL, &error))
@@ -95,7 +95,7 @@ DEFINE_TEST(uri_parse_with_bad_string_encoding)
g_error_free (error);
}
-DEFINE_TEST(uri_parse_with_bad_binary_encoding)
+TESTING_TEST(uri_parse_with_bad_binary_encoding)
{
GError *error = NULL;
if (gck_uri_parse ("pkcs11:id=xxxxx", NULL, NULL, &error))
@@ -104,7 +104,7 @@ DEFINE_TEST(uri_parse_with_bad_binary_encoding)
g_error_free (error);
}
-DEFINE_TEST(uri_parse_with_token)
+TESTING_TEST(uri_parse_with_token)
{
GError *error = NULL;
GckTokenInfo *token = NULL;
@@ -121,7 +121,7 @@ DEFINE_TEST(uri_parse_with_token)
gck_token_info_free (token);
}
-DEFINE_TEST(uri_parse_with_token_bad_encoding)
+TESTING_TEST(uri_parse_with_token_bad_encoding)
{
GError *error = NULL;
@@ -132,7 +132,7 @@ DEFINE_TEST(uri_parse_with_token_bad_encoding)
g_error_free (error);
}
-DEFINE_TEST(uri_parse_with_bad_syntax)
+TESTING_TEST(uri_parse_with_bad_syntax)
{
GError *error = NULL;
@@ -143,7 +143,7 @@ DEFINE_TEST(uri_parse_with_bad_syntax)
g_error_free (error);
}
-DEFINE_TEST(uri_build_empty)
+TESTING_TEST(uri_build_empty)
{
gchar *uri = NULL;
@@ -152,7 +152,7 @@ DEFINE_TEST(uri_build_empty)
g_free (uri);
}
-DEFINE_TEST(uri_build_with_token_info)
+TESTING_TEST(uri_build_with_token_info)
{
gchar *uri = NULL;
GckTokenInfo *token;
@@ -184,7 +184,7 @@ DEFINE_TEST(uri_build_with_token_info)
g_free (uri);
}
-DEFINE_TEST(uri_build_with_attributes)
+TESTING_TEST(uri_build_with_attributes)
{
gchar *uri = NULL;
GckAttributes *attrs;
diff --git a/gcr/tests/test-trust.c b/gcr/tests/test-trust.c
index 480d40e..1e9f4c5 100644
--- a/gcr/tests/test-trust.c
+++ b/gcr/tests/test-trust.c
@@ -38,7 +38,7 @@ static CK_FUNCTION_LIST_PTR funcs;
static GList *modules = NULL;
static GcrCertificate *certificate = NULL;
-DEFINE_SETUP (trust_setup)
+TESTING_SETUP (trust_setup)
{
GckModule *module;
guchar *contents;
@@ -65,7 +65,7 @@ DEFINE_SETUP (trust_setup)
_gcr_set_test_trust_slot (GCK_MOCK_SLOT_ONE_URI);
}
-DEFINE_TEARDOWN (trust_setup)
+TESTING_TEARDOWN (trust_setup)
{
CK_RV rv;
@@ -80,7 +80,7 @@ DEFINE_TEARDOWN (trust_setup)
modules = NULL;
}
-DEFINE_TEST (trust_is_exception_none)
+TESTING_TEST (trust_is_exception_none)
{
GError *error = NULL;
gboolean trust;
@@ -90,7 +90,7 @@ DEFINE_TEST (trust_is_exception_none)
g_assert (error == NULL);
}
-DEFINE_TEST (trust_add_and_is_exception)
+TESTING_TEST (trust_add_and_is_exception)
{
GError *error = NULL;
gboolean trust;
@@ -109,7 +109,7 @@ DEFINE_TEST (trust_add_and_is_exception)
g_assert (error == NULL);
}
-DEFINE_TEST (trust_add_and_remov_exception)
+TESTING_TEST (trust_add_and_remov_exception)
{
GError *error = NULL;
gboolean trust;
@@ -140,7 +140,7 @@ fetch_async_result (GObject *source, GAsyncResult *result, gpointer user_data)
testing_wait_stop ();
}
-DEFINE_TEST (trust_add_and_is_exception_async)
+TESTING_TEST (trust_add_and_is_exception_async)
{
GAsyncResult *result = NULL;
GError *error = NULL;
@@ -176,7 +176,7 @@ DEFINE_TEST (trust_add_and_is_exception_async)
result = NULL;
}
-DEFINE_TEST (trust_is_certificate_anchor_not)
+TESTING_TEST (trust_is_certificate_anchor_not)
{
GError *error = NULL;
gboolean ret;
@@ -186,7 +186,7 @@ DEFINE_TEST (trust_is_certificate_anchor_not)
g_assert (error == NULL);
}
-DEFINE_TEST (trust_is_certificate_anchor_yes)
+TESTING_TEST (trust_is_certificate_anchor_yes)
{
GError *error = NULL;
GckAttributes *attrs;
@@ -217,7 +217,7 @@ DEFINE_TEST (trust_is_certificate_anchor_yes)
g_assert (error == NULL);
}
-DEFINE_TEST (trust_is_certificate_anchor_async)
+TESTING_TEST (trust_is_certificate_anchor_async)
{
GAsyncResult *result = NULL;
GError *error = NULL;
diff --git a/gcr/tests/unit-test-certificate.c b/gcr/tests/unit-test-certificate.c
index 6b43b8a..5e51e74 100644
--- a/gcr/tests/unit-test-certificate.c
+++ b/gcr/tests/unit-test-certificate.c
@@ -11,7 +11,7 @@
static GcrCertificate *certificate = NULL;
-DEFINE_SETUP(certificate)
+TESTING_SETUP(certificate)
{
guchar *contents;
gsize n_contents;
@@ -22,14 +22,14 @@ DEFINE_SETUP(certificate)
g_free (contents);
}
-DEFINE_TEARDOWN(certificate)
+TESTING_TEARDOWN(certificate)
{
if (certificate)
g_object_unref (certificate);
certificate = NULL;
}
-DEFINE_TEST(issuer_cn)
+TESTING_TEST(issuer_cn)
{
gchar *cn = gcr_certificate_get_issuer_cn (certificate);
g_assert (cn);
@@ -37,7 +37,7 @@ DEFINE_TEST(issuer_cn)
g_free (cn);
}
-DEFINE_TEST(issuer_dn)
+TESTING_TEST(issuer_dn)
{
gchar *dn = gcr_certificate_get_issuer_dn (certificate);
g_assert (dn);
@@ -45,7 +45,7 @@ DEFINE_TEST(issuer_dn)
g_free (dn);
}
-DEFINE_TEST(issuer_part)
+TESTING_TEST(issuer_part)
{
gchar *part = gcr_certificate_get_issuer_part (certificate, "l");
g_assert (part);
@@ -53,7 +53,7 @@ DEFINE_TEST(issuer_part)
g_free (part);
}
-DEFINE_TEST(issuer_raw)
+TESTING_TEST(issuer_raw)
{
gpointer der;
gsize n_der;
@@ -64,7 +64,7 @@ DEFINE_TEST(issuer_raw)
g_free (der);
}
-DEFINE_TEST(subject_cn)
+TESTING_TEST(subject_cn)
{
gchar *cn = gcr_certificate_get_subject_cn (certificate);
g_assert (cn);
@@ -72,7 +72,7 @@ DEFINE_TEST(subject_cn)
g_free (cn);
}
-DEFINE_TEST(subject_dn)
+TESTING_TEST(subject_dn)
{
gchar *dn = gcr_certificate_get_subject_dn (certificate);
g_assert (dn);
@@ -80,7 +80,7 @@ DEFINE_TEST(subject_dn)
g_free (dn);
}
-DEFINE_TEST(subject_part)
+TESTING_TEST(subject_part)
{
gchar *part = gcr_certificate_get_subject_part (certificate, "OU");
g_assert (part);
@@ -88,7 +88,7 @@ DEFINE_TEST(subject_part)
g_free (part);
}
-DEFINE_TEST(subject_raw)
+TESTING_TEST(subject_raw)
{
gpointer der;
gsize n_der;
@@ -99,7 +99,7 @@ DEFINE_TEST(subject_raw)
g_free (der);
}
-DEFINE_TEST(issued_date)
+TESTING_TEST(issued_date)
{
GDate *date = gcr_certificate_get_issued_date (certificate);
g_assert (date);
@@ -109,7 +109,7 @@ DEFINE_TEST(issued_date)
g_date_free (date);
}
-DEFINE_TEST(expiry_date)
+TESTING_TEST(expiry_date)
{
GDate *date = gcr_certificate_get_expiry_date (certificate);
g_assert (date);
@@ -119,7 +119,7 @@ DEFINE_TEST(expiry_date)
g_date_free (date);
}
-DEFINE_TEST(serial_number)
+TESTING_TEST(serial_number)
{
gsize n_serial;
guchar *serial;
@@ -137,7 +137,7 @@ DEFINE_TEST(serial_number)
g_free (hex);
}
-DEFINE_TEST(fingerprint)
+TESTING_TEST(fingerprint)
{
gsize n_print;
guchar *print = gcr_certificate_get_fingerprint (certificate, G_CHECKSUM_MD5, &n_print);
@@ -147,7 +147,7 @@ DEFINE_TEST(fingerprint)
g_free (print);
}
-DEFINE_TEST(fingerprint_hex)
+TESTING_TEST(fingerprint_hex)
{
gchar *print = gcr_certificate_get_fingerprint_hex (certificate, G_CHECKSUM_MD5);
g_assert (print);
diff --git a/gcr/tests/unit-test-parser.c b/gcr/tests/unit-test-parser.c
index f62a07b..256bd63 100644
--- a/gcr/tests/unit-test-parser.c
+++ b/gcr/tests/unit-test-parser.c
@@ -91,20 +91,20 @@ authenticate (GcrParser *par, gint state, gpointer user_data)
};
}
-DEFINE_SETUP(parser)
+TESTING_SETUP(parser)
{
parser = gcr_parser_new ();
g_signal_connect (parser, "parsed", G_CALLBACK (parsed_item), parser);
g_signal_connect (parser, "authenticate", G_CALLBACK (authenticate), parser);
}
-DEFINE_TEARDOWN(parser)
+TESTING_TEARDOWN(parser)
{
g_object_unref (parser);
parser = NULL;
}
-DEFINE_TEST(parse_all)
+TESTING_TEST(parse_all)
{
guchar *contents;
GError *err = NULL;
diff --git a/pkcs11/gkm/tests/Makefile.am b/pkcs11/gkm/tests/Makefile.am
index 7094bbc..c51b600 100644
--- a/pkcs11/gkm/tests/Makefile.am
+++ b/pkcs11/gkm/tests/Makefile.am
@@ -2,6 +2,11 @@
asn1-def-test.h: test.asn
$(ASN1PARSER) -o asn1-def-test.h $(srcdir)/test.asn
+TESTING_SOURCES = \
+ asn1-def-test.h \
+ test-module.c test-module.h \
+ mock-locked-object.c mock-locked-object.h
+
# Test files should be listed in order they need to run
TESTING_FILES = \
unit-test-attributes.c \
@@ -15,12 +20,7 @@ TESTING_FILES = \
unit-test-store.c \
unit-test-memory-store.c \
unit-test-secret.c \
- mock-locked-object.c mock-locked-object.h \
- unit-test-file-tracker.c \
- test-module.c test-module.h \
- asn1-def-test.h
-
-UNIT_PROMPT =
+ unit-test-file-tracker.c
TESTING_LIBS = \
$(top_builddir)/pkcs11/gkm/libgkm.la \
diff --git a/pkcs11/gkm/tests/unit-test-attributes.c b/pkcs11/gkm/tests/unit-test-attributes.c
index a60ab64..a7b1540 100644
--- a/pkcs11/gkm/tests/unit-test-attributes.c
+++ b/pkcs11/gkm/tests/unit-test-attributes.c
@@ -36,14 +36,14 @@ static CK_ATTRIBUTE attr_template[] = {
{ CKA_VALUE, "\a[\315\025", 4 }
};
-DEFINE_TEST(attribute_equal_zero_len_null_ptr)
+TESTING_TEST(attribute_equal_zero_len_null_ptr)
{
CK_ATTRIBUTE attr1 = { CKA_LABEL, "", 0 };
CK_ATTRIBUTE attr2 = { CKA_LABEL, NULL, 0 };
g_assert (gkm_attribute_equal (&attr1, &attr2));
}
-DEFINE_TEST(attribute_consume)
+TESTING_TEST(attribute_consume)
{
CK_ATTRIBUTE attr;
attr.type = CKA_LABEL;
@@ -52,7 +52,7 @@ DEFINE_TEST(attribute_consume)
g_assert (attr.type == (gulong)-1);
}
-DEFINE_TEST(attribute_consumed)
+TESTING_TEST(attribute_consumed)
{
CK_ATTRIBUTE attr;
gboolean ret;
@@ -68,7 +68,7 @@ DEFINE_TEST(attribute_consumed)
g_assert (ret == TRUE);
}
-DEFINE_TEST(attribute_set_data)
+TESTING_TEST(attribute_set_data)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, sizeof (buffer) };
@@ -80,7 +80,7 @@ DEFINE_TEST(attribute_set_data)
g_assert (memcmp (buffer, "mytest", 6) == 0);
}
-DEFINE_TEST(attribute_set_data_short)
+TESTING_TEST(attribute_set_data_short)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, 4 };
@@ -91,7 +91,7 @@ DEFINE_TEST(attribute_set_data_short)
g_assert (attr.ulValueLen == (CK_ULONG)-1);
}
-DEFINE_TEST(attribute_set_data_length)
+TESTING_TEST(attribute_set_data_length)
{
CK_ATTRIBUTE attr = { 0, NULL, 0 };
CK_RV rv;
@@ -101,7 +101,7 @@ DEFINE_TEST(attribute_set_data_length)
g_assert (attr.ulValueLen == 6);
}
-DEFINE_TEST(attribute_set_empty)
+TESTING_TEST(attribute_set_empty)
{
CK_ATTRIBUTE attr;
gchar buf[30];
@@ -114,7 +114,7 @@ DEFINE_TEST(attribute_set_empty)
g_assert (attr.ulValueLen == 0);
}
-DEFINE_TEST(attribute_get_bool)
+TESTING_TEST(attribute_get_bool)
{
CK_ATTRIBUTE attr;
CK_BBOOL val = CK_TRUE;
@@ -128,7 +128,7 @@ DEFINE_TEST(attribute_get_bool)
g_assert (value == TRUE);
}
-DEFINE_TEST(attribute_get_bool_invalid)
+TESTING_TEST(attribute_get_bool_invalid)
{
CK_ATTRIBUTE attr;
CK_ULONG val = 4;
@@ -141,7 +141,7 @@ DEFINE_TEST(attribute_get_bool_invalid)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST(attribute_set_time)
+TESTING_TEST(attribute_set_time)
{
CK_ATTRIBUTE attr;
gchar buf[30];
@@ -155,7 +155,7 @@ DEFINE_TEST(attribute_set_time)
g_assert (memcmp (attr.pValue, "2009071815161100", 16) == 0);
}
-DEFINE_TEST(attribute_set_time_empty)
+TESTING_TEST(attribute_set_time_empty)
{
CK_ATTRIBUTE attr;
gchar buf[30];
@@ -168,7 +168,7 @@ DEFINE_TEST(attribute_set_time_empty)
g_assert (attr.ulValueLen == 0);
}
-DEFINE_TEST(attribute_set_time_length)
+TESTING_TEST(attribute_set_time_length)
{
CK_ATTRIBUTE attr;
CK_RV rv;
@@ -181,7 +181,7 @@ DEFINE_TEST(attribute_set_time_length)
g_assert (attr.pValue == NULL);
}
-DEFINE_TEST(attribute_get_time)
+TESTING_TEST(attribute_get_time)
{
CK_ATTRIBUTE attr;
glong when;
@@ -194,7 +194,7 @@ DEFINE_TEST(attribute_get_time)
g_assert (when == 1247930171);
}
-DEFINE_TEST(attribute_get_time_empty)
+TESTING_TEST(attribute_get_time_empty)
{
CK_ATTRIBUTE attr;
glong when;
@@ -207,7 +207,7 @@ DEFINE_TEST(attribute_get_time_empty)
g_assert (when == -1);
}
-DEFINE_TEST(attribute_get_time_invalid)
+TESTING_TEST(attribute_get_time_invalid)
{
CK_ATTRIBUTE attr;
glong when;
@@ -219,7 +219,7 @@ DEFINE_TEST(attribute_get_time_invalid)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST(attribute_get_time_invalid_length)
+TESTING_TEST(attribute_get_time_invalid_length)
{
CK_ATTRIBUTE attr;
glong when;
@@ -231,7 +231,7 @@ DEFINE_TEST(attribute_get_time_invalid_length)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST(attribute_get_string)
+TESTING_TEST(attribute_get_string)
{
CK_ATTRIBUTE attr;
gchar *value;
@@ -247,7 +247,7 @@ DEFINE_TEST(attribute_get_string)
g_free (value);
}
-DEFINE_TEST(attribute_get_string_null)
+TESTING_TEST(attribute_get_string_null)
{
CK_ATTRIBUTE attr;
gchar *value;
@@ -261,7 +261,7 @@ DEFINE_TEST(attribute_get_string_null)
g_assert (value == NULL);
}
-DEFINE_TEST(attribute_get_string_not_utf8)
+TESTING_TEST(attribute_get_string_not_utf8)
{
CK_ATTRIBUTE attr;
gchar *value;
@@ -275,7 +275,7 @@ DEFINE_TEST(attribute_get_string_not_utf8)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST(attribute_get_string_bad_pointer)
+TESTING_TEST(attribute_get_string_bad_pointer)
{
CK_ATTRIBUTE attr;
gchar *value;
@@ -289,7 +289,7 @@ DEFINE_TEST(attribute_get_string_bad_pointer)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST(attribute_set_bool)
+TESTING_TEST(attribute_set_bool)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, sizeof (buffer) };
@@ -306,7 +306,7 @@ DEFINE_TEST(attribute_set_bool)
g_assert (memcmp (buffer, "\0", 1) == 0);
}
-DEFINE_TEST(attribute_set_bool_short)
+TESTING_TEST(attribute_set_bool_short)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, 0 };
@@ -317,7 +317,7 @@ DEFINE_TEST(attribute_set_bool_short)
g_assert (attr.ulValueLen == (CK_ULONG)-1);
}
-DEFINE_TEST(attribute_set_bool_length)
+TESTING_TEST(attribute_set_bool_length)
{
CK_ATTRIBUTE attr = { 0, NULL, 0 };
CK_RV rv;
@@ -327,7 +327,7 @@ DEFINE_TEST(attribute_set_bool_length)
g_assert (attr.ulValueLen == 1);
}
-DEFINE_TEST(attribute_set_ulong)
+TESTING_TEST(attribute_set_ulong)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, sizeof (buffer) };
@@ -340,7 +340,7 @@ DEFINE_TEST(attribute_set_ulong)
g_assert (memcmp (buffer, &value, sizeof (CK_ULONG)) == 0);
}
-DEFINE_TEST(attribute_set_ulong_short)
+TESTING_TEST(attribute_set_ulong_short)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, 0 };
@@ -351,7 +351,7 @@ DEFINE_TEST(attribute_set_ulong_short)
g_assert (attr.ulValueLen == (CK_ULONG)-1);
}
-DEFINE_TEST(attribute_set_ulong_length)
+TESTING_TEST(attribute_set_ulong_length)
{
CK_ATTRIBUTE attr = { 0, NULL, 0 };
CK_RV rv;
@@ -361,7 +361,7 @@ DEFINE_TEST(attribute_set_ulong_length)
g_assert (attr.ulValueLen == sizeof (CK_ULONG));
}
-DEFINE_TEST(attribute_set_string)
+TESTING_TEST(attribute_set_string)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, sizeof (buffer) };
@@ -373,7 +373,7 @@ DEFINE_TEST(attribute_set_string)
g_assert (memcmp (buffer, "hello", 5) == 0);
}
-DEFINE_TEST(attribute_set_string_null)
+TESTING_TEST(attribute_set_string_null)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, sizeof (buffer) };
@@ -384,7 +384,7 @@ DEFINE_TEST(attribute_set_string_null)
g_assert (attr.ulValueLen == 0);
}
-DEFINE_TEST(attribute_set_string_short)
+TESTING_TEST(attribute_set_string_short)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, 3 };
@@ -395,7 +395,7 @@ DEFINE_TEST(attribute_set_string_short)
g_assert (attr.ulValueLen == (CK_ULONG)-1);
}
-DEFINE_TEST(attribute_set_string_length)
+TESTING_TEST(attribute_set_string_length)
{
CK_ATTRIBUTE attr = { 0, NULL, 0 };
CK_RV rv;
@@ -405,7 +405,7 @@ DEFINE_TEST(attribute_set_string_length)
g_assert (attr.ulValueLen == 5);
}
-DEFINE_TEST(attribute_set_date)
+TESTING_TEST(attribute_set_date)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, sizeof (buffer) };
@@ -421,7 +421,7 @@ DEFINE_TEST(attribute_set_date)
g_assert (memcmp (date->year, "2009", 4) == 0);
}
-DEFINE_TEST(attribute_set_date_none)
+TESTING_TEST(attribute_set_date_none)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, sizeof (buffer) };
@@ -432,7 +432,7 @@ DEFINE_TEST(attribute_set_date_none)
g_assert (attr.ulValueLen == 0);
}
-DEFINE_TEST(attribute_set_date_short)
+TESTING_TEST(attribute_set_date_short)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, 5 };
@@ -443,7 +443,7 @@ DEFINE_TEST(attribute_set_date_short)
g_assert (attr.ulValueLen == (CK_ULONG)-1);
}
-DEFINE_TEST(attribute_set_date_length)
+TESTING_TEST(attribute_set_date_length)
{
CK_ATTRIBUTE attr = { 0, NULL, 0 };
CK_RV rv;
@@ -453,7 +453,7 @@ DEFINE_TEST(attribute_set_date_length)
g_assert (attr.ulValueLen == sizeof (CK_DATE));
}
-DEFINE_TEST(attribute_set_mpi)
+TESTING_TEST(attribute_set_mpi)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, sizeof (buffer) };
@@ -471,7 +471,7 @@ DEFINE_TEST(attribute_set_mpi)
gcry_mpi_release (mpi);
}
-DEFINE_TEST(attribute_set_mpi_short)
+TESTING_TEST(attribute_set_mpi_short)
{
guchar buffer[32];
CK_ATTRIBUTE attr = { 0, buffer, 2 };
@@ -488,7 +488,7 @@ DEFINE_TEST(attribute_set_mpi_short)
gcry_mpi_release (mpi);
}
-DEFINE_TEST(attribute_set_mpi_length)
+TESTING_TEST(attribute_set_mpi_length)
{
CK_ATTRIBUTE attr = { 0, NULL, 0 };
gcry_mpi_t mpi;
@@ -504,7 +504,7 @@ DEFINE_TEST(attribute_set_mpi_length)
gcry_mpi_release (mpi);
}
-DEFINE_TEST(attribute_equal)
+TESTING_TEST(attribute_equal)
{
/* Make sure we actually have two different strings */
gchar *val1 = g_strdup ("my-identifier");
@@ -520,7 +520,7 @@ DEFINE_TEST(attribute_equal)
g_free (val2);
}
-DEFINE_TEST(attribute_equal_same)
+TESTING_TEST(attribute_equal_same)
{
CK_ATTRIBUTE attr = { CKA_ID, "my-identifier", 13 };
gboolean ret;
@@ -529,7 +529,7 @@ DEFINE_TEST(attribute_equal_same)
g_assert (ret == TRUE);
}
-DEFINE_TEST(attribute_equal_same_pointer)
+TESTING_TEST(attribute_equal_same_pointer)
{
gchar *val = "my-identifier";
CK_ATTRIBUTE attr1 = { CKA_ID, val, 13 };
@@ -540,7 +540,7 @@ DEFINE_TEST(attribute_equal_same_pointer)
g_assert (ret == TRUE);
}
-DEFINE_TEST(attribute_equal_diff_types)
+TESTING_TEST(attribute_equal_diff_types)
{
gchar *val = "my-identifier";
CK_ATTRIBUTE attr1 = { CKA_ID, val, 13 };
@@ -551,7 +551,7 @@ DEFINE_TEST(attribute_equal_diff_types)
g_assert (ret == FALSE);
}
-DEFINE_TEST(attribute_equal_diff_length)
+TESTING_TEST(attribute_equal_diff_length)
{
CK_ATTRIBUTE attr1 = { CKA_ID, "my-identifier", 13 };
CK_ATTRIBUTE attr2 = { CKA_ID, "my-identifier", 2 };
@@ -561,7 +561,7 @@ DEFINE_TEST(attribute_equal_diff_length)
g_assert (ret == FALSE);
}
-DEFINE_TEST(attribute_equal_diff_value)
+TESTING_TEST(attribute_equal_diff_value)
{
CK_ATTRIBUTE attr1 = { CKA_ID, "my-identifier", 13 };
CK_ATTRIBUTE attr2 = { CKA_ID, "xy-identifier", 13 };
@@ -571,7 +571,7 @@ DEFINE_TEST(attribute_equal_diff_value)
g_assert (ret == FALSE);
}
-DEFINE_TEST(attribute_hash)
+TESTING_TEST(attribute_hash)
{
CK_ATTRIBUTE attr = { CKA_VALUE, "value", 5 };
guint hash;
@@ -581,7 +581,7 @@ DEFINE_TEST(attribute_hash)
g_assert_cmpuint (hash, !=, 0U);
}
-DEFINE_TEST(attribute_contains)
+TESTING_TEST(attribute_contains)
{
CK_ATTRIBUTE attr = { CKA_ID, "my-identifier", 13 };
gboolean ret;
@@ -590,7 +590,7 @@ DEFINE_TEST(attribute_contains)
g_assert (ret == TRUE);
}
-DEFINE_TEST(attribute_contains_no_value)
+TESTING_TEST(attribute_contains_no_value)
{
CK_ATTRIBUTE attr = { CKA_ID, "other-identifier", 16 };
gboolean ret;
@@ -599,7 +599,7 @@ DEFINE_TEST(attribute_contains_no_value)
g_assert (ret == FALSE);
}
-DEFINE_TEST(attribute_contains_no_type)
+TESTING_TEST(attribute_contains_no_type)
{
CK_ATTRIBUTE attr = { CKA_VALUE, "value", 5 };
gboolean ret;
@@ -608,7 +608,7 @@ DEFINE_TEST(attribute_contains_no_type)
g_assert (ret == FALSE);
}
-DEFINE_TEST(attributes_find)
+TESTING_TEST(attributes_find)
{
CK_ATTRIBUTE_PTR attr;
@@ -617,7 +617,7 @@ DEFINE_TEST(attributes_find)
g_assert (attr->type == CKA_LABEL);
}
-DEFINE_TEST(attributes_find_not_found)
+TESTING_TEST(attributes_find_not_found)
{
CK_ATTRIBUTE_PTR attr;
@@ -625,7 +625,7 @@ DEFINE_TEST(attributes_find_not_found)
g_assert (attr == NULL);
}
-DEFINE_TEST(attribute_find_boolean)
+TESTING_TEST(attribute_find_boolean)
{
gboolean value;
gboolean ret;
@@ -635,7 +635,7 @@ DEFINE_TEST(attribute_find_boolean)
g_assert (value == TRUE);
}
-DEFINE_TEST(attribute_find_boolean_no_type)
+TESTING_TEST(attribute_find_boolean_no_type)
{
gboolean value;
gboolean ret;
@@ -644,7 +644,7 @@ DEFINE_TEST(attribute_find_boolean_no_type)
g_assert (ret == FALSE);
}
-DEFINE_TEST(attribute_find_boolean_not_bbool)
+TESTING_TEST(attribute_find_boolean_not_bbool)
{
gboolean value;
gboolean ret;
@@ -653,7 +653,7 @@ DEFINE_TEST(attribute_find_boolean_not_bbool)
g_assert (ret == FALSE);
}
-DEFINE_TEST(attribute_find_ulong)
+TESTING_TEST(attribute_find_ulong)
{
gulong value;
gboolean ret;
@@ -663,7 +663,7 @@ DEFINE_TEST(attribute_find_ulong)
g_assert (value == CKO_DATA);
}
-DEFINE_TEST(attribute_find_ulong_no_type)
+TESTING_TEST(attribute_find_ulong_no_type)
{
gulong value;
gboolean ret;
@@ -672,7 +672,7 @@ DEFINE_TEST(attribute_find_ulong_no_type)
g_assert (ret == FALSE);
}
-DEFINE_TEST(attribute_find_ulong_not_ulong)
+TESTING_TEST(attribute_find_ulong_not_ulong)
{
gulong value;
gboolean ret;
@@ -681,7 +681,7 @@ DEFINE_TEST(attribute_find_ulong_not_ulong)
g_assert (ret == FALSE);
}
-DEFINE_TEST(attribute_find_mpi)
+TESTING_TEST(attribute_find_mpi)
{
gcry_mpi_t mpi = NULL;
gboolean ret;
@@ -694,7 +694,7 @@ DEFINE_TEST(attribute_find_mpi)
gcry_mpi_release (mpi);
}
-DEFINE_TEST(attribute_find_mpi_no_type)
+TESTING_TEST(attribute_find_mpi_no_type)
{
gcry_mpi_t mpi = NULL;
gboolean ret;
@@ -704,7 +704,7 @@ DEFINE_TEST(attribute_find_mpi_no_type)
g_assert (mpi == NULL);
}
-DEFINE_TEST(attributes_consume)
+TESTING_TEST(attributes_consume)
{
CK_ATTRIBUTE_PTR attrs;
CK_ULONG n_attrs;
@@ -729,14 +729,14 @@ DEFINE_TEST(attributes_consume)
g_free (attrs);
}
-DEFINE_TEST(template_new_free)
+TESTING_TEST(template_new_free)
{
GArray *template = gkm_template_new (attr_template, G_N_ELEMENTS (attr_template));
g_assert (template);
gkm_template_free (template);
}
-DEFINE_TEST(template_find)
+TESTING_TEST(template_find)
{
GArray *template = gkm_template_new (attr_template, G_N_ELEMENTS (attr_template));
gulong uvalue;
@@ -757,7 +757,7 @@ DEFINE_TEST(template_find)
gkm_template_free (template);
}
-DEFINE_TEST(template_set_replace)
+TESTING_TEST(template_set_replace)
{
GArray *template = gkm_template_new (attr_template, G_N_ELEMENTS (attr_template));
CK_OBJECT_CLASS klass = CKO_HW_FEATURE;
diff --git a/pkcs11/gkm/tests/unit-test-credential.c b/pkcs11/gkm/tests/unit-test-credential.c
index 0d17bed..40b605e 100644
--- a/pkcs11/gkm/tests/unit-test-credential.c
+++ b/pkcs11/gkm/tests/unit-test-credential.c
@@ -38,7 +38,7 @@ static GkmModule *module = NULL;
static GkmSession *session = NULL;
static GkmObject *object = NULL;
-DEFINE_SETUP(credential_setup)
+TESTING_SETUP(credential_setup)
{
CK_RV rv;
module = test_module_initialize_and_enter ();
@@ -51,7 +51,7 @@ DEFINE_SETUP(credential_setup)
gkm_object_expose (object, TRUE);
}
-DEFINE_TEARDOWN(credential_teardown)
+TESTING_TEARDOWN(credential_teardown)
{
g_object_unref (object);
object = NULL;
@@ -61,7 +61,7 @@ DEFINE_TEARDOWN(credential_teardown)
session = NULL;
}
-DEFINE_TEST(credential_create)
+TESTING_TEST(credential_create)
{
CK_OBJECT_CLASS klass = CKO_G_CREDENTIAL;
CK_OBJECT_HANDLE locked = gkm_object_get_handle (object);
@@ -83,7 +83,7 @@ DEFINE_TEST(credential_create)
g_assert (rv == CKR_OK);
}
-DEFINE_TEST(credential_create_missing_pin)
+TESTING_TEST(credential_create_missing_pin)
{
CK_OBJECT_CLASS klass = CKO_G_CREDENTIAL;
CK_OBJECT_HANDLE locked = gkm_object_get_handle (object);
@@ -100,7 +100,7 @@ DEFINE_TEST(credential_create_missing_pin)
g_assert (rv == CKR_USER_NOT_LOGGED_IN);
}
-DEFINE_TEST(credential_create_no_object)
+TESTING_TEST(credential_create_no_object)
{
CK_OBJECT_CLASS klass = CKO_G_CREDENTIAL;
CK_BBOOL token = CK_FALSE;
@@ -127,7 +127,7 @@ DEFINE_TEST(credential_create_no_object)
g_assert (objhand == 0);
}
-DEFINE_TEST(credential_create_invalid_object)
+TESTING_TEST(credential_create_invalid_object)
{
CK_OBJECT_CLASS klass = CKO_G_CREDENTIAL;
CK_OBJECT_HANDLE locked = 0;
@@ -146,7 +146,7 @@ DEFINE_TEST(credential_create_invalid_object)
g_assert (rv == CKR_OBJECT_HANDLE_INVALID);
}
-DEFINE_TEST(credential_get_attributes)
+TESTING_TEST(credential_get_attributes)
{
CK_OBJECT_CLASS klass = CKO_G_CREDENTIAL;
CK_OBJECT_HANDLE locked = gkm_object_get_handle (object);
@@ -176,7 +176,7 @@ DEFINE_TEST(credential_get_attributes)
g_assert (value == locked);
}
-DEFINE_TEST(credential_object_property)
+TESTING_TEST(credential_object_property)
{
GkmCredential *auth;
GkmObject *check;
@@ -196,7 +196,7 @@ DEFINE_TEST(credential_object_property)
g_object_unref (auth);
}
-DEFINE_TEST(credential_login_property)
+TESTING_TEST(credential_login_property)
{
GkmCredential *cred;
GkmSecret *check, *secret;
@@ -239,7 +239,7 @@ boxed_string (void)
return type;
}
-DEFINE_TEST(credential_data)
+TESTING_TEST(credential_data)
{
GkmCredential *cred;
GType type = boxed_string ();
@@ -269,7 +269,7 @@ DEFINE_TEST(credential_data)
g_object_unref (cred);
}
-DEFINE_TEST(credential_connect_object)
+TESTING_TEST(credential_connect_object)
{
GkmCredential *cred;
CK_RV rv;
diff --git a/pkcs11/gkm/tests/unit-test-data-asn1.c b/pkcs11/gkm/tests/unit-test-data-asn1.c
index 872a7e5..dc7ef6d 100644
--- a/pkcs11/gkm/tests/unit-test-data-asn1.c
+++ b/pkcs11/gkm/tests/unit-test-data-asn1.c
@@ -43,21 +43,21 @@ static GNode *asn1_cert = NULL;
static guchar *data_cert = NULL;
static gsize n_data_cert = 0;
-DEFINE_SETUP(asn1_tree)
+TESTING_SETUP(asn1_tree)
{
data_cert = testing_data_read ("test-certificate-1.der", &n_data_cert);
asn1_cert = egg_asn1x_create_and_decode (pkix_asn1_tab, "Certificate", data_cert, n_data_cert);
g_assert (asn1_cert);
}
-DEFINE_TEARDOWN(asn1_tree)
+TESTING_TEARDOWN(asn1_tree)
{
egg_asn1x_destroy (asn1_cert);
g_free (data_cert);
data_cert = NULL;
}
-DEFINE_TEST(asn1_integers)
+TESTING_TEST(asn1_integers)
{
GNode *asn;
gcry_mpi_t mpi, mpt;
diff --git a/pkcs11/gkm/tests/unit-test-data-der.c b/pkcs11/gkm/tests/unit-test-data-der.c
index 3825f0f..a6aba53 100644
--- a/pkcs11/gkm/tests/unit-test-data-der.c
+++ b/pkcs11/gkm/tests/unit-test-data-der.c
@@ -112,7 +112,7 @@ test_der_public (gcry_sexp_t key)
g_assert ("key parsed differently" && compare_keys (key, sexp));
}
-DEFINE_SETUP(preload)
+TESTING_SETUP(preload)
{
certificate_data = testing_data_read ("test-certificate-1.der", &n_certificate_data);
certificate = egg_asn1x_create_and_decode (pkix_asn1_tab, "Certificate", certificate_data, n_certificate_data);
@@ -123,7 +123,7 @@ DEFINE_SETUP(preload)
g_assert (certificate2);
}
-DEFINE_TEARDOWN(preload)
+TESTING_TEARDOWN(preload)
{
egg_asn1x_destroy (certificate);
g_free (certificate_data);
@@ -134,7 +134,7 @@ DEFINE_TEARDOWN(preload)
certificate2_data = NULL;
}
-DEFINE_TEST(der_rsa_public)
+TESTING_TEST(der_rsa_public)
{
gcry_sexp_t key;
gcry_error_t gcry;
@@ -145,7 +145,7 @@ DEFINE_TEST(der_rsa_public)
test_der_public (key);
}
-DEFINE_TEST(der_dsa_public)
+TESTING_TEST(der_dsa_public)
{
gcry_sexp_t key;
gcry_error_t gcry;
@@ -180,7 +180,7 @@ test_der_private (gcry_sexp_t key)
egg_secure_free (data);
}
-DEFINE_TEST(der_rsa_private)
+TESTING_TEST(der_rsa_private)
{
gcry_sexp_t key;
gcry_error_t gcry;
@@ -191,7 +191,7 @@ DEFINE_TEST(der_rsa_private)
test_der_private (key);
}
-DEFINE_TEST(der_dsa_private)
+TESTING_TEST(der_dsa_private)
{
gcry_sexp_t key;
gcry_error_t gcry;
@@ -202,7 +202,7 @@ DEFINE_TEST(der_dsa_private)
test_der_private (key);
}
-DEFINE_TEST(der_dsa_private_parts)
+TESTING_TEST(der_dsa_private_parts)
{
guchar *params, *key;
gsize n_params, n_key;
@@ -235,7 +235,7 @@ const gchar *certpub = "(public-key (rsa " \
"(n #00C966D9F80744CFB98C2EF0A1EF13456C05DFDE2716513641116C6C3BEDFE107D129EE59B429AFE6031C366B7733A48AE4ED032379488B50DB6D9F3F244D9D58812DD764DF21AFC6F231E7AF1D898454E0710EF1642D043756D4ADEE2AAC931FF1F00707C66CF102508BAFAEE00E94603662711153BAA5BF298DD3642B2DA8875#) " \
"(e #010001#) ) )";
-DEFINE_TEST(read_public_key_info)
+TESTING_TEST(read_public_key_info)
{
const guchar *data;
guchar hash[20];
@@ -263,7 +263,7 @@ DEFINE_TEST(read_public_key_info)
gcry_sexp_release (match);
}
-DEFINE_TEST(read_certificate)
+TESTING_TEST(read_certificate)
{
GNode *asn = NULL;
GkmDataResult res;
@@ -275,7 +275,7 @@ DEFINE_TEST(read_certificate)
egg_asn1x_destroy (asn);
}
-DEFINE_TEST(write_certificate)
+TESTING_TEST(write_certificate)
{
guchar *data;
gsize n_data;
@@ -316,7 +316,7 @@ on_ca_certificate_public_key_info (GQuark type, const guchar *data, gsize n_data
g_free (keydata);
}
-DEFINE_TEST(read_ca_certificates_public_key_info)
+TESTING_TEST(read_ca_certificates_public_key_info)
{
gpointer data;
gsize n_data;
@@ -361,7 +361,7 @@ find_extension (GNode *asn, const guchar *data, gsize n_data, const gchar *oid,
g_assert_not_reached ();
}
-DEFINE_TEST(read_basic_constraints)
+TESTING_TEST(read_basic_constraints)
{
const guchar *extension;
gsize n_extension;
@@ -379,7 +379,7 @@ DEFINE_TEST(read_basic_constraints)
g_assert (path_len == -1);
}
-DEFINE_TEST(read_key_usage)
+TESTING_TEST(read_key_usage)
{
const guchar *extension;
gsize n_extension;
@@ -394,7 +394,7 @@ DEFINE_TEST(read_key_usage)
g_assert_cmpuint (key_usage, ==, 0x01);
}
-DEFINE_TEST(read_enhanced_usage)
+TESTING_TEST(read_enhanced_usage)
{
const guchar *extension;
gsize n_extension;
@@ -410,7 +410,7 @@ DEFINE_TEST(read_enhanced_usage)
g_free (usages);
}
-DEFINE_TEST(read_all_pkcs8)
+TESTING_TEST(read_all_pkcs8)
{
gcry_sexp_t sexp;
GkmDataResult res;
@@ -442,7 +442,7 @@ DEFINE_TEST(read_all_pkcs8)
g_dir_close (dir);
}
-DEFINE_TEST(read_pkcs8_bad_password)
+TESTING_TEST(read_pkcs8_bad_password)
{
gcry_sexp_t sexp;
GkmDataResult res;
@@ -456,7 +456,7 @@ DEFINE_TEST(read_pkcs8_bad_password)
g_free (data);
}
-DEFINE_TEST(write_pkcs8_plain)
+TESTING_TEST(write_pkcs8_plain)
{
gcry_sexp_t sexp, check;
gcry_error_t gcry;
@@ -503,7 +503,7 @@ DEFINE_TEST(write_pkcs8_plain)
}
-DEFINE_TEST(write_pkcs8_encrypted)
+TESTING_TEST(write_pkcs8_encrypted)
{
gcry_sexp_t sexp, check;
gcry_error_t gcry;
diff --git a/pkcs11/gkm/tests/unit-test-file-tracker.c b/pkcs11/gkm/tests/unit-test-file-tracker.c
index 514c3a2..49d28d5 100644
--- a/pkcs11/gkm/tests/unit-test-file-tracker.c
+++ b/pkcs11/gkm/tests/unit-test-file-tracker.c
@@ -89,7 +89,7 @@ file_reset_stats (void)
n_files_added = n_files_changed = n_files_removed = 0;
}
-DEFINE_SETUP(tracker)
+TESTING_SETUP(tracker)
{
/* Make a test directory */
test_dir = g_build_filename ("/tmp", SUBDIR, NULL);
@@ -106,7 +106,7 @@ DEFINE_SETUP(tracker)
g_unlink (test_file);
}
-DEFINE_TEARDOWN(tracker)
+TESTING_TEARDOWN(tracker)
{
file_reset_stats ();
g_object_unref (the_tracker);
@@ -114,7 +114,7 @@ DEFINE_TEARDOWN(tracker)
g_free (test_file);
}
-DEFINE_TEST(file_watch)
+TESTING_TEST(file_watch)
{
/* A watch for an non-existant directory, should have no responses */
gkm_file_tracker_refresh (the_tracker, FALSE);
@@ -133,7 +133,7 @@ DEFINE_TEST(file_watch)
g_assert_cmpint (0, ==, n_files_removed);
}
-DEFINE_TEST(watch_file)
+TESTING_TEST(watch_file)
{
gboolean ret;
@@ -196,7 +196,7 @@ DEFINE_TEST(watch_file)
g_assert_cmpstr (last_file_removed, ==, test_file);
}
-DEFINE_TEST(nomatch)
+TESTING_TEST(nomatch)
{
gchar *file = g_build_filename (test_dir, "my-file.toot", NULL);
gboolean ret;
diff --git a/pkcs11/gkm/tests/unit-test-memory-store.c b/pkcs11/gkm/tests/unit-test-memory-store.c
index 9d36ad1..7c1e60e 100644
--- a/pkcs11/gkm/tests/unit-test-memory-store.c
+++ b/pkcs11/gkm/tests/unit-test-memory-store.c
@@ -59,7 +59,7 @@ test_validator (GkmObject *obj, CK_ATTRIBUTE_PTR attr)
return CKR_OK;
}
-DEFINE_SETUP(memory_store)
+TESTING_SETUP(memory_store)
{
CK_ATTRIBUTE attr;
CK_ULONG twentyfour = 24;
@@ -92,7 +92,7 @@ DEFINE_SETUP(memory_store)
transaction = gkm_transaction_new ();
}
-DEFINE_TEARDOWN(memory_store)
+TESTING_TEARDOWN(memory_store)
{
g_object_unref (store);
store = NULL;
@@ -108,7 +108,7 @@ DEFINE_TEARDOWN(memory_store)
module = NULL;
}
-DEFINE_TEST(get_attribute_default)
+TESTING_TEST(get_attribute_default)
{
CK_ATTRIBUTE attr;
CK_RV rv;
@@ -125,7 +125,7 @@ DEFINE_TEST(get_attribute_default)
g_assert (memcmp (attr.pValue, "label", 5) == 0);
}
-DEFINE_TEST(read_value_default)
+TESTING_TEST(read_value_default)
{
gconstpointer value;
gsize n_value;
@@ -141,7 +141,7 @@ DEFINE_TEST(read_value_default)
g_assert (*((CK_ULONG_PTR)value) == 24);
}
-DEFINE_TEST(read_string)
+TESTING_TEST(read_string)
{
gchar *str;
@@ -150,7 +150,7 @@ DEFINE_TEST(read_string)
g_free (str);
}
-DEFINE_TEST(get_invalid)
+TESTING_TEST(get_invalid)
{
CK_ATTRIBUTE attr;
CK_RV rv;
@@ -163,7 +163,7 @@ DEFINE_TEST(get_invalid)
g_assert (rv == CKR_ATTRIBUTE_TYPE_INVALID);
}
-DEFINE_TEST(get_sensitive)
+TESTING_TEST(get_sensitive)
{
CK_ATTRIBUTE attr;
CK_RV rv;
@@ -176,7 +176,7 @@ DEFINE_TEST(get_sensitive)
g_assert (rv == CKR_ATTRIBUTE_SENSITIVE);
}
-DEFINE_TEST(get_internal)
+TESTING_TEST(get_internal)
{
CK_ATTRIBUTE attr;
CK_RV rv;
@@ -189,7 +189,7 @@ DEFINE_TEST(get_internal)
g_assert (rv == CKR_ATTRIBUTE_TYPE_INVALID);
}
-DEFINE_TEST(set_invalid)
+TESTING_TEST(set_invalid)
{
CK_ATTRIBUTE attr;
@@ -201,7 +201,7 @@ DEFINE_TEST(set_invalid)
g_assert (gkm_transaction_get_result (transaction) == CKR_ATTRIBUTE_TYPE_INVALID);
}
-DEFINE_TEST(set_internal)
+TESTING_TEST(set_internal)
{
CK_ATTRIBUTE attr;
CK_ULONG five = 5;
@@ -214,7 +214,7 @@ DEFINE_TEST(set_internal)
g_assert (gkm_transaction_get_result (transaction) == CKR_ATTRIBUTE_TYPE_INVALID);
}
-DEFINE_TEST(set_get_attribute)
+TESTING_TEST(set_get_attribute)
{
CK_ATTRIBUTE attr;
CK_RV rv;
@@ -236,7 +236,7 @@ DEFINE_TEST(set_get_attribute)
g_assert (memcmp (attr.pValue, "booyah", 6) == 0);
}
-DEFINE_TEST(write_read_value)
+TESTING_TEST(write_read_value)
{
CK_ATTRIBUTE attr;
CK_ULONG five = 5;
@@ -258,7 +258,7 @@ DEFINE_TEST(write_read_value)
g_assert (memcmp (value, &five, sizeof (five)) == 0);
}
-DEFINE_TEST(set_no_validate)
+TESTING_TEST(set_no_validate)
{
CK_ATTRIBUTE attr;
@@ -273,7 +273,7 @@ DEFINE_TEST(set_no_validate)
g_assert (gkm_transaction_get_result (transaction) == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST(set_transaction_default)
+TESTING_TEST(set_transaction_default)
{
CK_ATTRIBUTE attr;
gconstpointer value;
@@ -311,7 +311,7 @@ DEFINE_TEST(set_transaction_default)
g_assert (memcmp (value, "label", 5) == 0);
}
-DEFINE_TEST(set_transaction_revert_first)
+TESTING_TEST(set_transaction_revert_first)
{
CK_ATTRIBUTE attr, prev;
gconstpointer value;
@@ -387,7 +387,7 @@ notify_attribute (GkmObject *obj, CK_ATTRIBUTE_TYPE type, gpointer data)
*((CK_ATTRIBUTE_TYPE*)data) = type;
}
-DEFINE_TEST(set_notifies)
+TESTING_TEST(set_notifies)
{
CK_ATTRIBUTE attr;
CK_ATTRIBUTE_TYPE type = 0;
@@ -420,7 +420,7 @@ DEFINE_TEST(set_notifies)
g_assert (type == CKA_LABEL);
}
-DEFINE_TEST(set_object_gone_first)
+TESTING_TEST(set_object_gone_first)
{
CK_ATTRIBUTE attr;
diff --git a/pkcs11/gkm/tests/unit-test-object.c b/pkcs11/gkm/tests/unit-test-object.c
index 6f0a96c..fc2ce4f 100644
--- a/pkcs11/gkm/tests/unit-test-object.c
+++ b/pkcs11/gkm/tests/unit-test-object.c
@@ -37,14 +37,14 @@ static GkmSession *session = NULL;
static guchar *certificate_data = NULL;
static gsize certificate_n_data = 0;
-DEFINE_SETUP(object_setup)
+TESTING_SETUP(object_setup)
{
module = test_module_initialize_and_enter ();
session = test_module_open_session (TRUE);
certificate_data = testing_data_read ("test-certificate-1.der", &certificate_n_data);
}
-DEFINE_TEARDOWN(object_teardown)
+TESTING_TEARDOWN(object_teardown)
{
g_free (certificate_data);
certificate_data = NULL;
@@ -70,7 +70,7 @@ check_object_exists (CK_OBJECT_HANDLE handle)
return TRUE;
}
-DEFINE_TEST(object_create_destroy_transient)
+TESTING_TEST(object_create_destroy_transient)
{
CK_BBOOL transient = CK_TRUE;
CK_BBOOL token = CK_TRUE;
@@ -106,7 +106,7 @@ DEFINE_TEST(object_create_destroy_transient)
g_assert (!check_object_exists (handle));
}
-DEFINE_TEST(object_transient_transacted_fail)
+TESTING_TEST(object_transient_transacted_fail)
{
CK_BBOOL transient = CK_TRUE;
CK_BBOOL token = CK_TRUE;
@@ -132,7 +132,7 @@ DEFINE_TEST(object_transient_transacted_fail)
g_assert (rv == CKR_ATTRIBUTE_TYPE_INVALID);
}
-DEFINE_TEST(object_create_transient_bad_value)
+TESTING_TEST(object_create_transient_bad_value)
{
CK_OBJECT_CLASS klass = CKO_CERTIFICATE;
CK_CERTIFICATE_TYPE type = CKC_X_509;
@@ -152,7 +152,7 @@ DEFINE_TEST(object_create_transient_bad_value)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST(object_create_auto_destruct)
+TESTING_TEST(object_create_auto_destruct)
{
CK_BBOOL token = CK_FALSE;
CK_OBJECT_CLASS klass = CKO_CERTIFICATE;
@@ -197,7 +197,7 @@ DEFINE_TEST(object_create_auto_destruct)
g_assert (!check_object_exists (handle));
}
-DEFINE_TEST(object_create_auto_destruct_not_transient)
+TESTING_TEST(object_create_auto_destruct_not_transient)
{
CK_OBJECT_CLASS klass = CKO_CERTIFICATE;
CK_CERTIFICATE_TYPE type = CKC_X_509;
@@ -220,7 +220,7 @@ DEFINE_TEST(object_create_auto_destruct_not_transient)
g_assert (rv == CKR_TEMPLATE_INCONSISTENT);
}
-DEFINE_TEST(object_expose)
+TESTING_TEST(object_expose)
{
CK_OBJECT_HANDLE handle;
GkmManager *manager;
@@ -243,7 +243,7 @@ DEFINE_TEST(object_expose)
g_assert (check == NULL);
}
-DEFINE_TEST(object_expose_transaction)
+TESTING_TEST(object_expose_transaction)
{
CK_OBJECT_HANDLE handle;
GkmManager *manager;
diff --git a/pkcs11/gkm/tests/unit-test-secret.c b/pkcs11/gkm/tests/unit-test-secret.c
index b261272..5dcea3c 100644
--- a/pkcs11/gkm/tests/unit-test-secret.c
+++ b/pkcs11/gkm/tests/unit-test-secret.c
@@ -29,7 +29,7 @@
#include "gkm/gkm-secret.h"
-DEFINE_TEST(test_secret)
+TESTING_TEST(test_secret)
{
GkmSecret *secret;
const gchar *password;
@@ -52,7 +52,7 @@ DEFINE_TEST(test_secret)
g_object_unref (secret);
}
-DEFINE_TEST(test_secret_from_login)
+TESTING_TEST(test_secret_from_login)
{
GkmSecret *secret;
const gchar *password;
@@ -75,7 +75,7 @@ DEFINE_TEST(test_secret_from_login)
g_object_unref (secret);
}
-DEFINE_TEST(test_null_terminated)
+TESTING_TEST(test_null_terminated)
{
GkmSecret *secret;
const gchar *password;
@@ -98,7 +98,7 @@ DEFINE_TEST(test_null_terminated)
g_object_unref (secret);
}
-DEFINE_TEST(test_always_has_null)
+TESTING_TEST(test_always_has_null)
{
GkmSecret *secret;
const guchar *memory;
@@ -117,7 +117,7 @@ DEFINE_TEST(test_always_has_null)
g_object_unref (secret);
}
-DEFINE_TEST(test_null)
+TESTING_TEST(test_null)
{
GkmSecret *secret;
const gchar *password;
@@ -139,7 +139,7 @@ DEFINE_TEST(test_null)
g_object_unref (secret);
}
-DEFINE_TEST(test_empty)
+TESTING_TEST(test_empty)
{
GkmSecret *secret;
const gchar *password;
@@ -161,7 +161,7 @@ DEFINE_TEST(test_empty)
g_object_unref (secret);
}
-DEFINE_TEST(test_equal)
+TESTING_TEST(test_equal)
{
GkmSecret *one;
GkmSecret *two;
diff --git a/pkcs11/gkm/tests/unit-test-sexp.c b/pkcs11/gkm/tests/unit-test-sexp.c
index cc14050..c4c2524 100644
--- a/pkcs11/gkm/tests/unit-test-sexp.c
+++ b/pkcs11/gkm/tests/unit-test-sexp.c
@@ -53,7 +53,7 @@
gcry_sexp_t rsakey = NULL;
gcry_sexp_t dsakey = NULL;
-DEFINE_SETUP(crypto_setup)
+TESTING_SETUP(crypto_setup)
{
gcry_error_t gcry;
@@ -65,7 +65,7 @@ DEFINE_SETUP(crypto_setup)
g_return_if_fail (gcry == 0);
}
-DEFINE_TEARDOWN(crypto_setup)
+TESTING_TEARDOWN(crypto_setup)
{
gcry_sexp_release (rsakey);
rsakey = NULL;
@@ -73,7 +73,7 @@ DEFINE_TEARDOWN(crypto_setup)
dsakey = NULL;
}
-DEFINE_TEST(parse_key)
+TESTING_TEST(parse_key)
{
gcry_sexp_t sexp = NULL;
gcry_mpi_t mpi = NULL;
@@ -93,7 +93,7 @@ DEFINE_TEST(parse_key)
g_assert (mpi != NULL);
}
-DEFINE_TEST(sexp_key_to_public)
+TESTING_TEST(sexp_key_to_public)
{
gcry_sexp_t pubkey = NULL;
guchar id1[20], id2[20];
diff --git a/pkcs11/gkm/tests/unit-test-store.c b/pkcs11/gkm/tests/unit-test-store.c
index 074d283..859aa02 100644
--- a/pkcs11/gkm/tests/unit-test-store.c
+++ b/pkcs11/gkm/tests/unit-test-store.c
@@ -34,13 +34,13 @@
static GkmModule *module = NULL;
static GkmStore *store = NULL;
-DEFINE_SETUP(store)
+TESTING_SETUP(store)
{
module = test_module_initialize_and_enter ();
store = g_object_new (GKM_TYPE_STORE, NULL);
}
-DEFINE_TEARDOWN(store)
+TESTING_TEARDOWN(store)
{
g_object_unref (store);
store = NULL;
@@ -49,7 +49,7 @@ DEFINE_TEARDOWN(store)
module = NULL;
}
-DEFINE_TEST(store_schema)
+TESTING_TEST(store_schema)
{
CK_ATTRIBUTE attr;
@@ -64,7 +64,7 @@ DEFINE_TEST(store_schema)
g_assert (!gkm_store_lookup_schema (store, CKA_VALUE, NULL));
}
-DEFINE_TEST(store_schema_flags)
+TESTING_TEST(store_schema_flags)
{
CK_ATTRIBUTE attr;
guint flags;
diff --git a/pkcs11/gkm/tests/unit-test-timer.c b/pkcs11/gkm/tests/unit-test-timer.c
index f0303f4..13bdd24 100644
--- a/pkcs11/gkm/tests/unit-test-timer.c
+++ b/pkcs11/gkm/tests/unit-test-timer.c
@@ -28,17 +28,17 @@
static GkmModule *module = NULL;
-DEFINE_SETUP(timer_setup)
+TESTING_SETUP(timer_setup)
{
module = test_module_initialize_and_enter ();
}
-DEFINE_TEARDOWN(timer_teardown)
+TESTING_TEARDOWN(timer_teardown)
{
test_module_leave_and_finalize ();
}
-DEFINE_TEST(timer_extra_initialize)
+TESTING_TEST(timer_extra_initialize)
{
gkm_timer_initialize ();
gkm_timer_shutdown ();
@@ -53,7 +53,7 @@ timer_callback (GkmTimer *timer, gpointer user_data)
*value = NULL;
}
-DEFINE_TEST(timer_simple)
+TESTING_TEST(timer_simple)
{
GkmTimer *timer;
@@ -66,7 +66,7 @@ DEFINE_TEST(timer_simple)
g_assert (timer == NULL);
}
-DEFINE_TEST(timer_cancel)
+TESTING_TEST(timer_cancel)
{
GkmTimer *timer;
@@ -86,7 +86,7 @@ DEFINE_TEST(timer_cancel)
g_assert (timer != NULL);
}
-DEFINE_TEST(timer_immediate)
+TESTING_TEST(timer_immediate)
{
GkmTimer *timer;
@@ -118,7 +118,7 @@ multiple_callback (GkmTimer *timer, gpointer user_data)
timer_check += 1;
}
-DEFINE_TEST(timer_multiple)
+TESTING_TEST(timer_multiple)
{
timer_check = 0;
@@ -135,7 +135,7 @@ DEFINE_TEST(timer_multiple)
g_assert (timer_check == 4);
}
-DEFINE_TEST(timer_outstanding)
+TESTING_TEST(timer_outstanding)
{
/* A timer that can't be called */
gkm_timer_start (module, 5, timer_callback, NULL);
diff --git a/pkcs11/gkm/tests/unit-test-transaction.c b/pkcs11/gkm/tests/unit-test-transaction.c
index 7fc03d2..78ab2d4 100644
--- a/pkcs11/gkm/tests/unit-test-transaction.c
+++ b/pkcs11/gkm/tests/unit-test-transaction.c
@@ -25,7 +25,7 @@
#include "gkm/gkm-transaction.h"
-DEFINE_SETUP (transaction_setup)
+TESTING_SETUP (transaction_setup)
{
GDir *dir;
const gchar *directory;
@@ -50,7 +50,7 @@ DEFINE_SETUP (transaction_setup)
g_dir_close (dir);
}
-DEFINE_TEST(transaction_empty)
+TESTING_TEST(transaction_empty)
{
GkmTransaction *transaction;
gboolean completed, failed;
@@ -77,7 +77,7 @@ DEFINE_TEST(transaction_empty)
g_object_unref (transaction);
}
-DEFINE_TEST(transaction_fail)
+TESTING_TEST(transaction_fail)
{
GkmTransaction *transaction;
@@ -123,7 +123,7 @@ completed_callback (GkmTransaction *transaction, GObject *object, gpointer data)
return TRUE;
}
-DEFINE_TEST(transaction_signals_success)
+TESTING_TEST(transaction_signals_success)
{
GkmTransaction *transaction = gkm_transaction_new ();
@@ -146,7 +146,7 @@ DEFINE_TEST(transaction_signals_success)
g_object_unref (transaction);
}
-DEFINE_TEST(transaction_signals_failure)
+TESTING_TEST(transaction_signals_failure)
{
GkmTransaction *transaction = gkm_transaction_new ();
@@ -183,7 +183,7 @@ order_callback (GkmTransaction *transaction, GObject *object, gpointer data)
return TRUE;
}
-DEFINE_TEST(transaction_order_is_reverse)
+TESTING_TEST(transaction_order_is_reverse)
{
GkmTransaction *transaction = gkm_transaction_new ();
@@ -196,7 +196,7 @@ DEFINE_TEST(transaction_order_is_reverse)
g_object_unref (transaction);
}
-DEFINE_TEST(transaction_dispose_completes)
+TESTING_TEST(transaction_dispose_completes)
{
GkmTransaction *transaction = gkm_transaction_new ();
@@ -212,7 +212,7 @@ DEFINE_TEST(transaction_dispose_completes)
g_object_unref (transaction);
}
-DEFINE_TEST(remove_file_success)
+TESTING_TEST(remove_file_success)
{
GkmTransaction *transaction = gkm_transaction_new ();
gchar *filename = testing_scratch_filename ("transaction-remove");
@@ -232,7 +232,7 @@ DEFINE_TEST(remove_file_success)
g_free (filename);
}
-DEFINE_TEST(remove_file_abort)
+TESTING_TEST(remove_file_abort)
{
GkmTransaction *transaction = gkm_transaction_new ();
gchar *filename = testing_scratch_filename ("transaction-remove");
@@ -264,7 +264,7 @@ DEFINE_TEST(remove_file_abort)
g_free (filename);
}
-DEFINE_TEST(remove_file_non_exist)
+TESTING_TEST(remove_file_non_exist)
{
GkmTransaction *transaction = gkm_transaction_new ();
gchar *filename = testing_scratch_filename ("transaction-non-existant");
@@ -280,7 +280,7 @@ DEFINE_TEST(remove_file_non_exist)
g_free (filename);
}
-DEFINE_TEST(write_file)
+TESTING_TEST(write_file)
{
GkmTransaction *transaction = gkm_transaction_new ();
gchar *filename = testing_scratch_filename ("transaction-test");
@@ -306,7 +306,7 @@ DEFINE_TEST(write_file)
g_free (filename);
}
-DEFINE_TEST(write_file_abort_gone)
+TESTING_TEST(write_file_abort_gone)
{
GkmTransaction *transaction = gkm_transaction_new ();
gchar *filename = testing_scratch_filename ("transaction-test");
@@ -332,7 +332,7 @@ DEFINE_TEST(write_file_abort_gone)
g_free (filename);
}
-DEFINE_TEST(write_file_abort_revert)
+TESTING_TEST(write_file_abort_revert)
{
GkmTransaction *transaction = gkm_transaction_new ();
gchar *filename = testing_scratch_filename ("transaction-test");
@@ -358,7 +358,7 @@ DEFINE_TEST(write_file_abort_revert)
g_free (filename);
}
-DEFINE_TEST (unique_file_conflict)
+TESTING_TEST (unique_file_conflict)
{
GkmTransaction *transaction = gkm_transaction_new ();
gchar *filename = testing_scratch_filename ("transaction-test");
@@ -386,7 +386,7 @@ DEFINE_TEST (unique_file_conflict)
g_free (filename);
}
-DEFINE_TEST (unique_file_conflict_with_ext)
+TESTING_TEST (unique_file_conflict_with_ext)
{
GkmTransaction *transaction = gkm_transaction_new ();
gchar *filename = testing_scratch_filename ("transaction-test.ext");
@@ -414,7 +414,7 @@ DEFINE_TEST (unique_file_conflict_with_ext)
g_free (filename);
}
-DEFINE_TEST (unique_file_no_conflict)
+TESTING_TEST (unique_file_no_conflict)
{
GkmTransaction *transaction = gkm_transaction_new ();
const gchar *dirname = testing_scratch_directory ();
diff --git a/pkcs11/gnome2-store/tests/Makefile.am b/pkcs11/gnome2-store/tests/Makefile.am
index b9da08d..8c4fc02 100644
--- a/pkcs11/gnome2-store/tests/Makefile.am
+++ b/pkcs11/gnome2-store/tests/Makefile.am
@@ -1,7 +1,7 @@
TESTING_FILES = \
- test-module.c \
- unit-test-gnome2-file.c
+ unit-test-gnome2-file.c \
+ test-module.c
TESTING_LIBS = \
$(top_builddir)/pkcs11/gnome2-store/libgkm-gnome2-store.la \
diff --git a/pkcs11/gnome2-store/tests/test-module.c b/pkcs11/gnome2-store/tests/test-module.c
index c6c5d91..d7ce024 100644
--- a/pkcs11/gnome2-store/tests/test-module.c
+++ b/pkcs11/gnome2-store/tests/test-module.c
@@ -27,7 +27,7 @@
#include "test-suite.h"
-DEFINE_EXTERNAL(user_module)
+TESTING_EXTERNAL(user_module)
{
CK_FUNCTION_LIST_PTR funcs = gkm_gnome2_store_get_functions ();
testing_test_p11_module (funcs, "p11-tests.conf");
diff --git a/pkcs11/gnome2-store/tests/unit-test-gnome2-file.c b/pkcs11/gnome2-store/tests/unit-test-gnome2-file.c
index 6b45e62..dec2a26 100644
--- a/pkcs11/gnome2-store/tests/unit-test-gnome2-file.c
+++ b/pkcs11/gnome2-store/tests/unit-test-gnome2-file.c
@@ -43,7 +43,7 @@ static int public_fd = -1;
static int private_fd = -1;
static GkmSecret *login = NULL;
-DEFINE_SETUP(file_store)
+TESTING_SETUP(file_store)
{
egg_libgcrypt_initialize ();
@@ -65,7 +65,7 @@ DEFINE_SETUP(file_store)
login = gkm_secret_new ((guchar*)"booo", 4);
}
-DEFINE_TEARDOWN(file_store)
+TESTING_TEARDOWN(file_store)
{
g_free (public_filename);
g_free (private_filename);
@@ -85,7 +85,7 @@ DEFINE_TEARDOWN(file_store)
g_object_unref (login);
}
-DEFINE_TEST(test_file_create)
+TESTING_TEST(test_file_create)
{
GkmDataResult res;
@@ -97,7 +97,7 @@ DEFINE_TEST(test_file_create)
g_assert (res == GKM_DATA_SUCCESS);
}
-DEFINE_TEST(test_file_write_value)
+TESTING_TEST(test_file_write_value)
{
GkmDataResult res;
@@ -113,7 +113,7 @@ DEFINE_TEST(test_file_write_value)
g_assert (res == GKM_DATA_SUCCESS);
}
-DEFINE_TEST(test_file_read_value)
+TESTING_TEST(test_file_read_value)
{
gconstpointer value = NULL;
GkmDataResult res;
@@ -151,7 +151,7 @@ DEFINE_TEST(test_file_read_value)
g_assert_cmpstr ((const gchar*)value, ==, "TWO-label");
}
-DEFINE_TEST(test_file_read)
+TESTING_TEST(test_file_read)
{
GkmDataResult res;
@@ -159,7 +159,7 @@ DEFINE_TEST(test_file_read)
g_assert (res == GKM_DATA_SUCCESS);
}
-DEFINE_TEST(test_file_lookup)
+TESTING_TEST(test_file_lookup)
{
GkmDataResult res;
guint section;
@@ -182,7 +182,7 @@ DEFINE_TEST(test_file_lookup)
g_assert (ret == TRUE);
}
-DEFINE_TEST(file_read_private_without_login)
+TESTING_TEST(file_read_private_without_login)
{
GkmDataResult res;
guint section;
@@ -219,7 +219,7 @@ DEFINE_TEST(file_read_private_without_login)
g_assert (res == GKM_DATA_SUCCESS);
}
-DEFINE_TEST(test_file_write)
+TESTING_TEST(test_file_write)
{
GkmDataResult res;
@@ -236,7 +236,7 @@ DEFINE_TEST(test_file_write)
g_assert (res == GKM_DATA_SUCCESS);
}
-DEFINE_TEST(cant_write_private_without_login)
+TESTING_TEST(cant_write_private_without_login)
{
GkmDataResult res;
@@ -247,7 +247,7 @@ DEFINE_TEST(cant_write_private_without_login)
g_assert (res == GKM_DATA_LOCKED);
}
-DEFINE_TEST(write_private_with_login)
+TESTING_TEST(write_private_with_login)
{
GkmDataResult res;
gulong value;
@@ -274,7 +274,7 @@ DEFINE_TEST(write_private_with_login)
g_assert (res == GKM_DATA_SUCCESS);
}
-DEFINE_TEST(read_private_with_login)
+TESTING_TEST(read_private_with_login)
{
GkmDataResult res;
gconstpointer value;
@@ -290,7 +290,7 @@ DEFINE_TEST(read_private_with_login)
g_assert (memcmp (value, "private-label", 13) == 0);
}
-DEFINE_TEST(destroy_entry)
+TESTING_TEST(destroy_entry)
{
GkmDataResult res;
@@ -310,7 +310,7 @@ DEFINE_TEST(destroy_entry)
g_assert (!gkm_gnome2_file_lookup_entry (data_file, "identifier-public", NULL));
}
-DEFINE_TEST(destroy_entry_by_loading)
+TESTING_TEST(destroy_entry_by_loading)
{
GkmDataResult res;
@@ -330,7 +330,7 @@ DEFINE_TEST(destroy_entry_by_loading)
}
-DEFINE_TEST(destroy_private_without_login)
+TESTING_TEST(destroy_private_without_login)
{
GkmDataResult res;
@@ -361,7 +361,7 @@ entry_added_one (GkmGnome2File *df, const gchar *identifier, gboolean *added)
*added = TRUE;
}
-DEFINE_TEST(entry_added_signal)
+TESTING_TEST(entry_added_signal)
{
GkmDataResult res;
gboolean added;
@@ -395,7 +395,7 @@ entry_changed_one (GkmGnome2File *df, const gchar *identifier, gulong type, gboo
*changed = TRUE;
}
-DEFINE_TEST(entry_changed_signal)
+TESTING_TEST(entry_changed_signal)
{
GkmDataResult res;
gboolean changed;
@@ -447,7 +447,7 @@ entry_removed_one (GkmGnome2File *df, const gchar *identifier, gboolean *removed
*removed = TRUE;
}
-DEFINE_TEST(entry_removed_signal)
+TESTING_TEST(entry_removed_signal)
{
GkmDataResult res;
gboolean removed;
@@ -506,7 +506,7 @@ foreach_entry (GkmGnome2File *df, const gchar *identifier, gpointer data)
g_ptr_array_add (array, g_strdup (identifier));
}
-DEFINE_TEST(data_file_foreach)
+TESTING_TEST(data_file_foreach)
{
GkmDataResult res;
GPtrArray *array;
@@ -522,7 +522,7 @@ DEFINE_TEST(data_file_foreach)
g_strfreev ((gchar**)g_ptr_array_free (array, FALSE));
}
-DEFINE_TEST(unique_entry)
+TESTING_TEST(unique_entry)
{
GkmDataResult res;
gchar *identifier;
@@ -553,7 +553,7 @@ DEFINE_TEST(unique_entry)
g_free (identifier);
}
-DEFINE_TEST(have_sections)
+TESTING_TEST(have_sections)
{
GkmDataResult res;
diff --git a/pkcs11/roots-store/tests/Makefile.am b/pkcs11/roots-store/tests/Makefile.am
index 9fbbbee..8d102b4 100644
--- a/pkcs11/roots-store/tests/Makefile.am
+++ b/pkcs11/roots-store/tests/Makefile.am
@@ -2,8 +2,6 @@
TESTING_FILES = \
test-module.c
-UNIT_PROMPT =
-
TESTING_LIBS = \
$(top_builddir)/pkcs11/roots-store/libgkm-roots-store.la \
$(top_builddir)/pkcs11/gkm/libgkm.la \
diff --git a/pkcs11/roots-store/tests/test-module.c b/pkcs11/roots-store/tests/test-module.c
index 960fb32..42975b6 100644
--- a/pkcs11/roots-store/tests/test-module.c
+++ b/pkcs11/roots-store/tests/test-module.c
@@ -27,7 +27,7 @@
#include "test-suite.h"
-DEFINE_EXTERNAL(roots_module)
+TESTING_EXTERNAL(roots_module)
{
CK_FUNCTION_LIST_PTR funcs = gkm_roots_store_get_functions ();
testing_test_p11_module (funcs, "p11-tests.conf");
diff --git a/pkcs11/secret-store/tests/Makefile.am b/pkcs11/secret-store/tests/Makefile.am
index 74edf7f..3a4393a 100644
--- a/pkcs11/secret-store/tests/Makefile.am
+++ b/pkcs11/secret-store/tests/Makefile.am
@@ -1,3 +1,6 @@
+TESTING_SOURCES = \
+ test-secret-module.c test-secret-module.h
+
TESTING_FILES = \
unit-test-secret-compat.c \
unit-test-secret-fields.c \
@@ -7,8 +10,7 @@ TESTING_FILES = \
unit-test-secret-item.c \
unit-test-secret-search.c \
unit-test-secret-textual.c \
- unit-test-secret-binary.c \
- test-secret-module.c test-secret-module.h
+ unit-test-secret-binary.c
UNIT_PROMPT =
diff --git a/pkcs11/secret-store/tests/unit-test-secret-binary.c b/pkcs11/secret-store/tests/unit-test-secret-binary.c
index de38ccc..6efc949 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-binary.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-binary.c
@@ -47,7 +47,7 @@ static GkmSession *session = NULL;
static GkmSecretCollection *collection = NULL;
static GkmSecretData *sdata = NULL;
-DEFINE_SETUP(binary)
+TESTING_SETUP(binary)
{
GkmSecret *master;
@@ -69,7 +69,7 @@ DEFINE_SETUP(binary)
}
-DEFINE_TEARDOWN(binary)
+TESTING_TEARDOWN(binary)
{
if (collection)
g_object_unref (collection);
@@ -84,7 +84,7 @@ DEFINE_TEARDOWN(binary)
session = NULL;
}
-DEFINE_TEST(binary_read)
+TESTING_TEST(binary_read)
{
GkmDataResult res;
guchar *data;
@@ -99,7 +99,7 @@ DEFINE_TEST(binary_read)
g_assert (res == GKM_DATA_SUCCESS);
}
-DEFINE_TEST(binary_read_wrong_format)
+TESTING_TEST(binary_read_wrong_format)
{
GkmDataResult res;
guchar *data;
@@ -112,7 +112,7 @@ DEFINE_TEST(binary_read_wrong_format)
g_assert (res == GKM_DATA_UNRECOGNIZED);
}
-DEFINE_TEST(binary_read_wrong_master)
+TESTING_TEST(binary_read_wrong_master)
{
GkmDataResult res;
GkmSecret *master;
@@ -130,7 +130,7 @@ DEFINE_TEST(binary_read_wrong_master)
g_assert (res == GKM_DATA_LOCKED);
}
-DEFINE_TEST(binary_read_sdata_but_no_master)
+TESTING_TEST(binary_read_sdata_but_no_master)
{
GkmDataResult res;
guchar *data;
@@ -145,7 +145,7 @@ DEFINE_TEST(binary_read_sdata_but_no_master)
g_assert (res == GKM_DATA_LOCKED);
}
-DEFINE_TEST(binary_write)
+TESTING_TEST(binary_write)
{
GkmDataResult res;
guchar *data;
@@ -163,7 +163,7 @@ DEFINE_TEST(binary_write)
g_assert (res == GKM_DATA_SUCCESS);
}
-DEFINE_TEST(binary_remove_unavailable)
+TESTING_TEST(binary_remove_unavailable)
{
GkmDataResult res;
GList *items;
diff --git a/pkcs11/secret-store/tests/unit-test-secret-collection.c b/pkcs11/secret-store/tests/unit-test-secret-collection.c
index 33a0761..e2d2f13 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-collection.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-collection.c
@@ -48,7 +48,7 @@ static CK_OBJECT_HANDLE credential = 0;
static CK_OBJECT_HANDLE credential2 = 0;
static GkmSecretCollection *collection = NULL;
-DEFINE_SETUP(secret_collection)
+TESTING_SETUP(secret_collection)
{
CK_OBJECT_CLASS klass = CKO_G_CREDENTIAL;
GkmObject *cred;
@@ -81,7 +81,7 @@ DEFINE_SETUP(secret_collection)
g_object_unref (cred);
}
-DEFINE_TEARDOWN(secret_collection)
+TESTING_TEARDOWN(secret_collection)
{
if (collection)
g_object_unref (collection);
@@ -93,7 +93,7 @@ DEFINE_TEARDOWN(secret_collection)
credential = 0;
}
-DEFINE_TEST(secret_collection_is_locked)
+TESTING_TEST(secret_collection_is_locked)
{
gboolean locked;
@@ -102,7 +102,7 @@ DEFINE_TEST(secret_collection_is_locked)
g_assert (locked == TRUE);
}
-DEFINE_TEST(secret_collection_unlocked_data)
+TESTING_TEST(secret_collection_unlocked_data)
{
GkmCredential *cred;
GkmSecretData *sdata;
@@ -121,7 +121,7 @@ DEFINE_TEST(secret_collection_unlocked_data)
g_object_unref (sdata);
}
-DEFINE_TEST(secret_collection_get_filename)
+TESTING_TEST(secret_collection_get_filename)
{
GkmSecretCollection *other;
const gchar *filename;
@@ -138,7 +138,7 @@ DEFINE_TEST(secret_collection_get_filename)
g_object_unref (other);
}
-DEFINE_TEST(secret_collection_set_filename)
+TESTING_TEST(secret_collection_set_filename)
{
const gchar *filename;
@@ -148,7 +148,7 @@ DEFINE_TEST(secret_collection_set_filename)
g_assert_cmpstr (filename, ==, "/tmp/filename.keyring");
}
-DEFINE_TEST(secret_collection_has_item)
+TESTING_TEST(secret_collection_has_item)
{
GkmSecretItem *item;
@@ -156,7 +156,7 @@ DEFINE_TEST(secret_collection_has_item)
g_assert (gkm_secret_collection_has_item (collection, item));
}
-DEFINE_TEST(secret_collection_load_unlock_plain)
+TESTING_TEST(secret_collection_load_unlock_plain)
{
GkmCredential *cred;
GkmSecretData *sdata;
@@ -184,7 +184,7 @@ DEFINE_TEST(secret_collection_load_unlock_plain)
g_object_unref (sdata);
}
-DEFINE_TEST(secret_collection_load_unlock_encrypted)
+TESTING_TEST(secret_collection_load_unlock_encrypted)
{
GkmCredential *cred;
GkmSecretData *sdata;
@@ -213,7 +213,7 @@ DEFINE_TEST(secret_collection_load_unlock_encrypted)
g_object_unref (sdata);
}
-DEFINE_TEST(secret_collection_load_unlock_bad_password)
+TESTING_TEST(secret_collection_load_unlock_bad_password)
{
GkmCredential *cred;
GkmDataResult res;
@@ -234,7 +234,7 @@ DEFINE_TEST(secret_collection_load_unlock_bad_password)
g_assert (rv == CKR_PIN_INCORRECT);
}
-DEFINE_TEST(secret_collection_unlock_without_load)
+TESTING_TEST(secret_collection_unlock_without_load)
{
GkmCredential *cred;
GkmSecretData *sdata;
@@ -258,7 +258,7 @@ DEFINE_TEST(secret_collection_unlock_without_load)
g_object_unref (sdata);
}
-DEFINE_TEST(secret_collection_twice_unlock)
+TESTING_TEST(secret_collection_twice_unlock)
{
GkmCredential *cred;
GkmSecretData *sdata;
@@ -289,7 +289,7 @@ DEFINE_TEST(secret_collection_twice_unlock)
g_object_unref (sdata);
}
-DEFINE_TEST(secret_collection_twice_unlock_bad_password)
+TESTING_TEST(secret_collection_twice_unlock_bad_password)
{
GkmCredential *cred;
GkmSecretData *sdata;
@@ -318,7 +318,7 @@ DEFINE_TEST(secret_collection_twice_unlock_bad_password)
g_object_unref (sdata);
}
-DEFINE_TEST(secret_collection_memory_unlock)
+TESTING_TEST(secret_collection_memory_unlock)
{
GkmCredential *cred;
GkmDataResult res;
@@ -336,7 +336,7 @@ DEFINE_TEST(secret_collection_memory_unlock)
g_object_unref (cred);
}
-DEFINE_TEST(secret_collection_memory_unlock_bad_password)
+TESTING_TEST(secret_collection_memory_unlock_bad_password)
{
GkmCredential *cred;
GkmDataResult res;
@@ -352,7 +352,7 @@ DEFINE_TEST(secret_collection_memory_unlock_bad_password)
g_assert (rv == CKR_PIN_INCORRECT);
}
-DEFINE_TEST(secret_collection_factory)
+TESTING_TEST(secret_collection_factory)
{
CK_OBJECT_CLASS klass = CKO_G_COLLECTION;
GkmObject *object;
@@ -372,7 +372,7 @@ DEFINE_TEST(secret_collection_factory)
g_object_unref (object);
}
-DEFINE_TEST(secret_collection_factory_unnamed)
+TESTING_TEST(secret_collection_factory_unnamed)
{
CK_OBJECT_CLASS klass = CKO_G_COLLECTION;
const gchar *identifier;
@@ -393,7 +393,7 @@ DEFINE_TEST(secret_collection_factory_unnamed)
g_object_unref (object);
}
-DEFINE_TEST(secret_collection_factory_token)
+TESTING_TEST(secret_collection_factory_token)
{
CK_OBJECT_CLASS klass = CKO_G_COLLECTION;
const gchar *identifier;
@@ -417,7 +417,7 @@ DEFINE_TEST(secret_collection_factory_token)
g_object_unref (object);
}
-DEFINE_TEST(secret_collection_factory_duplicate)
+TESTING_TEST(secret_collection_factory_duplicate)
{
CK_OBJECT_CLASS klass = CKO_G_COLLECTION;
const gchar *identifier1, *identifier2;
@@ -452,7 +452,7 @@ DEFINE_TEST(secret_collection_factory_duplicate)
g_assert_cmpstr (identifier1, !=, identifier2);
}
-DEFINE_TEST(secret_collection_factory_item)
+TESTING_TEST(secret_collection_factory_item)
{
CK_OBJECT_CLASS c_klass = CKO_G_COLLECTION;
CK_OBJECT_CLASS i_klass = CKO_SECRET_KEY;
@@ -490,7 +490,7 @@ DEFINE_TEST(secret_collection_factory_item)
g_object_unref (object);
}
-DEFINE_TEST(secret_collection_token_remove)
+TESTING_TEST(secret_collection_token_remove)
{
CK_OBJECT_CLASS klass = CKO_G_COLLECTION;
GkmTransaction *transaction;
@@ -517,7 +517,7 @@ DEFINE_TEST(secret_collection_token_remove)
g_object_unref (object);
}
-DEFINE_TEST(secret_collection_token_item_remove)
+TESTING_TEST(secret_collection_token_item_remove)
{
CK_OBJECT_CLASS c_klass = CKO_G_COLLECTION;
CK_OBJECT_CLASS i_klass = CKO_SECRET_KEY;
diff --git a/pkcs11/secret-store/tests/unit-test-secret-compat.c b/pkcs11/secret-store/tests/unit-test-secret-compat.c
index 9f26755..925c729 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-compat.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-compat.c
@@ -33,7 +33,7 @@
#include <stdio.h>
#include <string.h>
-DEFINE_TEST(access_free)
+TESTING_TEST(access_free)
{
GkmSecretAccess *ac;
@@ -45,7 +45,7 @@ DEFINE_TEST(access_free)
gkm_secret_compat_access_free (ac);
}
-DEFINE_TEST(acl_free)
+TESTING_TEST(acl_free)
{
GkmSecretAccess *ac;
GList *acl = NULL;
@@ -62,7 +62,7 @@ DEFINE_TEST(acl_free)
gkm_secret_compat_acl_free (acl);
}
-DEFINE_TEST(parse_item_type)
+TESTING_TEST(parse_item_type)
{
guint type;
@@ -88,7 +88,7 @@ DEFINE_TEST(parse_item_type)
g_assert_cmpuint (type, ==, 0);
}
-DEFINE_TEST(format_item_type)
+TESTING_TEST(format_item_type)
{
const gchar *type;
diff --git a/pkcs11/secret-store/tests/unit-test-secret-data.c b/pkcs11/secret-store/tests/unit-test-secret-data.c
index b9bc330..efa6b25 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-data.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-data.c
@@ -36,14 +36,14 @@
#include <stdio.h>
#include <string.h>
-DEFINE_TEST(secret_data_new)
+TESTING_TEST(secret_data_new)
{
GkmSecretData *data = g_object_new (GKM_TYPE_SECRET_DATA, NULL);
g_assert (GKM_IS_SECRET_DATA (data));
g_object_unref (data);
}
-DEFINE_TEST(secret_data_get_set)
+TESTING_TEST(secret_data_get_set)
{
GkmSecretData *data = g_object_new (GKM_TYPE_SECRET_DATA, NULL);
GkmSecret *secret = gkm_secret_new_from_password ("barn");
@@ -60,7 +60,7 @@ DEFINE_TEST(secret_data_get_set)
g_object_unref (data);
}
-DEFINE_TEST(secret_data_get_raw)
+TESTING_TEST(secret_data_get_raw)
{
GkmSecretData *data = g_object_new (GKM_TYPE_SECRET_DATA, NULL);
GkmSecret *secret = gkm_secret_new_from_password ("barn");
@@ -81,7 +81,7 @@ DEFINE_TEST(secret_data_get_raw)
g_object_unref (data);
}
-DEFINE_TEST(secret_data_remove)
+TESTING_TEST(secret_data_remove)
{
GkmSecretData *data = g_object_new (GKM_TYPE_SECRET_DATA, NULL);
GkmSecret *secret = gkm_secret_new_from_password ("barn");
@@ -99,7 +99,7 @@ DEFINE_TEST(secret_data_remove)
g_object_unref (data);
}
-DEFINE_TEST(secret_data_set_transacted)
+TESTING_TEST(secret_data_set_transacted)
{
GkmTransaction *transaction = gkm_transaction_new ();
GkmSecretData *data = g_object_new (GKM_TYPE_SECRET_DATA, NULL);
@@ -120,7 +120,7 @@ DEFINE_TEST(secret_data_set_transacted)
g_object_unref (transaction);
}
-DEFINE_TEST(secret_data_set_transacted_replace)
+TESTING_TEST(secret_data_set_transacted_replace)
{
GkmTransaction *transaction = gkm_transaction_new ();
GkmSecretData *data = g_object_new (GKM_TYPE_SECRET_DATA, NULL);
@@ -147,7 +147,7 @@ DEFINE_TEST(secret_data_set_transacted_replace)
g_object_unref (transaction);
}
-DEFINE_TEST(secret_data_set_transacted_fail)
+TESTING_TEST(secret_data_set_transacted_fail)
{
GkmTransaction *transaction = gkm_transaction_new ();
GkmSecretData *data = g_object_new (GKM_TYPE_SECRET_DATA, NULL);
@@ -169,7 +169,7 @@ DEFINE_TEST(secret_data_set_transacted_fail)
g_object_unref (transaction);
}
-DEFINE_TEST(secret_data_set_transacted_fail_revert)
+TESTING_TEST(secret_data_set_transacted_fail_revert)
{
GkmTransaction *transaction = gkm_transaction_new ();
GkmSecretData *data = g_object_new (GKM_TYPE_SECRET_DATA, NULL);
@@ -197,7 +197,7 @@ DEFINE_TEST(secret_data_set_transacted_fail_revert)
g_object_unref (transaction);
}
-DEFINE_TEST(secret_data_get_set_master)
+TESTING_TEST(secret_data_get_set_master)
{
GkmSecretData *data = g_object_new (GKM_TYPE_SECRET_DATA, NULL);
GkmSecret *master = gkm_secret_new_from_password ("master");
diff --git a/pkcs11/secret-store/tests/unit-test-secret-fields.c b/pkcs11/secret-store/tests/unit-test-secret-fields.c
index 7f58c71..d69939d 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-fields.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-fields.c
@@ -35,20 +35,20 @@
#include <stdio.h>
#include <string.h>
-DEFINE_TEST(fields_new)
+TESTING_TEST(fields_new)
{
GHashTable *fields = gkm_secret_fields_new ();
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_boxed)
+TESTING_TEST(fields_boxed)
{
GType boxed = gkm_secret_fields_boxed_type ();
GType check = gkm_secret_fields_boxed_type ();
g_assert (boxed == check);
}
-DEFINE_TEST(fields_add_get_values)
+TESTING_TEST(fields_add_get_values)
{
GHashTable *fields = gkm_secret_fields_new ();
const gchar *value;
@@ -69,7 +69,7 @@ DEFINE_TEST(fields_add_get_values)
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_parse)
+TESTING_TEST(fields_parse)
{
CK_ATTRIBUTE attr = { CKA_G_FIELDS, "one\0value1\0two\0value2\0three\0value3\0", 35 };
GHashTable *fields;
@@ -90,7 +90,7 @@ DEFINE_TEST(fields_parse)
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_parse_empty)
+TESTING_TEST(fields_parse_empty)
{
CK_ATTRIBUTE attr = { CKA_G_FIELDS, "", 0 };
GHashTable *fields;
@@ -104,7 +104,7 @@ DEFINE_TEST(fields_parse_empty)
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_parse_null_invalid)
+TESTING_TEST(fields_parse_null_invalid)
{
CK_ATTRIBUTE attr = { CKA_G_FIELDS, NULL, 5 };
GHashTable *fields;
@@ -114,7 +114,7 @@ DEFINE_TEST(fields_parse_null_invalid)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST(fields_parse_missing_value)
+TESTING_TEST(fields_parse_missing_value)
{
CK_ATTRIBUTE attr = { CKA_G_FIELDS, "one", 3 };
GHashTable *fields;
@@ -124,7 +124,7 @@ DEFINE_TEST(fields_parse_missing_value)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST(fields_parse_missing_terminator)
+TESTING_TEST(fields_parse_missing_terminator)
{
CK_ATTRIBUTE attr = { CKA_G_FIELDS, "one\0value", 9 };
GHashTable *fields;
@@ -134,7 +134,7 @@ DEFINE_TEST(fields_parse_missing_terminator)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST(fields_parse_not_utf8)
+TESTING_TEST(fields_parse_not_utf8)
{
CK_ATTRIBUTE attr = { CKA_G_FIELDS, "one\0not\234utf8\0", 13 };
GHashTable *fields;
@@ -144,7 +144,7 @@ DEFINE_TEST(fields_parse_not_utf8)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST(fields_serialize)
+TESTING_TEST(fields_serialize)
{
gchar buffer[32];
CK_ATTRIBUTE attr = { CKA_G_FIELDS, buffer, 32 };
@@ -162,7 +162,7 @@ DEFINE_TEST(fields_serialize)
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_serialize_length)
+TESTING_TEST(fields_serialize_length)
{
CK_ATTRIBUTE attr = { CKA_G_FIELDS, NULL, 0 };
GHashTable *fields;
@@ -178,7 +178,7 @@ DEFINE_TEST(fields_serialize_length)
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_add_get_compat_uint32)
+TESTING_TEST(fields_add_get_compat_uint32)
{
GHashTable *fields;
gboolean ret;
@@ -194,7 +194,7 @@ DEFINE_TEST(fields_add_get_compat_uint32)
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_get_compat_uint32_fail)
+TESTING_TEST(fields_get_compat_uint32_fail)
{
GHashTable *fields;
gboolean ret;
@@ -209,7 +209,7 @@ DEFINE_TEST(fields_get_compat_uint32_fail)
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_get_compat_hashed_string)
+TESTING_TEST(fields_get_compat_hashed_string)
{
GHashTable *fields;
gboolean ret;
@@ -226,7 +226,7 @@ DEFINE_TEST(fields_get_compat_hashed_string)
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_get_compat_hashed_already)
+TESTING_TEST(fields_get_compat_hashed_already)
{
GHashTable *fields;
gboolean ret;
@@ -243,7 +243,7 @@ DEFINE_TEST(fields_get_compat_hashed_already)
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_get_compat_hashed_uint32)
+TESTING_TEST(fields_get_compat_hashed_uint32)
{
GHashTable *fields;
gboolean ret;
@@ -260,7 +260,7 @@ DEFINE_TEST(fields_get_compat_hashed_uint32)
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_get_compat_hashed_uint32_already)
+TESTING_TEST(fields_get_compat_hashed_uint32_already)
{
GHashTable *fields;
gboolean ret;
@@ -277,7 +277,7 @@ DEFINE_TEST(fields_get_compat_hashed_uint32_already)
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_get_names)
+TESTING_TEST(fields_get_names)
{
GHashTable *fields;
GList *names, *l;
@@ -303,7 +303,7 @@ DEFINE_TEST(fields_get_names)
g_hash_table_unref (fields);
}
-DEFINE_TEST(fields_match)
+TESTING_TEST(fields_match)
{
GHashTable *haystack;
GHashTable *needle;
@@ -329,7 +329,7 @@ DEFINE_TEST(fields_match)
g_hash_table_unref (needle);
}
-DEFINE_TEST(fields_match_mismatch_value)
+TESTING_TEST(fields_match_mismatch_value)
{
GHashTable *haystack;
GHashTable *needle;
@@ -348,7 +348,7 @@ DEFINE_TEST(fields_match_mismatch_value)
g_hash_table_unref (needle);
}
-DEFINE_TEST(fields_match_mismatch_field)
+TESTING_TEST(fields_match_mismatch_field)
{
GHashTable *haystack;
GHashTable *needle;
@@ -367,7 +367,7 @@ DEFINE_TEST(fields_match_mismatch_field)
g_hash_table_unref (needle);
}
-DEFINE_TEST(fields_match_wrong_hashed)
+TESTING_TEST(fields_match_wrong_hashed)
{
GHashTable *haystack;
GHashTable *needle;
diff --git a/pkcs11/secret-store/tests/unit-test-secret-item.c b/pkcs11/secret-store/tests/unit-test-secret-item.c
index 1430224..d82396e 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-item.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-item.c
@@ -46,7 +46,7 @@ static GkmModule *module = NULL;
static GkmSession *session = NULL;
static GkmSecretCollection *collection = NULL;
-DEFINE_SETUP(secret_item)
+TESTING_SETUP(secret_item)
{
module = test_secret_module_initialize_and_enter ();
session = test_secret_module_open_session (TRUE);
@@ -57,7 +57,7 @@ DEFINE_SETUP(secret_item)
NULL);
}
-DEFINE_TEARDOWN(secret_item)
+TESTING_TEARDOWN(secret_item)
{
if (collection)
g_object_unref (collection);
@@ -87,7 +87,7 @@ unlock_collection(void)
g_object_unref (cred);
}
-DEFINE_TEST(secret_item_new)
+TESTING_TEST(secret_item_new)
{
GkmSecretItem *item;
@@ -96,7 +96,7 @@ DEFINE_TEST(secret_item_new)
g_assert_cmpstr (gkm_secret_object_get_identifier (GKM_SECRET_OBJECT (item)), ==, "the-identifier");
}
-DEFINE_TEST(secret_item_create)
+TESTING_TEST(secret_item_create)
{
GkmTransaction *transaction;
GkmSecretItem *item;
@@ -115,7 +115,7 @@ DEFINE_TEST(secret_item_create)
g_object_unref (item);
}
-DEFINE_TEST(secret_item_create_failed)
+TESTING_TEST(secret_item_create_failed)
{
GkmTransaction *transaction;
GkmSecretItem *item;
@@ -135,7 +135,7 @@ DEFINE_TEST(secret_item_create_failed)
g_object_unref (item);
}
-DEFINE_TEST(secret_item_destroy)
+TESTING_TEST(secret_item_destroy)
{
GkmTransaction *transaction;
GkmSecretItem *item;
@@ -156,7 +156,7 @@ DEFINE_TEST(secret_item_destroy)
g_object_unref (item);
}
-DEFINE_TEST(secret_item_destroy_failed)
+TESTING_TEST(secret_item_destroy_failed)
{
GkmTransaction *transaction;
GkmSecretItem *item;
@@ -178,7 +178,7 @@ DEFINE_TEST(secret_item_destroy_failed)
g_object_unref (item);
}
-DEFINE_TEST(secret_item_collection_get)
+TESTING_TEST(secret_item_collection_get)
{
GkmSecretItem *item, *check;
@@ -189,7 +189,7 @@ DEFINE_TEST(secret_item_collection_get)
g_assert (item == check);
}
-DEFINE_TEST(secret_item_collection_items)
+TESTING_TEST(secret_item_collection_items)
{
GList *l, *items;
const gchar *identifier;
@@ -211,7 +211,7 @@ DEFINE_TEST(secret_item_collection_items)
g_list_free (items);
}
-DEFINE_TEST(secret_item_collection_remove)
+TESTING_TEST(secret_item_collection_remove)
{
GkmSecretItem *item;
@@ -222,7 +222,7 @@ DEFINE_TEST(secret_item_collection_remove)
g_assert (gkm_secret_collection_get_item (collection, "the-identifier") == NULL);
}
-DEFINE_TEST(secret_item_is_locked)
+TESTING_TEST(secret_item_is_locked)
{
GkmSecretItem *item;
@@ -235,14 +235,14 @@ DEFINE_TEST(secret_item_is_locked)
g_assert (gkm_secret_object_is_locked (GKM_SECRET_OBJECT (item), session) == FALSE);
}
-DEFINE_TEST(secret_item_get_collection)
+TESTING_TEST(secret_item_get_collection)
{
GkmSecretItem *item;
item = gkm_secret_collection_new_item (collection, "the-identifier");
g_assert (gkm_secret_item_get_collection (item) == collection);
}
-DEFINE_TEST(secret_item_tracks_collection)
+TESTING_TEST(secret_item_tracks_collection)
{
GkmSecretItem *item;
item = gkm_secret_collection_new_item (collection, "the-identifier");
@@ -263,7 +263,7 @@ DEFINE_TEST(secret_item_tracks_collection)
g_object_unref (item);
}
-DEFINE_TEST(secret_item_get_set_fields)
+TESTING_TEST(secret_item_get_set_fields)
{
GHashTable *fields = gkm_secret_fields_new ();
GHashTable *check;
@@ -279,7 +279,7 @@ DEFINE_TEST(secret_item_get_set_fields)
g_hash_table_unref (fields);
}
-DEFINE_TEST(secret_item_collection_attr)
+TESTING_TEST(secret_item_collection_attr)
{
gchar buffer[32];
CK_ATTRIBUTE check = { CKA_G_COLLECTION, buffer, 32 };
@@ -293,7 +293,7 @@ DEFINE_TEST(secret_item_collection_attr)
g_assert (memcmp (buffer, "test", 4) == 0);
}
-DEFINE_TEST(secret_item_secret_attr)
+TESTING_TEST(secret_item_secret_attr)
{
GkmTransaction *transaction = gkm_transaction_new ();
CK_ATTRIBUTE attr = { CKA_VALUE, "hello", 5 };
@@ -318,7 +318,7 @@ DEFINE_TEST(secret_item_secret_attr)
g_assert (memcmp (buffer, "hello", 5) == 0);
}
-DEFINE_TEST(secret_item_secret_attr_locked)
+TESTING_TEST(secret_item_secret_attr_locked)
{
GkmTransaction *transaction = gkm_transaction_new ();
CK_ATTRIBUTE attr = { CKA_VALUE, "hello", 5 };
@@ -339,7 +339,7 @@ DEFINE_TEST(secret_item_secret_attr_locked)
g_assert (rv == CKR_USER_NOT_LOGGED_IN);
}
-DEFINE_TEST(secret_item_fields_attr)
+TESTING_TEST(secret_item_fields_attr)
{
GkmTransaction *transaction = gkm_transaction_new ();
CK_ATTRIBUTE attr = { CKA_G_FIELDS, "name1\0value1\0name2\0value2", 26 };
@@ -373,7 +373,7 @@ DEFINE_TEST(secret_item_fields_attr)
g_assert_cmpstr (value, ==, "value2");
}
-DEFINE_TEST(secret_item_fields_attr_locked)
+TESTING_TEST(secret_item_fields_attr_locked)
{
GkmTransaction *transaction = gkm_transaction_new ();
CK_ATTRIBUTE attr = { CKA_G_FIELDS, "name1\0value1\0name2\0value2", 26 };
@@ -388,7 +388,7 @@ DEFINE_TEST(secret_item_fields_attr_locked)
g_object_unref (transaction);
}
-DEFINE_TEST(secret_item_fields_attr_reverts)
+TESTING_TEST(secret_item_fields_attr_reverts)
{
GkmTransaction *transaction = gkm_transaction_new ();
CK_ATTRIBUTE attr = { CKA_G_FIELDS, "new\0value\0", 10 };
diff --git a/pkcs11/secret-store/tests/unit-test-secret-object.c b/pkcs11/secret-store/tests/unit-test-secret-object.c
index ea809ea..b915e40 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-object.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-object.c
@@ -42,7 +42,7 @@ static GkmModule *module = NULL;
static GkmSession *session = NULL;
static GkmSecretObject *object = NULL;
-DEFINE_SETUP(secret_object)
+TESTING_SETUP(secret_object)
{
module = test_secret_module_initialize_and_enter ();
session = test_secret_module_open_session (TRUE);
@@ -55,7 +55,7 @@ DEFINE_SETUP(secret_object)
g_assert (GKM_IS_SECRET_OBJECT (object));
}
-DEFINE_TEARDOWN(secret_object)
+TESTING_TEARDOWN(secret_object)
{
g_object_unref (object);
object = NULL;
@@ -65,13 +65,13 @@ DEFINE_TEARDOWN(secret_object)
session = NULL;
}
-DEFINE_TEST(secret_object_is_locked)
+TESTING_TEST(secret_object_is_locked)
{
/* Plain GkmSecretObject is never locked */
g_assert (!gkm_secret_object_is_locked (object, session));
}
-DEFINE_TEST(secret_object_identifier_prop)
+TESTING_TEST(secret_object_identifier_prop)
{
const gchar *identifier;
identifier = gkm_secret_object_get_identifier (object);
@@ -87,7 +87,7 @@ was_notified (GObject *obj, GParamSpec *pspec, gpointer user_data)
*notified = TRUE;
}
-DEFINE_TEST(secret_object_created_prop)
+TESTING_TEST(secret_object_created_prop)
{
glong created;
@@ -106,7 +106,7 @@ DEFINE_TEST(secret_object_created_prop)
g_assert (created == 1247930171);
}
-DEFINE_TEST(secret_object_modified_prop)
+TESTING_TEST(secret_object_modified_prop)
{
glong modified;
@@ -125,7 +125,7 @@ DEFINE_TEST(secret_object_modified_prop)
g_assert (modified == 1247930171);
}
-DEFINE_TEST(secret_object_was_modified)
+TESTING_TEST(secret_object_was_modified)
{
GTimeVal tv;
g_get_current_time (&tv);
@@ -133,7 +133,7 @@ DEFINE_TEST(secret_object_was_modified)
g_assert (tv.tv_sec == gkm_secret_object_get_modified (object));
}
-DEFINE_TEST(secret_object_label_prop)
+TESTING_TEST(secret_object_label_prop)
{
const gchar *label;
@@ -152,7 +152,7 @@ DEFINE_TEST(secret_object_label_prop)
g_assert_cmpstr (label, ==, "hello");
}
-DEFINE_TEST(secret_object_identifier_get_attr)
+TESTING_TEST(secret_object_identifier_get_attr)
{
gchar buffer[32];
CK_ATTRIBUTE attr = { CKA_ID, buffer, 32 };
@@ -164,7 +164,7 @@ DEFINE_TEST(secret_object_identifier_get_attr)
g_assert (memcmp (buffer, "my-identifier", 13) == 0);
}
-DEFINE_TEST(secret_object_label_get_attr)
+TESTING_TEST(secret_object_label_get_attr)
{
gchar buffer[32];
CK_ATTRIBUTE attr = { CKA_LABEL, buffer, 32 };
@@ -177,7 +177,7 @@ DEFINE_TEST(secret_object_label_get_attr)
g_assert (memcmp (buffer, "hello", 5) == 0);
}
-DEFINE_TEST(secret_object_label_set_attr)
+TESTING_TEST(secret_object_label_set_attr)
{
CK_ATTRIBUTE attr = { CKA_LABEL, "hello", 5 };
GkmTransaction *transaction = gkm_transaction_new ();
@@ -199,7 +199,7 @@ DEFINE_TEST(secret_object_label_set_attr)
g_object_unref (transaction);
}
-DEFINE_TEST(secret_object_label_set_attr_fail)
+TESTING_TEST(secret_object_label_set_attr_fail)
{
CK_ATTRIBUTE attr = { CKA_LABEL, "hello", 5 };
GkmTransaction *transaction = gkm_transaction_new ();
@@ -230,7 +230,7 @@ DEFINE_TEST(secret_object_label_set_attr_fail)
g_object_unref (transaction);
}
-DEFINE_TEST(secret_object_modified_get_attr)
+TESTING_TEST(secret_object_modified_get_attr)
{
gchar buffer[32];
CK_ATTRIBUTE attr = { CKA_G_MODIFIED, buffer, 32 };
@@ -243,7 +243,7 @@ DEFINE_TEST(secret_object_modified_get_attr)
g_assert (memcmp (buffer, "2009071815161100", 16) == 0);
}
-DEFINE_TEST(secret_object_created_get_attr)
+TESTING_TEST(secret_object_created_get_attr)
{
gchar buffer[32];
CK_ATTRIBUTE attr = { CKA_G_CREATED, buffer, 32 };
@@ -256,7 +256,7 @@ DEFINE_TEST(secret_object_created_get_attr)
g_assert (memcmp (buffer, "2009071815161100", 16) == 0);
}
-DEFINE_TEST(secret_object_locked_get_attr)
+TESTING_TEST(secret_object_locked_get_attr)
{
gchar buffer[32];
CK_ATTRIBUTE attr = { CKA_G_LOCKED, buffer, 32 };
diff --git a/pkcs11/secret-store/tests/unit-test-secret-search.c b/pkcs11/secret-store/tests/unit-test-secret-search.c
index 91d5402..ead2aa2 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-search.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-search.c
@@ -48,7 +48,7 @@ static GkmFactory *factory = NULL;
static GkmSecretCollection *collection = NULL;
static GkmSecretItem *item = NULL;
-DEFINE_SETUP(secret_search)
+TESTING_SETUP(secret_search)
{
GHashTable *fields;
@@ -74,7 +74,7 @@ DEFINE_SETUP(secret_search)
gkm_object_expose (GKM_OBJECT (collection), TRUE);
}
-DEFINE_TEARDOWN(secret_search)
+TESTING_TEARDOWN(secret_search)
{
g_object_unref (collection);
@@ -83,7 +83,7 @@ DEFINE_TEARDOWN(secret_search)
session = NULL;
}
-DEFINE_TEST(create_search_incomplete)
+TESTING_TEST(create_search_incomplete)
{
CK_ATTRIBUTE attrs[1];
GkmObject *object = NULL;
@@ -94,7 +94,7 @@ DEFINE_TEST(create_search_incomplete)
g_assert (object == NULL);
}
-DEFINE_TEST(create_search_bad_fields)
+TESTING_TEST(create_search_bad_fields)
{
CK_ATTRIBUTE attrs[] = {
{ CKA_G_FIELDS, "bad-value", 9 },
@@ -108,7 +108,7 @@ DEFINE_TEST(create_search_bad_fields)
g_assert (object == NULL);
}
-DEFINE_TEST(create_search)
+TESTING_TEST(create_search)
{
CK_ATTRIBUTE attrs[] = {
{ CKA_G_FIELDS, "test\0value\0two\0value2", 22 },
@@ -162,7 +162,7 @@ DEFINE_TEST(create_search)
g_object_unref (object);
}
-DEFINE_TEST(create_search_and_match)
+TESTING_TEST(create_search_and_match)
{
CK_ATTRIBUTE attrs[] = {
{ CKA_G_FIELDS, "name1\0value1\0name2\0value2", 26 },
@@ -186,7 +186,7 @@ DEFINE_TEST(create_search_and_match)
g_object_unref (object);
}
-DEFINE_TEST(create_search_and_change_to_match)
+TESTING_TEST(create_search_and_change_to_match)
{
CK_ATTRIBUTE attrs[] = {
{ CKA_G_FIELDS, "name1\0value1", 13 },
@@ -228,7 +228,7 @@ DEFINE_TEST(create_search_and_change_to_match)
g_object_unref (object);
}
-DEFINE_TEST(create_search_and_change_to_not_match)
+TESTING_TEST(create_search_and_change_to_not_match)
{
CK_ATTRIBUTE attrs[] = {
{ CKA_G_FIELDS, "name1\0value1", 13 },
@@ -263,7 +263,7 @@ DEFINE_TEST(create_search_and_change_to_not_match)
g_object_unref (object);
}
-DEFINE_TEST(create_search_for_bad_collection)
+TESTING_TEST(create_search_for_bad_collection)
{
CK_ATTRIBUTE attrs[] = {
{ CKA_G_FIELDS, "name1\0value1", 13 },
@@ -279,7 +279,7 @@ DEFINE_TEST(create_search_for_bad_collection)
g_object_unref (object);
}
-DEFINE_TEST(create_search_for_collection)
+TESTING_TEST(create_search_for_collection)
{
CK_ATTRIBUTE attrs[] = {
{ CKA_G_FIELDS, "name1\0value1", 13 },
@@ -311,7 +311,7 @@ DEFINE_TEST(create_search_for_collection)
g_object_unref (object);
}
-DEFINE_TEST(create_search_for_collection_no_match)
+TESTING_TEST(create_search_for_collection_no_match)
{
CK_ATTRIBUTE attrs[] = {
{ CKA_G_FIELDS, "test\0value", 11 },
diff --git a/pkcs11/secret-store/tests/unit-test-secret-textual.c b/pkcs11/secret-store/tests/unit-test-secret-textual.c
index 25231bd..4f4af27 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-textual.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-textual.c
@@ -47,7 +47,7 @@ static GkmSession *session = NULL;
static GkmSecretCollection *collection = NULL;
static GkmSecretData *sdata = NULL;
-DEFINE_SETUP(textual)
+TESTING_SETUP(textual)
{
module = test_secret_module_initialize_and_enter ();
session = test_secret_module_open_session (TRUE);
@@ -64,7 +64,7 @@ DEFINE_SETUP(textual)
}
-DEFINE_TEARDOWN(textual)
+TESTING_TEARDOWN(textual)
{
if (collection)
g_object_unref (collection);
@@ -79,7 +79,7 @@ DEFINE_TEARDOWN(textual)
session = NULL;
}
-DEFINE_TEST(textual_read)
+TESTING_TEST(textual_read)
{
GkmDataResult res;
guchar *data;
@@ -94,7 +94,7 @@ DEFINE_TEST(textual_read)
g_assert (res == GKM_DATA_SUCCESS);
}
-DEFINE_TEST(textual_read_wrong_format)
+TESTING_TEST(textual_read_wrong_format)
{
GkmDataResult res;
guchar *data;
@@ -107,7 +107,7 @@ DEFINE_TEST(textual_read_wrong_format)
g_assert (res == GKM_DATA_UNRECOGNIZED);
}
-DEFINE_TEST(textual_read_bad_number)
+TESTING_TEST(textual_read_bad_number)
{
GkmSecretItem *item;
GkmDataResult res;
@@ -129,7 +129,7 @@ DEFINE_TEST(textual_read_bad_number)
g_assert (value == NULL);
}
-DEFINE_TEST(textual_write)
+TESTING_TEST(textual_write)
{
GkmDataResult res;
guchar *data;
@@ -147,7 +147,7 @@ DEFINE_TEST(textual_write)
g_assert (res == GKM_DATA_SUCCESS);
}
-DEFINE_TEST(textual_remove_unavailable)
+TESTING_TEST(textual_remove_unavailable)
{
GkmDataResult res;
GList *items;
diff --git a/pkcs11/ssh-store/tests/Makefile.am b/pkcs11/ssh-store/tests/Makefile.am
index ff53cb8..382be4c 100644
--- a/pkcs11/ssh-store/tests/Makefile.am
+++ b/pkcs11/ssh-store/tests/Makefile.am
@@ -1,7 +1,10 @@
+TESTING_SOURCES = \
+ test-ssh-module.h
+
TESTING_FILES = \
unit-test-ssh-openssh.c \
unit-test-private-key.c \
- test-ssh-module.c test-ssh-module.h
+ test-ssh-module.c
UNIT_PROMPT =
diff --git a/pkcs11/ssh-store/tests/test-ssh-module.c b/pkcs11/ssh-store/tests/test-ssh-module.c
index d63baf7..76b2501 100644
--- a/pkcs11/ssh-store/tests/test-ssh-module.c
+++ b/pkcs11/ssh-store/tests/test-ssh-module.c
@@ -106,7 +106,7 @@ test_ssh_module_open_session (gboolean writable)
return session;
}
-DEFINE_EXTERNAL(ssh_module)
+TESTING_EXTERNAL(ssh_module)
{
CK_FUNCTION_LIST_PTR funcs = gkm_ssh_store_get_functions ();
testing_test_p11_module (funcs, "p11-tests.conf");
diff --git a/pkcs11/ssh-store/tests/unit-test-private-key.c b/pkcs11/ssh-store/tests/unit-test-private-key.c
index aab6878..93bd6f3 100644
--- a/pkcs11/ssh-store/tests/unit-test-private-key.c
+++ b/pkcs11/ssh-store/tests/unit-test-private-key.c
@@ -35,20 +35,20 @@
static GkmModule *module = NULL;
static GkmSession *session = NULL;
-DEFINE_SETUP(private_key_setup)
+TESTING_SETUP(private_key_setup)
{
module = test_ssh_module_initialize_and_enter ();
session = test_ssh_module_open_session (TRUE);
}
-DEFINE_TEARDOWN(private_key_teardown)
+TESTING_TEARDOWN(private_key_teardown)
{
test_ssh_module_leave_and_finalize ();
module = NULL;
session = NULL;
}
-DEFINE_TEST(private_key_parse_plain)
+TESTING_TEST(private_key_parse_plain)
{
GkmSshPrivateKey *key;
gchar *pub_path, *priv_path;
@@ -69,7 +69,7 @@ DEFINE_TEST(private_key_parse_plain)
}
-DEFINE_TEST(private_key_parse_and_unlock)
+TESTING_TEST(private_key_parse_and_unlock)
{
GkmSshPrivateKey *key;
GkmCredential *cred;
diff --git a/pkcs11/ssh-store/tests/unit-test-ssh-openssh.c b/pkcs11/ssh-store/tests/unit-test-ssh-openssh.c
index ff81651..c243a4c 100644
--- a/pkcs11/ssh-store/tests/unit-test-ssh-openssh.c
+++ b/pkcs11/ssh-store/tests/unit-test-ssh-openssh.c
@@ -49,7 +49,7 @@ static const gchar *PUBLIC_FILES[] = {
#define COMMENT "A public key comment"
-DEFINE_TEST(parse_public)
+TESTING_TEST(parse_public)
{
gcry_sexp_t sexp;
gchar *comment;
@@ -84,7 +84,7 @@ DEFINE_TEST(parse_public)
}
}
-DEFINE_TEST(parse_private)
+TESTING_TEST(parse_private)
{
gcry_sexp_t sexp;
guchar *data;
diff --git a/pkcs11/wrap-layer/tests/Makefile.am b/pkcs11/wrap-layer/tests/Makefile.am
index 007c4d2..0dbc0a6 100644
--- a/pkcs11/wrap-layer/tests/Makefile.am
+++ b/pkcs11/wrap-layer/tests/Makefile.am
@@ -1,6 +1,8 @@
+TESTING_SOURCES = \
+ mock-secret-store.c
+
TESTING_FILES = \
- mock-secret-store.c \
test-create-credential.c \
test-init-pin.c \
test-login-auto.c \
diff --git a/pkcs11/wrap-layer/tests/test-create-credential.c b/pkcs11/wrap-layer/tests/test-create-credential.c
index 17a0309..c4e7bd6 100644
--- a/pkcs11/wrap-layer/tests/test-create-credential.c
+++ b/pkcs11/wrap-layer/tests/test-create-credential.c
@@ -35,7 +35,7 @@ static CK_FUNCTION_LIST_PTR module = NULL;
static CK_SESSION_HANDLE session = 0;
static CK_OBJECT_HANDLE object = 0;
-DEFINE_SETUP (create_credential)
+TESTING_SETUP (create_credential)
{
CK_FUNCTION_LIST_PTR funcs;
CK_SLOT_ID slot_id;
@@ -82,7 +82,7 @@ DEFINE_SETUP (create_credential)
gkm_assert_cmprv (rv, ==, CKR_OK);
}
-DEFINE_TEARDOWN (create_credential)
+TESTING_TEARDOWN (create_credential)
{
CK_RV rv;
@@ -99,7 +99,7 @@ DEFINE_TEARDOWN (create_credential)
module = NULL;
}
-DEFINE_TEST (create_credential_ok_password)
+TESTING_TEST (create_credential_ok_password)
{
CK_OBJECT_CLASS klass = CKO_G_CREDENTIAL;
CK_ATTRIBUTE attrs[] = {
@@ -118,7 +118,7 @@ DEFINE_TEST (create_credential_ok_password)
gkm_assert_cmpulong (cred, !=, 0);
}
-DEFINE_TEST (create_credential_bad_password_then_cancel)
+TESTING_TEST (create_credential_bad_password_then_cancel)
{
CK_OBJECT_CLASS klass = CKO_G_CREDENTIAL;
CK_ATTRIBUTE attrs[] = {
@@ -137,7 +137,7 @@ DEFINE_TEST (create_credential_bad_password_then_cancel)
gkm_assert_cmprv (rv, ==, CKR_PIN_INCORRECT);
}
-DEFINE_TEST (create_credentiaol_cancel_immediately)
+TESTING_TEST (create_credentiaol_cancel_immediately)
{
CK_OBJECT_CLASS klass = CKO_G_CREDENTIAL;
CK_ATTRIBUTE attrs[] = {
diff --git a/pkcs11/wrap-layer/tests/test-init-pin.c b/pkcs11/wrap-layer/tests/test-init-pin.c
index 118930f..58b02c5 100644
--- a/pkcs11/wrap-layer/tests/test-init-pin.c
+++ b/pkcs11/wrap-layer/tests/test-init-pin.c
@@ -34,7 +34,7 @@ static CK_FUNCTION_LIST functions;
static CK_FUNCTION_LIST_PTR module = NULL;
static CK_SESSION_HANDLE session = 0;
-DEFINE_SETUP (init_pin)
+TESTING_SETUP (init_pin)
{
CK_FUNCTION_LIST_PTR funcs;
CK_SLOT_ID slot_id;
@@ -63,7 +63,7 @@ DEFINE_SETUP (init_pin)
gkm_assert_cmprv (rv, ==, CKR_OK);
}
-DEFINE_TEARDOWN (init_pin)
+TESTING_TEARDOWN (init_pin)
{
CK_RV rv;
@@ -78,7 +78,7 @@ DEFINE_TEARDOWN (init_pin)
module = NULL;
}
-DEFINE_TEST (init_pin_ok_password)
+TESTING_TEST (init_pin_ok_password)
{
CK_RV rv;
diff --git a/pkcs11/wrap-layer/tests/test-login-auto.c b/pkcs11/wrap-layer/tests/test-login-auto.c
index 9b21649..56bcfc2 100644
--- a/pkcs11/wrap-layer/tests/test-login-auto.c
+++ b/pkcs11/wrap-layer/tests/test-login-auto.c
@@ -38,7 +38,7 @@ static CK_OBJECT_HANDLE key = 0;
static CK_OBJECT_HANDLE collection = 0;
static CK_MECHANISM mech = { CKM_MOCK_PREFIX, NULL, 0 };
-DEFINE_SETUP (login_auto)
+TESTING_SETUP (login_auto)
{
CK_SLOT_ID slot_id;
CK_ULONG n_slots = 1;
@@ -100,7 +100,7 @@ DEFINE_SETUP (login_auto)
gkm_assert_cmprv (rv, ==, CKR_OK);
}
-DEFINE_TEARDOWN (login_auto)
+TESTING_TEARDOWN (login_auto)
{
CK_RV rv;
@@ -118,7 +118,7 @@ DEFINE_TEARDOWN (login_auto)
module = NULL;
}
-DEFINE_TEST (login_auto_specific)
+TESTING_TEST (login_auto_specific)
{
CK_RV rv;
@@ -149,7 +149,7 @@ DEFINE_TEST (login_auto_specific)
gkm_assert_cmprv (rv, ==, CKR_OK);
}
-DEFINE_TEST (login_auto_user_token)
+TESTING_TEST (login_auto_user_token)
{
CK_RV rv;
@@ -176,7 +176,7 @@ DEFINE_TEST (login_auto_user_token)
gkm_assert_cmprv (rv, ==, CKR_OK);
}
-DEFINE_TEST (login_auto_unlock_keyring)
+TESTING_TEST (login_auto_unlock_keyring)
{
CK_OBJECT_HANDLE credential;
CK_RV rv;
diff --git a/pkcs11/wrap-layer/tests/test-login-hints.c b/pkcs11/wrap-layer/tests/test-login-hints.c
index 1959352..eb8d135 100644
--- a/pkcs11/wrap-layer/tests/test-login-hints.c
+++ b/pkcs11/wrap-layer/tests/test-login-hints.c
@@ -28,7 +28,7 @@
#include "wrap-layer/gkm-wrap-layer.h"
#include "wrap-layer/gkm-wrap-login.h"
-DEFINE_TEST (login_did_unlock_fail)
+TESTING_TEST (login_did_unlock_fail)
{
gchar *password;
gboolean ret;
diff --git a/pkcs11/wrap-layer/tests/test-login-keyring.c b/pkcs11/wrap-layer/tests/test-login-keyring.c
index 43c4f43..ad43001 100644
--- a/pkcs11/wrap-layer/tests/test-login-keyring.c
+++ b/pkcs11/wrap-layer/tests/test-login-keyring.c
@@ -36,7 +36,7 @@ extern CK_FUNCTION_LIST mock_secret_store;
static CK_FUNCTION_LIST functions;
static CK_FUNCTION_LIST_PTR module = NULL;
-DEFINE_SETUP (login_keyring)
+TESTING_SETUP (login_keyring)
{
CK_RV rv;
@@ -51,7 +51,7 @@ DEFINE_SETUP (login_keyring)
gkm_assert_cmprv (rv, ==, CKR_OK);
}
-DEFINE_TEARDOWN (login_keyring)
+TESTING_TEARDOWN (login_keyring)
{
CK_RV rv;
@@ -60,7 +60,7 @@ DEFINE_TEARDOWN (login_keyring)
module = NULL;
}
-DEFINE_TEST (login_is_usable)
+TESTING_TEST (login_is_usable)
{
gboolean ret;
@@ -68,7 +68,7 @@ DEFINE_TEST (login_is_usable)
g_assert (ret == TRUE);
}
-DEFINE_TEST (login_usable_fail_open_session)
+TESTING_TEST (login_usable_fail_open_session)
{
gboolean ret;
@@ -77,7 +77,7 @@ DEFINE_TEST (login_usable_fail_open_session)
g_assert (ret == FALSE);
}
-DEFINE_TEST (login_usable_fail_not_trusted)
+TESTING_TEST (login_usable_fail_not_trusted)
{
CK_OBJECT_HANDLE object;
CK_ATTRIBUTE attr;
@@ -107,7 +107,7 @@ DEFINE_TEST (login_usable_fail_not_trusted)
g_assert (ret == FALSE);
}
-DEFINE_TEST (login_usable_fail_locked)
+TESTING_TEST (login_usable_fail_locked)
{
CK_OBJECT_HANDLE object;
CK_ATTRIBUTE attr;
@@ -137,7 +137,7 @@ DEFINE_TEST (login_usable_fail_locked)
g_assert (ret == FALSE);
}
-DEFINE_TEST (login_lookup_secret_no_match)
+TESTING_TEST (login_lookup_secret_no_match)
{
gchar *password;
@@ -146,7 +146,7 @@ DEFINE_TEST (login_lookup_secret_no_match)
g_assert_cmpstr (password, ==, NULL);
}
-DEFINE_TEST (login_lookup_secret_and_match)
+TESTING_TEST (login_lookup_secret_and_match)
{
gchar *password;
@@ -158,7 +158,7 @@ DEFINE_TEST (login_lookup_secret_and_match)
egg_secure_free (password);
}
-DEFINE_TEST (login_lookup_store_secret)
+TESTING_TEST (login_lookup_store_secret)
{
CK_OBJECT_CLASS klass = CKO_SECRET_KEY;
CK_BBOOL tval = CK_TRUE;
@@ -182,7 +182,7 @@ DEFINE_TEST (login_lookup_store_secret)
gkm_assert_cmpulong (object, !=, 0);
}
-DEFINE_TEST (login_lookup_store_secret_overwrite)
+TESTING_TEST (login_lookup_store_secret_overwrite)
{
CK_OBJECT_CLASS klass = CKO_SECRET_KEY;
CK_BBOOL tval = CK_TRUE;
@@ -220,7 +220,7 @@ DEFINE_TEST (login_lookup_store_secret_overwrite)
gkm_assert_cmpulong (object1, ==, object2);
}
-DEFINE_TEST (login_lookup_store_null_secret)
+TESTING_TEST (login_lookup_store_null_secret)
{
CK_OBJECT_CLASS klass = CKO_SECRET_KEY;
CK_BBOOL tval = CK_TRUE;
@@ -243,7 +243,7 @@ DEFINE_TEST (login_lookup_store_null_secret)
gkm_assert_cmpulong (object, !=, 0);
}
-DEFINE_TEST (login_lookup_store_no_attributes_not_stored)
+TESTING_TEST (login_lookup_store_no_attributes_not_stored)
{
CK_OBJECT_CLASS klass = CKO_SECRET_KEY;
CK_BBOOL tval = CK_TRUE;
@@ -265,7 +265,7 @@ DEFINE_TEST (login_lookup_store_no_attributes_not_stored)
}
-DEFINE_TEST (login_lookup_remove_present)
+TESTING_TEST (login_lookup_remove_present)
{
CK_OBJECT_CLASS klass = CKO_SECRET_KEY;
CK_BBOOL tval = CK_TRUE;
@@ -291,7 +291,7 @@ DEFINE_TEST (login_lookup_remove_present)
gkm_assert_cmpulong (object, ==, 0);
}
-DEFINE_TEST (login_lookup_remove_no_attributes)
+TESTING_TEST (login_lookup_remove_no_attributes)
{
guint n_objects, check;
diff --git a/pkcs11/wrap-layer/tests/test-login-specific.c b/pkcs11/wrap-layer/tests/test-login-specific.c
index 234076d..3957404 100644
--- a/pkcs11/wrap-layer/tests/test-login-specific.c
+++ b/pkcs11/wrap-layer/tests/test-login-specific.c
@@ -34,7 +34,7 @@ static CK_FUNCTION_LIST prompt_login_functions;
static CK_FUNCTION_LIST_PTR module = NULL;
static CK_SESSION_HANDLE session = 0;
-DEFINE_SETUP (login_specific)
+TESTING_SETUP (login_specific)
{
CK_FUNCTION_LIST_PTR funcs;
CK_OBJECT_HANDLE key;
@@ -88,7 +88,7 @@ DEFINE_SETUP (login_specific)
gkm_assert_cmprv (rv, ==, CKR_OK);
}
-DEFINE_TEARDOWN (login_specific)
+TESTING_TEARDOWN (login_specific)
{
CK_RV rv;
@@ -103,7 +103,7 @@ DEFINE_TEARDOWN (login_specific)
module = NULL;
}
-DEFINE_TEST (login_specific_ok_password)
+TESTING_TEST (login_specific_ok_password)
{
CK_RV rv;
@@ -113,7 +113,7 @@ DEFINE_TEST (login_specific_ok_password)
gkm_assert_cmprv (rv, ==, CKR_OK);
}
-DEFINE_TEST (login_specific_bad_password_then_cancel)
+TESTING_TEST (login_specific_bad_password_then_cancel)
{
CK_RV rv;
@@ -124,7 +124,7 @@ DEFINE_TEST (login_specific_bad_password_then_cancel)
gkm_assert_cmprv (rv, ==, CKR_PIN_INCORRECT);
}
-DEFINE_TEST (login_specific_cancel_immediately)
+TESTING_TEST (login_specific_cancel_immediately)
{
CK_RV rv;
diff --git a/pkcs11/wrap-layer/tests/test-login-user.c b/pkcs11/wrap-layer/tests/test-login-user.c
index f709d0a..d2d47c4 100644
--- a/pkcs11/wrap-layer/tests/test-login-user.c
+++ b/pkcs11/wrap-layer/tests/test-login-user.c
@@ -34,7 +34,7 @@ static CK_FUNCTION_LIST prompt_login_functions;
static CK_FUNCTION_LIST_PTR module = NULL;
static CK_SESSION_HANDLE session = 0;
-DEFINE_SETUP (login_user)
+TESTING_SETUP (login_user)
{
CK_FUNCTION_LIST_PTR funcs;
CK_SLOT_ID slot_id;
@@ -63,7 +63,7 @@ DEFINE_SETUP (login_user)
gkm_assert_cmprv (rv, ==, CKR_OK);
}
-DEFINE_TEARDOWN (login_user)
+TESTING_TEARDOWN (login_user)
{
CK_RV rv;
@@ -78,7 +78,7 @@ DEFINE_TEARDOWN (login_user)
module = NULL;
}
-DEFINE_TEST (login_fail_unsupported_so)
+TESTING_TEST (login_fail_unsupported_so)
{
CK_RV rv;
@@ -86,7 +86,7 @@ DEFINE_TEST (login_fail_unsupported_so)
gkm_assert_cmprv (rv, ==, CKR_PIN_INCORRECT);
}
-DEFINE_TEST (login_skip_prompt_because_pin)
+TESTING_TEST (login_skip_prompt_because_pin)
{
CK_RV rv;
@@ -94,7 +94,7 @@ DEFINE_TEST (login_skip_prompt_because_pin)
gkm_assert_cmprv (rv, ==, CKR_OK);
}
-DEFINE_TEST (login_user_ok_password)
+TESTING_TEST (login_user_ok_password)
{
CK_RV rv;
@@ -104,7 +104,7 @@ DEFINE_TEST (login_user_ok_password)
gkm_assert_cmprv (rv, ==, CKR_OK);
}
-DEFINE_TEST (login_user_bad_password_then_cancel)
+TESTING_TEST (login_user_bad_password_then_cancel)
{
CK_RV rv;
@@ -115,7 +115,7 @@ DEFINE_TEST (login_user_bad_password_then_cancel)
gkm_assert_cmprv (rv, ==, CKR_PIN_INCORRECT);
}
-DEFINE_TEST (login_user_cancel_immediately)
+TESTING_TEST (login_user_cancel_immediately)
{
CK_RV rv;
@@ -125,7 +125,7 @@ DEFINE_TEST (login_user_cancel_immediately)
gkm_assert_cmprv (rv, ==, CKR_PIN_INCORRECT);
}
-DEFINE_TEST (login_user_fail_get_session_info)
+TESTING_TEST (login_user_fail_get_session_info)
{
CK_RV rv;
@@ -134,7 +134,7 @@ DEFINE_TEST (login_user_fail_get_session_info)
gkm_assert_cmprv (rv, ==, CKR_PIN_INCORRECT);
}
-DEFINE_TEST (login_user_fail_get_token_info)
+TESTING_TEST (login_user_fail_get_token_info)
{
CK_RV rv;
diff --git a/pkcs11/wrap-layer/tests/test-set-pin.c b/pkcs11/wrap-layer/tests/test-set-pin.c
index 8b1a879..766f8b8 100644
--- a/pkcs11/wrap-layer/tests/test-set-pin.c
+++ b/pkcs11/wrap-layer/tests/test-set-pin.c
@@ -34,7 +34,7 @@ static CK_FUNCTION_LIST functions;
static CK_FUNCTION_LIST_PTR module = NULL;
static CK_SESSION_HANDLE session = 0;
-DEFINE_SETUP (set_pin)
+TESTING_SETUP (set_pin)
{
CK_FUNCTION_LIST_PTR funcs;
CK_SLOT_ID slot_id;
@@ -63,7 +63,7 @@ DEFINE_SETUP (set_pin)
gkm_assert_cmprv (rv, ==, CKR_OK);
}
-DEFINE_TEARDOWN (set_pin)
+TESTING_TEARDOWN (set_pin)
{
CK_RV rv;
@@ -78,7 +78,7 @@ DEFINE_TEARDOWN (set_pin)
module = NULL;
}
-DEFINE_TEST (set_pin_ok_passwords)
+TESTING_TEST (set_pin_ok_passwords)
{
CK_RV rv;
diff --git a/pkcs11/xdg-store/tests/Makefile.am b/pkcs11/xdg-store/tests/Makefile.am
index aa3b7a3..7cf37d0 100644
--- a/pkcs11/xdg-store/tests/Makefile.am
+++ b/pkcs11/xdg-store/tests/Makefile.am
@@ -1,8 +1,11 @@
+TESTING_SOURCES = \
+ test-xdg-module.h
+
# Test files should be listed in order they need to run
TESTING_FILES = \
- test-xdg-module.c test-xdg-module.h \
- test-xdg-trust.c
+ test-xdg-trust.c \
+ test-xdg-module.c
TESTING_LIBS = \
$(top_builddir)/pkcs11/xdg-store/libgkm-xdg-store.la \
@@ -24,4 +27,4 @@ noinst_PROGRAMS += \
diddle_trust_file_LDADD = \
$(top_builddir)/egg/libegg.la
dump_trust_file_LDADD = \
- $(top_builddir)/egg/libegg.la
\ No newline at end of file
+ $(top_builddir)/egg/libegg.la
diff --git a/pkcs11/xdg-store/tests/test-xdg-module.c b/pkcs11/xdg-store/tests/test-xdg-module.c
index 7b9d78e..39e2451 100644
--- a/pkcs11/xdg-store/tests/test-xdg-module.c
+++ b/pkcs11/xdg-store/tests/test-xdg-module.c
@@ -145,7 +145,7 @@ test_xdg_module_open_session (gboolean writable)
return session;
}
-DEFINE_EXTERNAL(xdg_module)
+TESTING_EXTERNAL(xdg_module)
{
CK_FUNCTION_LIST_PTR funcs = gkm_xdg_store_get_functions ();
testing_test_p11_module (funcs, "p11-tests.conf");
diff --git a/pkcs11/xdg-store/tests/test-xdg-trust.c b/pkcs11/xdg-store/tests/test-xdg-trust.c
index 56e7b09..5a759ea 100644
--- a/pkcs11/xdg-store/tests/test-xdg-trust.c
+++ b/pkcs11/xdg-store/tests/test-xdg-trust.c
@@ -110,7 +110,7 @@ debug_print_certificate_info (const gchar *path)
#endif
-DEFINE_SETUP (trust_setup)
+TESTING_SETUP (trust_setup)
{
CK_RV rv;
@@ -123,14 +123,14 @@ DEFINE_SETUP (trust_setup)
g_assert (rv == CKR_OK);
}
-DEFINE_TEARDOWN (trust_teardown)
+TESTING_TEARDOWN (trust_teardown)
{
test_xdg_module_leave_and_finalize ();
module = NULL;
session = NULL;
}
-DEFINE_TEST (trust_load_object)
+TESTING_TEST (trust_load_object)
{
CK_OBJECT_CLASS klass = CKO_NETSCAPE_TRUST;
CK_TRUST trusted = CKT_NETSCAPE_TRUSTED;
@@ -162,7 +162,7 @@ DEFINE_TEST (trust_load_object)
gkm_assert_cmpulong (n_objects, ==, 1);
}
-DEFINE_TEST (trust_create)
+TESTING_TEST (trust_create)
{
CK_OBJECT_CLASS klass = CKO_NETSCAPE_TRUST;
@@ -183,7 +183,7 @@ DEFINE_TEST (trust_create)
}
-DEFINE_TEST (trust_create_invalid_attrs)
+TESTING_TEST (trust_create_invalid_attrs)
{
CK_OBJECT_CLASS klass = CKO_NETSCAPE_TRUST;
@@ -198,7 +198,7 @@ DEFINE_TEST (trust_create_invalid_attrs)
g_assert (rv == CKR_TEMPLATE_INCOMPLETE);
}
-DEFINE_TEST (trust_create_invalid_der)
+TESTING_TEST (trust_create_invalid_der)
{
CK_OBJECT_CLASS klass = CKO_NETSCAPE_TRUST;
@@ -215,7 +215,7 @@ DEFINE_TEST (trust_create_invalid_der)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST (trust_create_invalid_serial)
+TESTING_TEST (trust_create_invalid_serial)
{
CK_OBJECT_CLASS klass = CKO_NETSCAPE_TRUST;
@@ -232,7 +232,7 @@ DEFINE_TEST (trust_create_invalid_serial)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST (trust_create_with_sha1)
+TESTING_TEST (trust_create_with_sha1)
{
CK_OBJECT_CLASS klass = CKO_NETSCAPE_TRUST;
@@ -250,7 +250,7 @@ DEFINE_TEST (trust_create_with_sha1)
g_assert (rv == CKR_OK);
}
-DEFINE_TEST (trust_create_with_md5)
+TESTING_TEST (trust_create_with_md5)
{
CK_OBJECT_CLASS klass = CKO_NETSCAPE_TRUST;
@@ -268,7 +268,7 @@ DEFINE_TEST (trust_create_with_md5)
g_assert (rv == CKR_OK);
}
-DEFINE_TEST (trust_create_with_subject)
+TESTING_TEST (trust_create_with_subject)
{
CK_OBJECT_CLASS klass = CKO_NETSCAPE_TRUST;
@@ -286,7 +286,7 @@ DEFINE_TEST (trust_create_with_subject)
g_assert (rv == CKR_OK);
}
-DEFINE_TEST (trust_create_invalid_checksum)
+TESTING_TEST (trust_create_invalid_checksum)
{
CK_OBJECT_CLASS klass = CKO_NETSCAPE_TRUST;
@@ -304,7 +304,7 @@ DEFINE_TEST (trust_create_invalid_checksum)
g_assert (rv == CKR_ATTRIBUTE_VALUE_INVALID);
}
-DEFINE_TEST (trust_create_with_trusted)
+TESTING_TEST (trust_create_with_trusted)
{
CK_OBJECT_CLASS klass = CKO_NETSCAPE_TRUST;
CK_TRUST trust = CKT_NETSCAPE_TRUSTED;
@@ -323,7 +323,7 @@ DEFINE_TEST (trust_create_with_trusted)
g_assert (rv == CKR_OK);
}
-DEFINE_TEST (trust_create_with_trusted_and_save)
+TESTING_TEST (trust_create_with_trusted_and_save)
{
CK_OBJECT_CLASS klass = CKO_NETSCAPE_TRUST;
CK_TRUST trusted = CKT_NETSCAPE_TRUSTED;
diff --git a/testing/testing-build.sh b/testing/testing-build.sh
index 60fc24a..5439a24 100755
--- a/testing/testing-build.sh
+++ b/testing/testing-build.sh
@@ -16,7 +16,15 @@ usage()
file_to_name()
{
- echo -n $1 | sed -E -e 's/^(unit-)?test-//' -e 's/\.c//' | tr -c '[a-z0-9_]' '_'
+ echo -n $1 | sed -E \
+ -e 's/^(unit-)?test-//' \
+ -e 's/\.c//' \
+ -e 's/\.i//' | tr -c '[a-z0-9_]' '_'
+}
+
+testing_lines()
+{
+ grep -h "__testing_" $@ /dev/null || true
}
build_header()
@@ -24,15 +32,14 @@ build_header()
echo "/* This is auto-generated code. Edit at your own peril. */"
echo "#include \"testing/testing.h\""
echo
+ echo "#ifndef TESTING_HEADER_INCLUDED"
+ echo "#define TESTING_HEADER_INCLUDED"
+ echo
- for file in $@; do
- sed -ne "s/.*DEFINE_SETUP[ ]*(\([^)]\+\))/DECLARE_SETUP (\1);/p" ${file}
- sed -ne "s/.*DEFINE_TEARDOWN[ ]*(\([^)]\+\))/DECLARE_TEARDOWN (\1);/p" ${file}
- sed -ne "s/.*DEFINE_TEST[ ]*(\([^)]\+\))/DECLARE_TEST (\1);/p" ${file}
- sed -ne "s/.*DEFINE_START[ ]*(\([^)]\+\))/DECLARE_START (\1);/p" ${file}
- sed -ne "s/.*DEFINE_STOP[ ]*(\([^)]\+\))/DECLARE_STOP (\1);/p" ${file}
- sed -ne "s/.*DEFINE_EXTERNAL[ ]*(\([^)]\+\))/DECLARE_EXTERNAL (\1);/p" ${file}
- done
+ testing_lines $@ | sed -ne 's/\(.*\)/\1;/p'
+
+ echo
+ echo "#endif /* TESTING_HEADER_INCLUDED */"
echo
}
@@ -42,55 +49,50 @@ build_source()
echo "#include \"testing/testing.h\""
echo "#include \"$BASE.h\""
echo
+ echo "typedef void (*TestingFunc)(int *, const void *);"
+ echo
+
+ lines="$(testing_lines $@)"
# Startup function
echo "static void start_tests (void) {"
- for file in $@; do
- name=`file_to_name ${file}`
- sed -ne "s/.*DEFINE_START[ ]*(\([^)]\+\)).*/ start_\1 ();/p" ${file}
- done
+ echo $lines | sed -n \
+ -e "s/.*\(__testing_start_[0-9a-z_]\+\).*/ \1 ();/p"
echo "}"
echo
# Shutdown function
echo "static void stop_tests (void) {"
- for file in $@; do
- name=`file_to_name ${file}`
- sed -ne "s/.*DEFINE_STOP[ ]*(\([^)]\+\)).*/ stop_\1 ();/p" ${file}
- done
+ echo $lines | sed -n \
+ -e "s/.*\(__testing_stop_[0-9a-z_]\+\).*/ \1 ();/p"
echo "}"
echo
+ # Add all tests to the test case
echo "static void initialize_tests (void) {"
- # Include each file, and build a test case for it
- tcases=""
+ first=YES
for file in $@; do
- name=`file_to_name ${file}`
-
- # Calculate what our setup and teardowns are.
- setup=`sed -ne "s/.*DEFINE_SETUP[ ]*(\([^)]\+\)).*/setup_\1/p" ${file} || echo "NULL"`
- if [ -z "${setup}" ]; then
- setup="NULL"
+ if [ "$first" = "YES" ]; then
+ echo " TestingFunc setup = NULL;"
+ echo " TestingFunc teardown = NULL;"
+ first=NO
fi
- teardown=`sed -ne "s/.*DEFINE_TEARDOWN[ ]*(\([^)]\+\)).*/teardown_\1/p" ${file}`
- if [ -z "${teardown}" ]; then
- teardown="NULL"
- fi
-
- # Add all tests to the test case
- sed -ne "s/.*DEFINE_TEST[ ]*(\([^)]\+\)).*/ g_test_add(\"\/${name}\/\1\", int, NULL, ${setup}, test_\1, ${teardown});/p" ${file}
+ name=$(file_to_name $file)
+ echo " setup = teardown = NULL;"
+ testing_lines $file | sed -n \
+ -e "s/.*\(__testing_setup_[0-9a-z_]\+\).*/setup = \1;/p" \
+ -e "s/.*\(__testing_teardown_[0-9a-z_]\+\).*/teardown = \1;/p" \
+ -e "s/.*__testing_test_\([0-9a-z_]\+\).*/g_test_add(\"\/$name\/\1\", int, NULL, setup, __testing_test_\1, teardown);/p"
done
echo "}"
echo
# External function
echo "static void run_externals (int *ret) {"
- for file in $@; do
- name=`file_to_name ${file}`
- sed -ne "s/.*DEFINE_EXTERNAL[ ]*(\([^)]\+\)).*/ testing_external_run (\"\1\", external_\1, ret);/p" ${file}
- done
+ echo $lines | sed -n \
+ -e "s/.*\(__testing_external_[0-9a-z_]\+\).*/ testing_external_run (\"\1\", \1, ret);/p"
echo "}"
echo
@@ -133,5 +135,5 @@ while [ $# -gt 0 ]; do
shift
done
-build_header $* > $BASE.h
-build_source $* > $BASE.c
+build_header $@ > $BASE.h
+build_source $@ > $BASE.c
diff --git a/testing/testing.h b/testing/testing.h
index 1bc2c5f..ed93ae6 100644
--- a/testing/testing.h
+++ b/testing/testing.h
@@ -24,6 +24,9 @@
#ifndef TESTING_H_
#define TESTING_H_
+/* Don't use this header while preparing tests */
+#ifndef TESTING_PREPARING
+
#include "config.h"
#include <glib.h>
@@ -70,39 +73,24 @@ const gchar* testing_external_name (void);
void testing_external_fail (void);
-#define DECLARE_SETUP(x) \
- void setup_##x(int *v, gconstpointer d)
-#define DEFINE_SETUP(x) \
- void setup_##x(int *__unused G_GNUC_UNUSED, gconstpointer __data G_GNUC_UNUSED)
-
-#define DECLARE_TEARDOWN(x) \
- void teardown_##x(int *v, gconstpointer d)
-#define DEFINE_TEARDOWN(x) \
- void teardown_##x(int *__unused G_GNUC_UNUSED, gconstpointer __data G_GNUC_UNUSED)
-
-#define DECLARE_TEST(x) \
- void test_##x(int *v, gconstpointer d)
-#define DEFINE_TEST(x) \
- void test_##x(int *__unused G_GNUC_UNUSED, gconstpointer __data G_GNUC_UNUSED)
-
-#define DECLARE_START(x) \
- void start_##x(void)
-#define DEFINE_START(x) \
- void start_##x(void)
-
-#define DECLARE_STOP(x) \
- void stop_##x(void)
-#define DEFINE_STOP(x) \
- void stop_##x(void)
-
-#define DECLARE_EXTERNAL(x) \
- void external_##x(void)
-#define DEFINE_EXTERNAL(x) \
- void external_##x(void)
+#define TESTING_SETUP(x) \
+ void __testing_setup_##x(int *__unused, gconstpointer __data)
+#define TESTING_TEARDOWN(x) \
+ void __testing_teardown_##x(int *__unused, gconstpointer __data)
+#define TESTING_TEST(x) \
+ void __testing_test_##x(int *__unused, gconstpointer __data)
+#define TESTING_START(x) \
+ void __testing_start_##x(void)
+#define TESTING_STOP(x) \
+ void __testing_stop_##x(void)
+#define TESTING_EXTERNAL(x) \
+ void __testing_external_##x(void)
#ifndef g_assert_cmpsize
#define g_assert_cmpsize(a, o, b) \
g_assert_cmpuint ((guint)(a), o, (guint)(b))
#endif
+#endif /* TESTING_PREPARING */
+
#endif /* TESTING_H_ */
diff --git a/testing/testing.make b/testing/testing.make
index 7c44ced..0b0ec2b 100644
--- a/testing/testing.make
+++ b/testing/testing.make
@@ -3,17 +3,19 @@
# TESTING_FILES A list of C files with tests
# TESTING_LIBS Libraries to link the tests to
# TESTING_FLAGS C flags for tests
+# TESTING_SOURCES Other sources for tests
# ------------------------------------------------------------------------------
-INCLUDES= \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(srcdir)/.. \
- -I$(srcdir)/../.. \
- $(GTK_CFLAGS) \
- $(GLIB_CFLAGS) \
- $(P11_TESTS_CFLAGS)
+INCLUDES= \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ -I$(srcdir)/.. \
+ -I$(srcdir)/../.. \
+ $(GTK_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ $(P11_TESTS_CFLAGS) \
+ $(TESTING_FLAGS)
LIBS = \
$(GTK_LIBS) \
@@ -24,14 +26,25 @@ LIBS = \
noinst_PROGRAMS= \
run-tests
-test-suite.h: $(TESTING_FILES) Makefile.am $(top_srcdir)/testing/testing-build.sh
- sh $(top_srcdir)/testing/testing-build.sh -b test-suite $(TESTING_FILES)
+PREPROCESSED = \
+ $(TESTING_FILES:.c=.i)
-test-suite.c: test-suite.h
+.c.i:
+ @echo "#include \"testing/testing.h\"" > test-suite.h
+ $(AM_V_GEN)$(CC) -E $(CFLAGS) $(INCLUDES) -o $@ $<
+
+.i.o:
+ $(AM_V_GEN)$(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<
+
+test-suite.c: $(PREPROCESSED) Makefile.am $(top_srcdir)/testing/testing-build.sh
+ sh $(top_srcdir)/testing/testing-build.sh -b test-suite $(PREPROCESSED)
+
+test-suite.h: test-suite.c
run_tests_SOURCES = \
test-suite.c test-suite.h \
- $(TESTING_FILES)
+ $(TESTING_SOURCES) \
+ $(PREPROCESSED)
run_tests_LDADD = \
$(TESTING_LIBS) \
@@ -48,6 +61,10 @@ BUILT_SOURCES = \
test-suite.c \
test-suite.h
+CLEANFILES = \
+ $(PREPROCESSED) \
+ $(BUILT_SOURCES)
+
# ------------------------------------------------------------------------------
# Run the tests
diff --git a/ui/tests/unit-test-util.c b/ui/tests/unit-test-util.c
index 1752d4c..6c9d1cd 100644
--- a/ui/tests/unit-test-util.c
+++ b/ui/tests/unit-test-util.c
@@ -33,19 +33,19 @@
static GKeyFile *key_file = NULL;
-DEFINE_SETUP(prompt_util)
+TESTING_SETUP(prompt_util)
{
egg_libgcrypt_initialize ();
key_file = g_key_file_new ();
}
-DEFINE_TEARDOWN(prompt_util)
+TESTING_TEARDOWN(prompt_util)
{
g_key_file_free (key_file);
key_file = NULL;
}
-DEFINE_TEST(encode_decode_mpi)
+TESTING_TEST(encode_decode_mpi)
{
gcry_mpi_t mpi, check;
@@ -61,7 +61,7 @@ DEFINE_TEST(encode_decode_mpi)
gcry_mpi_release (check);
}
-DEFINE_TEST(decode_nonexistant_mpi)
+TESTING_TEST(decode_nonexistant_mpi)
{
gcry_mpi_t mpi;
@@ -69,7 +69,7 @@ DEFINE_TEST(decode_nonexistant_mpi)
g_assert_not_reached ();
}
-DEFINE_TEST(encode_decode_hex)
+TESTING_TEST(encode_decode_hex)
{
gchar buffer[32];
gpointer check;
@@ -85,7 +85,7 @@ DEFINE_TEST(encode_decode_hex)
g_free (check);
}
-DEFINE_TEST(decode_nonexistant_hex)
+TESTING_TEST(decode_nonexistant_hex)
{
gsize n_data;
@@ -126,7 +126,7 @@ do_encrypt_decrypt_text (const gchar *text)
g_assert_cmpstr (check, ==, text);
}
-DEFINE_TEST(encrypt_decrypt_text)
+TESTING_TEST(encrypt_decrypt_text)
{
do_encrypt_decrypt_text ("");
do_encrypt_decrypt_text ("blah");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]