embeddedartistry / libc

libc targeted for embedded systems usage. Reduced set of functionality (due to embedded nature). Chosen for portability and quick bringup.
MIT License
504 stars 67 forks source link

Implementing the memmove() unittests #184

Closed eriols closed 1 year ago

eriols commented 1 year ago

Just a question before submitting a PR for the above. Should we implement these as: 1) do nothing - as the memmove implementation = memcpy and memcpy has a unittest should we just remove the bullet that says that memmove needs a unit test? A comment that these tests are tested by memcpy would be useful I guess. 2) make the memcpy unittest public and reference it from the memmove one? 3) do a copy/pase of the memcpy unit test to the memmove one?

Thanks!

phillipjohnston commented 1 year ago

I would prefer this:

do a copy/pase of the memcpy unit test to the memmove one?

As the initial implementation. It is an implementation detail that memmove uses memcpy under the hood, and they have slightly different contracts. Memmove should allow the source/destination memory to overlap, and there is likely the need for some tests in that area.

phillipjohnston commented 1 year ago

Also, thank you :)

phillipjohnston commented 1 year ago

Completed in #185