Posts

Showing posts from September, 2020

Ceedling workspace in Visual Studio Code

Image
      Test Driven Development is required to go through multiple times of small changes in production code and test code concurrently. It would be nice to have GUI IDE to load all files in one workspace. Also, you might want to debug test code during run-time instead of stepping through line by line with gdb command. Visual Studio Code with Ceedling plug-in can make this process easier.

Ceedling: mock hardware software interface by using StubWithCallback

Image
      Auto generated mock files in Ceedling provides Ignore and Expect functions as well as StubWithCallback function.  StubWithCallback demonstrates  hardware software interface. For example, external EEPROM can be accessed via specific SPI command such as read byte and write byte. It means that there is no direct way to access EEPROM contents. It would be nice to access EEPROM during unit testing. To do this, define simulated EEPROM in host RAM and the read byte function and write byte function should be implemented as StubWIthCallback.  I learned this Ceedling feature from this blog( http://www.electronvector.com/blog/unit-testing-with-flash-eeprom ).