Sha256: b3b05e87ac62d463ef489eb2e8aca41d2b6829ef8edaab27622c9c4889a59dba

Contents?: true

Size: 1.02 KB

Versions: 27

Compression:

Stored size: 1.02 KB

Contents

#include "unity.h"
#include "Types.h"
#include "AdcHardware.h"
#include "MockAdcHardwareConfigurator.h"
#include "MockAdcTemperatureSensor.h"

void setUp(void)
{
}

void tearDown(void)
{
}

void testInitShouldDelegateToConfiguratorAndTemperatureSensor(void)
{
  Adc_Reset_Expect();
  Adc_ConfigureMode_Expect();
  Adc_EnableTemperatureChannel_Expect();
  Adc_StartTemperatureSensorConversion_Expect();

  AdcHardware_Init();
}

void testGetSampleCompleteShouldReturn_FALSE_WhenTemperatureSensorSampleReadyReturns_FALSE(void)
{
  Adc_TemperatureSensorSampleReady_ExpectAndReturn(FALSE);
  TEST_ASSERT(!AdcHardware_GetSampleComplete());
}

void testGetSampleCompleteShouldReturn_TRUE_WhenTemperatureSensorSampleReadyReturns_TRUE(void)
{
  Adc_TemperatureSensorSampleReady_ExpectAndReturn(TRUE);
  TEST_ASSERT(AdcHardware_GetSampleComplete());
}

void testGetSampleShouldDelegateToAdcTemperatureSensor(void)
{
  uint16 sample;
  Adc_ReadTemperatureSensor_ExpectAndReturn(847);

  sample = AdcHardware_GetSample();
  TEST_ASSERT_EQUAL(847, sample);
}

Version data entries

27 entries across 14 versions & 1 rubygems

Version Path
ceedling-0.31.1 vendor/cmock/examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.31.1 examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.31.0 vendor/cmock/examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.31.0 examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.30.0 examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.30.0 vendor/cmock/examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.28.3 vendor/cmock/examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.28.3 examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.28.2 vendor/cmock/examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.28.2 examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.28.1 vendor/cmock/examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.28.1 examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.27.0 examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.27.0 vendor/cmock/examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.25.0 vendor/cmock/examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.25.0 examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.24.0 vendor/cmock/examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.24.0 examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.22.0 examples/temp_sensor/test/TestAdcHardware.c
ceedling-0.22.0 vendor/cmock/examples/temp_sensor/test/TestAdcHardware.c