2021-01-29 06:31:58 -05:00
|
|
|
//
|
|
|
|
// FILE: unit_test_001.cpp
|
|
|
|
// AUTHOR: Rob Tillaart
|
|
|
|
// DATE: 2020-12-28
|
|
|
|
// PURPOSE: unit tests for the HT16K33
|
|
|
|
// https://github.com/RobTillaart/HT16K33
|
|
|
|
// 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 "HT16K33.h"
|
|
|
|
|
|
|
|
|
|
|
|
unittest_setup()
|
|
|
|
{
|
2021-12-19 09:24:23 -05:00
|
|
|
fprintf(stderr, "HT16K33_LIB_VERSION: %s\n", (char *) HT16K33_LIB_VERSION);
|
2021-01-29 06:31:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
unittest_teardown()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
unittest(test_new_operator)
|
|
|
|
{
|
|
|
|
assertEqualINF(exp(800));
|
|
|
|
assertEqualINF(0.0/0.0);
|
|
|
|
assertEqualINF(42);
|
|
|
|
|
|
|
|
assertEqualNAN(INFINITY - INFINITY);
|
|
|
|
assertEqualNAN(0.0/0.0);
|
|
|
|
assertEqualNAN(42);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
unittest(test_constructor)
|
|
|
|
{
|
|
|
|
HT16K33 seg(0x70);
|
|
|
|
|
|
|
|
fprintf(stderr, "None of the functions return anything...\n");
|
|
|
|
|
|
|
|
assertEqual(1, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
unittest_main()
|
|
|
|
|
|
|
|
// --------
|