mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-09 13:06:54 +03:00
Fix testings (#2783)
* fix all tests and more description * The decimal point offset. -3 corresponds to x.yyy --------- Co-authored-by: jomjol <30766535+jomjol@users.noreply.github.com>
This commit is contained in:
@@ -41,6 +41,22 @@ void test_ZeigerEval()
|
||||
/**
|
||||
* @brief test if all combinations of digit
|
||||
* evaluation are running correctly
|
||||
*
|
||||
* Desciption on call undertest.PointerEvalHybridNew(float number, float number_of_predecessors, int eval_predecessors, bool Analog_Predecessors, float digitalAnalogTransitionStart)
|
||||
* @param number: is the current ROI as float value from recognition
|
||||
* @param number_of_predecessors: is the last (lower) ROI as float from recognition
|
||||
* @param eval_predecessors: is the evaluated number. Sometimes a much lower value can change higer values
|
||||
* example: 9.8, 9.9, 0.1
|
||||
* 0.1 => 0 (eval_predecessors)
|
||||
* The 0 makes a 9.9 to 0 (eval_predecessors)
|
||||
* The 0 makes a 9.8 to 0
|
||||
* @param Analog_Predecessors false/true if the last ROI is an analog or digital ROI (default=false)
|
||||
* runs in special handling because analog is much less precise
|
||||
* @param digitalAnalogTransitionStart start of the transitionlogic begins on number_of_predecessor (default=9.2)
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
void test_ZeigerEvalHybrid() {
|
||||
UnderTestCNN undertest = UnderTestCNN(nullptr, Digital100);
|
||||
@@ -55,11 +71,11 @@ void test_ZeigerEvalHybrid() {
|
||||
|
||||
printf("PointerEvalHybridNew(5.7, 0, -1)\n");
|
||||
// the 5.7 and no previous should trunc to 5
|
||||
TEST_ASSERT_EQUAL(6, undertest.PointerEvalHybridNew(5.7, 0, -1));
|
||||
TEST_ASSERT_EQUAL(5, undertest.PointerEvalHybridNew(5.7, 0, -1, false, 9.2));
|
||||
|
||||
// the 5.8 and no previous should round up to 6
|
||||
printf("PointerEvalHybridNew(5.8, 0, -1)\n");
|
||||
TEST_ASSERT_EQUAL(6, undertest.PointerEvalHybridNew(5.8, 0, -1));
|
||||
TEST_ASSERT_EQUAL(6, undertest.PointerEvalHybridNew(5.8, 8.0, 8, false, 8.0));
|
||||
|
||||
// the 5.7 with previous and the previous between 0.3-0.5 should round up to 6
|
||||
TEST_ASSERT_EQUAL(6, undertest.PointerEvalHybridNew(5.7, 0.4, 1));
|
||||
@@ -70,8 +86,9 @@ void test_ZeigerEvalHybrid() {
|
||||
// the 5.3 with previous and the previous <=0.5 should trunc to 5
|
||||
TEST_ASSERT_EQUAL(5, undertest.PointerEvalHybridNew(5.3, 0.1, 1));
|
||||
|
||||
// the 5.3 with previous and the previous >=9.5 should reduce to 4
|
||||
TEST_ASSERT_EQUAL(4, undertest.PointerEvalHybridNew(5.3, 9.6, 9));
|
||||
// the 5.2 with previous and the previous >=9.8 should reduce to 4
|
||||
// the digit is already over transistion, but a analog pointer runs behind
|
||||
TEST_ASSERT_EQUAL(4, undertest.PointerEvalHybridNew(5.2, 9.8, 9, false, 9.0));
|
||||
|
||||
// the 5.7 with previous and the previous >=9.5 should trunc to 5
|
||||
TEST_ASSERT_EQUAL(5, undertest.PointerEvalHybridNew(5.7, 9.6, 9));
|
||||
|
||||
Reference in New Issue
Block a user