Files

copied
Last update 7 years 1 month by Nick
Filesteststest_util_data_quantity
..
readme.md
test_util_data_quantity.ino
readme.md

Purpose of the tests

To confirm that any of the recent modifications of class Quantity and its child classes in file util_data, namespace util::quantity (physical quantities) did not introduce anomalies to class performance

Running the tests

Copy here all necessary files from main project directory. The files to be copied are as follows:

  • util_data.h
  • util_data.cpp

Copy here all necessary files from tests/common directory. The files to be copied are as follows:

  • test.h

Open .ino file in IDE, compile, upload and open serial monitor to observe test results

Expected test results

The following is expected in serial monitor window:

---------------- TESTING STARTED ----------------

Test function started: static void TestQuantityAndGeneric::testvalidategenericQuantityexpectTrue(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityAndGeneric::testvalidategenericQuantityInvalidValueexpectFalse(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityAndGeneric::testaccessorsgetGenericQuantityDataexpectCorrectValues(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityAndGeneric::testaccessorsgetGenericAsQuantityDataexpectCorrectValues(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityAndGeneric::testcopyConstructorcopyFromGenericQuantityexpectSameValues(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityAndGeneric::testinitFromParametersConstructorunitTextNullexpectEmptyUnitText(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityAndGeneric::testinitFromParametersConstructorvalueExceedsMinRangeexpectValueLimitedToMinRange(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityAndGeneric::testinitFromParametersConstructorvalueExceedsMaxRangeexpectValueLimitedToMaxRange(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityAndGeneric::testassignmentassignFromGenericToGenericexpectSameValues(), file testutildataquantity.ino PASSED Test function started: static void TestDimensionless::initDimensionlessQuantityexpectCorrectData(), file testutildataquantity.ino PASSED Test function started: static void TestDimensionless::conversionconvertFromNoneToPercentAndBackexpectCorrectData(), file testutildataquantity.ino PASSED Test function started: static void TestDimensionless::conversionconvertFromPercentToNoneAndBackexpectCorrectData(), file testutildataquantity.ino PASSED Test function started: static void TestTemperature::initTemperatureexpectCorrectData(), file testutildataquantity.ino PASSED Test function started: static void TestTemperature::conversionconvertFromCelsiusToFahrenheitAndBackexpectCorrectData(), file testutildataquantity.ino PASSED Test function started: static void TestTemperature::conversionconvertFromFahrenheitToCelsiusAndBackexpectCorrectData(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityIntrospectionReflection::testClassTypeMatch(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityIntrospectionReflection::testObjectTypeMatch(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityIntrospectionReflection::testClassTypeAndObjectTypeMatch(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityIntrospectionReflection::testCopiedObjectTypeMatch(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityIntrospectionReflection::testReflectionGeneric(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityIntrospectionReflection::testReflectionDimensionless(), file testutildataquantity.ino PASSED Test function started: static void TestQuantityIntrospectionReflection::testReflectionTemperature(), file testutildata_quantity.ino PASSED sizeof(util::quantity::Quantity) 52 sizeof(util::quantity::Generic) 52 sizeof(util::quantity::Dimensionless) 52 sizeof(util::quantity::Temperature) 52

---------------- TESTING FINISHED --------------- Test functions passed: 22 Test functions failed: 0

Note: class sizes are for reference only.

Failed tests

The following example illustrates failed tests reporting:

Test function started: static void test(), file test.ino FAILED in line 1, file test.ino

Report a bug