ARMmbed / core-util

DEPRECATED: Mbed 3 utilities library
Other
12 stars 17 forks source link

sbrk - align + set to minimum size negative sizes #83

Closed 0xc0170 closed 8 years ago

0xc0170 commented 8 years ago

Fixes #81. Please open the issue #81 for more information.

Tested on k64f:

+---------------+---------------+--------------------------+--------+--------------------+-------------+
| target        | platform_name | test                     | result | elapsed_time (sec) | copy_method |
+---------------+---------------+--------------------------+--------+--------------------+-------------+
| frdm-k64f-gcc | K64F          | core-util-test-sbrk-mini | OK     | 2.39               | shell       |
+---------------+---------------+--------------------------+--------+--------------------+-------------+

@bogdanm @bremoran

0xc0170 commented 8 years ago

Before the changeset applied:

>>> Running 12 test cases...

>>> Running case #1: 'SBRK001 Exercise sbrk by INC_SMALL'...
>>> 'SBRK001 Exercise sbrk by INC_SMALL': 1 passed, 0 failed

>>> Running case #2: 'SBRK002 Exercise sbrk by 5'...
:34::FAIL: Expected 0 Was 3
>>> 'SBRK002 Exercise sbrk by 5': 0 passed, 1 failed with reason 'Assertion Failed'

>>> Test cases: 1 passed, 1 failed with reason 'Assertion Failed'
>>> TESTS FAILED!
{{failure}}
{{end}}
mbedgt: mbed-host-test-runner: stopped
mbedgt: mbed-host-test-runner: returned 'FAIL'
mbedgt: test on hardware with target id: 02400226b1340e4f0000000000000000000000004cedf3f7
        test 'core-util-test-test-sbrk' ........................................................ FAIL in 2.41 sec
mbedgt: shuffle seed: 0.4684602199
mbedgt: test report:
+---------------+---------------+--------------------------+--------+--------------------+-------------+
| target        | platform_name | test                     | result | elapsed_time (sec) | copy_method |
+---------------+---------------+--------------------------+--------+--------------------+-------------+
| frdm-k64f-gcc | K64F          | core-util-test-test-sbrk | FAIL   | 2.41               | shell       |
+---------------+---------------+--------------------------+--------+--------------------+-------------+

With this changeset:

>>> Running 12 test cases...

>>> Running case #1: 'SBRK001 Exercise sbrk by INC_SMALL'...
>>> 'SBRK001 Exercise sbrk by INC_SMALL': 1 passed, 0 failed

>>> Running case #2: 'SBRK002 Exercise sbrk by 5'...
>>> 'SBRK002 Exercise sbrk by 5': 1 passed, 0 failed

>>> Running case #3: 'SBRK003 Exercise sbrk by 12'...
>>> 'SBRK003 Exercise sbrk by 12': 1 passed, 0 failed

>>> Running case #4: 'SBRK004 Exercise sbrk by 17'...
>>> 'SBRK004 Exercise sbrk by 17': 1 passed, 0 failed

>>> Running case #5: 'SBRK005 Exercise sbrk by 20'...
>>> 'SBRK005 Exercise sbrk by 20': 1 passed, 0 failed

>>> Running case #6: 'SBRK006 Exercise sbrk by 5 (repeat 10x)'...
>>> 'SBRK006 Exercise sbrk by 5 (repeat 10x)': 1 passed, 0 failed

>>> Running case #7: 'SBRK007 Exercise sbrk by 12 (repeat 10x)'...
>>> 'SBRK007 Exercise sbrk by 12 (repeat 10x)': 1 passed, 0 failed

>>> Running case #8: 'SBRK008 Exercise sbrk by 17 (repeat 10x)'...
>>> 'SBRK008 Exercise sbrk by 17 (repeat 10x)': 1 passed, 0 failed

>>> Running case #9: 'SBRK009 Exercise sbrk by 20 (repeat 10x)'...
>>> 'SBRK009 Exercise sbrk by 20 (repeat 10x)': 1 passed, 0 failed

>>> Running case #10: 'SBRK010 Increase heap by a value smaller than the minimum alignment'...
>>> 'SBRK010 Increase heap by a value smaller than the minimum alignment': 1 passed, 0 failed

>>> Running case #11: 'SBRK011 Increase heap by the maximum available space plus one'...
>>> 'SBRK011 Increase heap by the maximum available space plus one': 1 passed, 0 failed

>>> Running case #12: 'SBRK012 Increase heap by the maximum available space'...
>>> 'SBRK012 Increase heap by the maximum available space': 1 passed, 0 failed

>>> Test cases: 12 passed, 0 failed
{{success}}
{{end}}
mbedgt: mbed-host-test-runner: stopped
mbedgt: mbed-host-test-runner: returned 'OK'
mbedgt: test on hardware with target id: 02400226b1340e4f0000000000000000000000004cedf3f7
        test 'core-util-test-test-sbrk' ........................................................ OK in 4.01 sec
mbedgt: shuffle seed: 0.0088042930
mbedgt: test report:
+---------------+---------------+--------------------------+--------+--------------------+-------------+
| target        | platform_name | test                     | result | elapsed_time (sec) | copy_method |
+---------------+---------------+--------------------------+--------+--------------------+-------------+
| frdm-k64f-gcc | K64F          | core-util-test-test-sbrk | OK     | 4.01               | shell       |
+---------------+---------------+--------------------------+--------+--------------------+-------------+
bogdanm commented 8 years ago

+1