Tests added

Signed-off-by: Pascal Brand <pascal.brand@st.com>
diff --git a/host/xtest/xtest_test.c b/host/xtest/xtest_test.c
new file mode 100644
index 0000000..8fae19b
--- /dev/null
+++ b/host/xtest/xtest_test.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014, STMicroelectronics International N.V.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include "xtest_test.h"
+#include <tee_client_api.h>
+#include <ta_create_fail_test.h>
+#include <ta_crypt.h>
+#include <ta_os_test.h>
+#include <ta_rpc_test.h>
+#include <ta_sims_test.h>
+#include <ta_storage.h>
+#include <enc_fs_key_manager_test.h>
+#include <tee_api_defines.h>
+
+ADBG_ENUM_TABLE_DEFINE_BEGIN(TEEC_Result)
+ADBG_ENUM_TABLE_ENTRY(TEEC_SUCCESS),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_CORRUPT_OBJECT),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_CORRUPT_OBJECT_2),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_STORAGE_NOT_AVAILABLE),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_STORAGE_NOT_AVAILABLE_2),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_GENERIC),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_ACCESS_DENIED),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_CANCEL),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_ACCESS_CONFLICT),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_EXCESS_DATA),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BAD_FORMAT),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BAD_PARAMETERS),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BAD_STATE),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_ITEM_NOT_FOUND),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_NOT_IMPLEMENTED),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_NOT_SUPPORTED),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_NO_DATA),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_OUT_OF_MEMORY),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BUSY),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_COMMUNICATION),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_SECURITY),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_SHORT_BUFFER),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_EXTERNAL_CANCEL),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_OVERFLOW),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_TARGET_DEAD),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_STORAGE_NO_SPACE),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_MAC_INVALID),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_SIGNATURE_INVALID),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_TIME_NOT_SET),
+ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_TIME_NEEDS_RESET)
+ADBG_ENUM_TABLE_DEFINE_END(TEEC_Result);
+
+ADBG_ENUM_TABLE_DEFINE_BEGIN(TEEC_ErrorOrigin)
+ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_API),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_COMMS),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_TEE),
+ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_TRUSTED_APP)
+ADBG_ENUM_TABLE_DEFINE_END(TEEC_ErrorOrigin);
+
+#define ECC_SELF_TEST_UUID \
+		{ 0xf34f4f3c, 0xab30, 0x4573,  \
+		{ 0x91, 0xBF, 0x3C, 0x57, 0x02, 0x4D, 0x51, 0x99 } }
+
+const TEEC_UUID crypt_user_ta_uuid = TA_CRYPT_UUID;
+const TEEC_UUID os_test_ta_uuid = TA_OS_TEST_UUID;
+const TEEC_UUID create_fail_test_ta_uuid = TA_CREATE_FAIL_TEST_UUID;
+const TEEC_UUID ecc_test_ta_uuid = ECC_SELF_TEST_UUID;
+const TEEC_UUID rpc_test_ta_uuid = TA_RPC_TEST_UUID;
+const TEEC_UUID sims_test_ta_uuid = TA_SIMS_TEST_UUID;
+const TEEC_UUID storage_ta_uuid = TA_STORAGE_UUID;
+const TEEC_UUID enc_fs_key_manager_test_ta_uuid = ENC_FS_KEY_MANAGER_TEST_UUID;
+