 
 void processMessage(const byte* message, size_t length)
 {
-  InMemoryStream stream;
+  FakeStream stream;
   Firmata.begin(stream);
 
   for (size_t i = 0; i < length; i++)

  suite.run();
}

class InMemoryStream : public Stream
{
public:
  virtual ~InMemoryStream() 
  {
  }

  size_t write(uint8_t val)
  {
    _bytesWritten += (char) val;

    return size_t(1);
  }

  void flush() 
  {
  }

  const String& bytesWritten() 
  {
    return _bytesWritten;
  }

  void nextByte(byte b)
  {
    _nextByte = b;
  }

  int available() 
  {
    return 1;
  }

  int read() 
  {
    return _nextByte;
  }

  int peek()
  {
    return _nextByte;
  }

private:
  String _bytesWritten;
  byte _nextByte;
};

void assertStringsEqual(Test& __test__, const char* expected, const String& actual)
{
  size_t expectedLength = strlen(expected);

  assertEquals(1, _digitalPort);
}

test(setFirmwareVersionDoesNotLeakMemory)
{
  Firmata.setFirmwareVersion(1, 0);
  int initialMemory = freeMemory();

  Firmata.setFirmwareVersion(1, 0);

  assertEquals(0, initialMemory - freeMemory());
}
