test(slot buffer): add assertion tests

This patch also fixes the dest and src addresses not being checked for
ns_buffer_read() and ns_buffer_write() respectively as well as some
lines exceeding 80 cols on granule.cpp

Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: I71cac6e85294fac828c950b227cf9d9fb27164ae
diff --git a/lib/realm/tests/realm_test_utils.c b/lib/realm/tests/realm_test_utils.c
index 9bc3bde..9f00b97 100644
--- a/lib/realm/tests/realm_test_utils.c
+++ b/lib/realm/tests/realm_test_utils.c
@@ -5,6 +5,8 @@
 
 #include <buffer.h>
 #include <buffer_private.h>
+#include <granule.h>
+#include <host_utils.h>
 #include <xlat_tables.h>
 
 /*
@@ -45,3 +47,12 @@
 	/* No buffer slot found */
 	return (uintptr_t)NULL;
 }
+
+/*
+ * Function to return the base pointer to granule structure.
+ * This function relies on addr_to_granule().
+ */
+struct granule *realm_test_util_granule_struct_base(void)
+{
+	return addr_to_granule(host_util_get_granule_base());
+}