Acknowledged

bug: Test.assert, Test.assertEqual, Test.assertEqualMessage don't throw exception

Both in SDK 6.4.2 and 7.1.0 the following  tests should fail (throw an AssertException) but they PASS:

    (:test)
    function barAssertTest(logger as Logger) as Boolean {
        var expected = "FOO";
        var actual = "BAR";
        Test.assert(expected.equals(actual));
        return true;
    }

    (:test)
    function barEqualTest(logger as Logger) as Boolean {
        var expected = "FOO";
        var actual = "BAR";
        Test.assertEqual(expected, actual);
        return true;
    }

    (:test)
    function barEqualMessageTest(logger as Logger) as Boolean {
        var expected = "FOO";
        var actual = "BAR";
        Test.assertEqualMessage(expected, actual, "expected: " + expected + ", actual: " + actual + ".");
        return true;
    }

I run the tests from VSC on fr955 using the following configuration in launch.json:

        {
            "type": "monkeyc",
            "request": "launch",
            "name": "Run Tests",
            "runTests": true,
            "device": "${command:GetTargetDevice}"
        },

NOTE: I haven't tested other functions or other devices, so probably there are other related bugs as well.

Parents
  • I found that this bug only seems to apply to CIQ 5 devices (regardless of SDK). Non CIQ 5 devices (e.g. descentmk2) work as expected (i.e. tests which throw an exception return ERROR, instead of PASS/FAIL as per function return value), regardless of SDK.

Comment
  • I found that this bug only seems to apply to CIQ 5 devices (regardless of SDK). Non CIQ 5 devices (e.g. descentmk2) work as expected (i.e. tests which throw an exception return ERROR, instead of PASS/FAIL as per function return value), regardless of SDK.

Children
No Data