#include "MockI2C.hpp"

#include "CppUTest/TestHarness.h"
#include "CppUTestExt/MockSupport.h"
#include <iostream>

MockI2C::~MockI2C()
{
}

I2C::status MockI2C::transfer(op_t& op, const cb_t& cb)
{
	mock()
		.actualCall("transfer")
		.onObject(this)
		.withOutputParameterOfType("I2C::op_t", "op", reinterpret_cast<void*>(&op));

	// fire off the callback
	cb(I2C::status::ok);

	return static_cast<I2C::status>(mock().intReturnValue());
}