mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
55 lines
1.0 KiB
Plaintext
55 lines
1.0 KiB
Plaintext
//
|
|
// FILE: unit_test_001.cpp
|
|
// AUTHOR: Rob Tillaart
|
|
// DATE: 2020-12-20
|
|
// PURPOSE: unit tests for the DS1821
|
|
// https://github.com/RobTillaart/DS1821
|
|
// https://github.com/Arduino-CI/arduino_ci/blob/master/REFERENCE.md
|
|
//
|
|
|
|
// supported assertions
|
|
// https://github.com/Arduino-CI/arduino_ci/blob/master/cpp/unittest/Assertion.h#L33-L42
|
|
// ----------------------------
|
|
// assertEqual(expected, actual)
|
|
// assertNotEqual(expected, actual)
|
|
// assertLess(expected, actual)
|
|
// assertMore(expected, actual)
|
|
// assertLessOrEqual(expected, actual)
|
|
// assertMoreOrEqual(expected, actual)
|
|
// assertTrue(actual)
|
|
// assertFalse(actual)
|
|
// assertNull(actual)
|
|
// assertNotNull(actual)
|
|
|
|
#include <ArduinoUnitTests.h>
|
|
|
|
|
|
#include "Arduino.h"
|
|
#include "DS1821.h"
|
|
|
|
|
|
unittest_setup()
|
|
{
|
|
fprintf(stderr, "DS1821_H_LIB_VERSION: %s\n", (char *) DS1821_H_LIB_VERSION);
|
|
}
|
|
|
|
|
|
unittest_teardown()
|
|
{
|
|
}
|
|
|
|
|
|
unittest(test_constructor)
|
|
{
|
|
OneWire ow(10);
|
|
DS1821 ds(&ow);
|
|
|
|
int n = ds.requestTemperature();
|
|
assertEqual(1, 1);
|
|
}
|
|
|
|
|
|
unittest_main()
|
|
|
|
// --------
|