Skip to content

Unittests #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 13, 2018
Merged

Unittests #1

merged 5 commits into from
Feb 13, 2018

Conversation

AnttiKauppila
Copy link
Collaborator

Notes:

  • Pull requests will not be accepted until the submitter has agreed to the contributer agreement.
  • This is just a template, so feel free to use/remove the unnecessary things

Description

A few sentences describing the overall goals of the pull request's commits.

Status

READY/IN DEVELOPMENT/HOLD

Migrations

If this PR changes any APIs or behaviors, give a short description of what API users should do when this PR is merged.

YES | NO

Related PRs

List related PRs against other branches:

branch PR
other_pr_production link
other_pr_master link

Todos

  • Tests
  • Documentation

Deploy notes

Notes regarding the deployment of this PR. These should note any required changes in the build environment, tools, compilers and so on.

Steps to test or reproduce

Outline the steps to test or reproduce the PR here.

@jarvte jarvte merged commit 23b69a2 into master Feb 13, 2018
@jarvte jarvte deleted the unittests branch February 13, 2018 08:29
AriParkkila pushed a commit that referenced this pull request Mar 2, 2018
AriParkkila pushed a commit that referenced this pull request Jul 27, 2018
`handle_error` calls `MBED_CALLER_ADDR()`, but this is always a location from within platform/mbed_error.c. This is because `handle_error` is declared static. This does not cause the function to be inlined however. Instead, it is called by each function within mbed_error.c. For example, mbed_error yields this code:

```
000625c8 <mbed_error>:
   625c8:       b510            push    {r4, lr}
   625ca:       460c            mov     r4, r1
   625cc:       4611            mov     r1, r2
   625ce:       461a            mov     r2, r3
   625d0:       9b02            ldr     r3, [sp, #8]
   625d2:       f7ff feff       bl      623d4 <handle_error>
   625d6:       b968            cbnz    r0, 625f4 <mbed_error+0x2c>
   625d8:       4620            mov     r0, r4
   625da:       f7ff ff67       bl      624ac <print_error_report.constprop.0>
   625de:       f7ff fea8       bl      62332 <core_util_is_isr_active>
   625e2:       b910            cbnz    r0, 625ea <mbed_error+0x22>
   625e4:       f7ff fe9f       bl      62326 <core_util_are_interrupts_enabled>
   625e8:       b908            cbnz    r0, 625ee <mbed_error+0x26>
   625ea:       bf30            wfi
   625ec:       e7fd            b.n     625ea <mbed_error+0x22>
   625ee:       2001            movs    r0, #1
   625f0:       f000 f948       bl      62884 <__wrap_exit>
   625f4:       4800            ldr     r0, [pc, #0]    ; (625f8 <mbed_error+0x30>)
   625f6:       bd10            pop     {r4, pc}
   625f8:       80ff010f        .word   0x80ff010f
```

Note that at `625d2` there is a bl to handle error. That replaces the LR, which means that ALL calls to mbed_error will report a location of 0x625d6 or 0x625d7 (user vs. supervisor). I do not expect that this was the intention of the code. The simplest fix is to change line 99:

```C
static inline mbed_error_status_t handle_error(mbed_error_status_t error_status, unsigned int error_value, const char *filename, int line_number)
```

Since `handle_error()` will be inlined, the link register will be kept the same, so `MBED_CALLER_ADDR()` will yield the expected result. However, there is no guarantee that the compiler will respect the `inline` keyword in all circumstances.

The result is that each function that wishes to report its caller must extract its caller. This code cannot be centralised.

I have modified `mbed_error.c` to report the caller of each error reporting function, rather than the error reporting function itself.
AriParkkila pushed a commit that referenced this pull request Sep 3, 2018
Fix default spi speed to 40Mhz
AriParkkila pushed a commit that referenced this pull request Sep 3, 2018
Fix const attribute mismatch on size function
AriParkkila pushed a commit that referenced this pull request Sep 3, 2018
Added more warnings about FlashIAP
AriParkkila pushed a commit that referenced this pull request Sep 3, 2018
NFC: Amend ndef parsing design.
AriParkkila pushed a commit that referenced this pull request Sep 3, 2018
AriParkkila pushed a commit that referenced this pull request Oct 15, 2018
choose which lpc1768 timer to use for us_ticker.c
AriParkkila pushed a commit that referenced this pull request Nov 16, 2018
AriParkkila pushed a commit that referenced this pull request Nov 29, 2018
AriParkkila pushed a commit that referenced this pull request Mar 21, 2019
Finish memory protection and add static assert
AriParkkila pushed a commit that referenced this pull request Jul 18, 2019
AriParkkila pushed a commit that referenced this pull request Jul 18, 2019
Fix LWIP warning issues found by Coverity scan

lwip_dns.c in function: dns_add_interface_server
CID 1399051 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)10. buffer_size_warning: Calling strncpy with a maximum size argument of 6 bytes on destination array new_interface_server->interface_name of size 6 bytes might leave the destination string unterminated.
line 434 strncpy(new_interface_server->interface_name, interface_name, INTERFACE_NAME_MAX_SIZE);

lwip_ip4_frag.c in function: ip_reass_free_complete_datagram

CID 1373164 (#1 of 1): Dereference after null check (FORWARD_NULL)7. var_deref_model: Passing null pointer prev to ip_reass_dequeue_datagram, which dereferences it. [show details]
line 209 ip_reass_dequeue_datagram(ipr, prev);

lwip_ip4_frag.c in function: ip_reass

CID 1373163 (#1-2 of 2): Dereference after null check (FORWARD_NULL)38. var_deref_model: Passing null pointer ipr_prev to ip_reass_dequeue_datagram, which dereferences it. [show details]
line 663 ip_reass_dequeue_datagram(ipr, ipr_prev);

lwip_api_msg.c in function: lwip_netconn_do_connected

CID 1373162 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)10. var_deref_model: Passing null pointer op_completed_sem to sys_sem_signal, which dereferences it. [show details]
line 1336 sys_sem_signal(op_completed_sem);
AriParkkila pushed a commit that referenced this pull request Jul 18, 2019
AriParkkila pushed a commit that referenced this pull request Sep 2, 2019
Adding explicit type conversion to overloaded log function
AriParkkila pushed a commit that referenced this pull request Dec 20, 2019
Update CMSIS-pack info for STM32G-family
AriParkkila pushed a commit that referenced this pull request Jan 29, 2020
Signed-off-by: PARKJIHOON <jh6186.park@samsung.com>
AriParkkila pushed a commit that referenced this pull request Apr 9, 2020
Signed-off-by: PARKJIHOON <jh6186.park@samsung.com>
AriParkkila pushed a commit that referenced this pull request Jun 4, 2020
Removing namespace pollution & rf ctrls refactor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants