test: physical: Fix several clang-tidy warnings
Address buffer management issues in createSandbox():
* cppcoreguidelines-avoid-c-arrays
* cppcoreguidelines-pro-bounds-array-to-pointer-decay
* readability-implicit-bool-conversion
* readability-qualified-auto
```
/home/andrew/src/openbmc/phosphor-led-sysfs/build/../test/physical.cpp:23:5: error: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,-warnings-as-errors]
char buffer[MAXPATHLEN] = {0};
^
/home/andrew/src/openbmc/phosphor-led-sysfs/build/../test/physical.cpp:25:13: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
strncpy(buffer, tmplt, sizeof(buffer) - 1);
^
/home/andrew/src/openbmc/phosphor-led-sysfs/build/../test/physical.cpp:26:5: error: 'auto dir' can be declared as 'auto *dir' [readability-qualified-auto,-warnings-as-errors]
auto dir = mkdtemp(buffer);
^~~~~
auto *
/home/andrew/src/openbmc/phosphor-led-sysfs/build/../test/physical.cpp:26:24: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
auto dir = mkdtemp(buffer);
^
/home/andrew/src/openbmc/phosphor-led-sysfs/build/../test/physical.cpp:27:10: error: implicit conversion 'char *' -> bool [readability-implicit-bool-conversion,-warnings-as-errors]
if (!dir)
~^
== nullptr
```
Change-Id: I6c7c7e7c88614378f160faac79f9a674055b83b9
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
1 file changed