#include <gtest/gtest.h>
#include <errors.h>
#include <system.h>
#include "mock_memorymodule.h"

class SystemTest : public testing::Test {
protected:
    System sys;
    StrictMockMemoryModule mem;
};

//Dumy test
TEST_F(SystemTest, TestMemoryAddressTranslation) {
    unsigned char dummy_buffer[10];
    int iret;

    iret = sys.installMemory(mem, 10, 10);
    ASSERT_EQ(iret, ERR_SUCCESS) << "Module installion failed";

    iret = sys.readMemory(10, 5, dummy_buffer);
    ASSERT_EQ(iret, ERR_SUCCESS) << "Memory read failed";
}
#include <gtest/gtest.h>
#include <system.h>
#include "mock_memorymodule.h"

class SystemTest : public testing::Test {
protected:
    System sys;
    StrictMockMemoryModule mem;
};

//Dumy test
TEST_F(SystemTest, TestMemoryAddressTranslation) {
    unsigned char dummy_buffer[10];
    sys.installMemory(mem, 10, 10);
    int iret = sys.readMemory(10, 5, dummy_buffer);
}
--- 
+++ 
@@ -1,4 +1,5 @@
 #include <gtest/gtest.h>
+#include <errors.h>
 #include <system.h>
 #include "mock_memorymodule.h"
 
@@ -11,6 +12,11 @@
 //Dumy test
 TEST_F(SystemTest, TestMemoryAddressTranslation) {
     unsigned char dummy_buffer[10];
-    sys.installMemory(mem, 10, 10);
-    int iret = sys.readMemory(10, 5, dummy_buffer);
+    int iret;
+
+    iret = sys.installMemory(mem, 10, 10);
+    ASSERT_EQ(iret, ERR_SUCCESS) << "Module installion failed";
+
+    iret = sys.readMemory(10, 5, dummy_buffer);
+    ASSERT_EQ(iret, ERR_SUCCESS) << "Memory read failed";
 }
Create example memory read test
