Attention is currently required from: Edward O'Callaghan, Angel Pons, Anastasia Klimchuk.
6 comments:
File tests/init_shutdown.c:
"//" is what's in the actual path which is constructed by linux_mtd. […]
`//` is generally accepted by the syscalls. I think that means the
tests should accept it as well. But actually they should accept
what Linux accepts, and not just what the driver happens to produce
right now.
Maybe fnmatch() could be used?
File tests/init_shutdown.c:
Patch Set #9, Line 206: io_state->fopen_path = pathname;
We should keep a copy (strdup()). There is no guarantee* that the
pointer stays valid.
(* assuming we want to test that the driver is functional, and not
that the driver code always stays the same)
Patch Set #9, Line 208: return (void *)0x55AA; /* valid file descriptor */
I have to say, I only understood the comment by reading the code (and would
have understood that without the comment too). Technically, the comment is
wrong. It's a pointer (could refer to it as handle), not a file descriptor. The
file descriptor is the `int` that is handled by the kernel and returned by
open(). Which we obviously don't have here. Also, we don't need a *valid*
pointer, we need one that is not `NULL`, actually no matter if it's valid.
Commonly, code is better than comments, we could introduce something like this
#define NOT_NULL ((void *)0xf000baaa)
That would move the discussion and any potential confusion to a single place
and make it obvious what is going on every time the macro is used.
Patch Set #9, Line 233: const struct linux_mtd_fread_mock_entry entry = fread_mock_map[i];
This creates a copy of the struct, looks like a pointer would do as well.
I don't think the files in sysfs provide a 0-termination? There's a linebreak
sometimes, though.
File tests/io_mock.h:
Patch Set #9, Line 86: /* File I/O */
This is usually referred to as `stdio` or `Standard I/O`.
To view, visit change 56413. To unsubscribe, or for help writing mail filters, visit settings.