This change adds additional compiler warnings as detected by the
autoconf archive. Because the code is susceptible to these additional
warnings, disable treating warnings as errors for now, until we can fix
the warnings.
This change adds tests for setting the X52Pro LEDs using the new x52
test infrastructure. This should be used in addition to the x52cli based
test suite.
This change allows for a test framework to override the functionality of
libx52_vendor_command. By doing so, it can build tests that change the
libx52_device structure, and therefore, not need to rely on libusbx52 to
get the commands written.
This allows for tests that can be built and run on other OSes as well,
since the libusbx52 based tests cannot run on OSX and have not been
tested on BSD systems.
With the introduction of automatic code review tools, libx52_update was
found to be "too complex". This change simply breaks out the switch
cases into a set of functions indexed through a lookup table.
Prior to this change, libx52_vendor_command would leave the device
handle untouched, even if the joystick was disconnected.
This change will force applications to reconnect to the joystick after
they encounter such a failure.
This commit changes the local timezone calculation to use tm.tm_gmtoff,
and falling back to calculating it manually from the output of strftime
when tm_gmtoff is not a member of struct tm.
This also fixes the tests so that they are no longer expected to fail.
Fixes#20.
The hope was that I could compile some tests that would override
libx52_vendor_command, and run those on OSX to bypass the skipped tests
that used x52cli. However, a Travis-CI run indicated that the compiler
on OSX doesn't support weak symbols, which renders the point moot.
This change allows exporting libx52_vendor_command as a weak symbol,
thereby allowing it to be overridden by a test runner to validate that
the library is indeed behaving as per the spec.
Because this is something that may not be necessarily desirable on a
production environment, add a configure time flag to disable building
with weak symbols. This will also disable any tests that may rely on
libx52_vendor_command being a weak function.
Prior to this change, the tests were using the automake simple test
harness. The limitation was that for each set of test cases (e.g.
timezone tests), even if one test failed, it would report every test in
that set as failed. Migrating to TAP allows fine-grained reporting on
every single test case, and allows better investigation into checking
which individual tests failed.
This change also updates the timezone tests to explicitly mark the ones
that check when the timezone is Pacific Daylight Time as expected to
fail. It also updates the clock tests to improve the formatting of the
test case identifier.
Prior to this change, all symbols were being exported in the generated
library. This change adds libtool directives to only export the public
symbols in libx52.
If configured with CFLAGS=-std=c99, then quite a few warnings are
raised, as well as a couple of errors. By forcing the system to use
_GNU_SOURCE, we can allow the compilation to succeed even if using a
user defined C standard.
If `-Wpedantic` is given as part of CFLAGS, this flags a warning stating
that `int` and `size_t` are of different sizes. This simply changes the
type of `i` to `size_t` to match the output of `strlen`.
Prior to this change, the assumption was that localtime/gmtime would
never fail, regardless of the time value provided to it. However,
testing on an Ubuntu 20.04 machine revealed that the representable
range of time_t was about 56 bits, values that exceed a 56 bit
representation would cause localtime/gmtime to return a NULL pointer.
This change replaces the use of localtime/gmtime with their
corresponding thread-safe variants, and checks the return value against
NULL. If it matches a NULL value, then it will return an error and not
update the clocks.
Previously, when testing the clock command of x52cli, we had forced the
system timezone to UTC. As a result, the offset calculations for clocks
2 and 3 were never computed and always resulted in 0, which hid the bug
when the local time and local standard time did not match (#20).
This commit adds a test case that uses faketime to test setting the
clock to local (Pacific Time) and verifying that the offsets are
computed correctly. Given that the bug is still present as of this
commit, add the test suite to XFAIL_TESTS as well, so that it doesn't
break the CI build.
Prior to this change, we were linking the log_actions program against
the stub library, since we needed to use the logging capabilities in the
stub library to save the expected values to a file for the test harness
to use. However, doing so gives us the following warning:
*** Warning: Linking the executable x52test_log_actions against the loadable module
*** libusbx52.so is not portable!
Since we don't really need to have dynamic linking in this case, simply
including the stub library source into the log_actions program sources
list is sufficient, and bypasses this warning.
Prior to this change, x52test would always assume that the device was an
X52Pro when resetting the device state. This change fixes that
assumption by checking the feature flags, since only the X52Pro has LED
support.
This change also updates the translation files due to the automatic
update because of line numbers being changed.
Commit be1f7e0 fixed the error handling, but missed this line. The
original behavior was to restore the X52 LED and MFD state after
completing all the tests, or if the user cancelled the tests using
Ctrl-C.
This commit fixes that regression, so that it will preserve the state
only if it encountered an error during the test, not if it was
cancelled.
Prior to this change, a separate copy of the man pages for the libx52
functions was being maintained since I couldn't get Doxygen to work
properly at the time (I don't remember, it's been over 5 years).
The man pages are out of date and don't match up with the current
version of libx52, and haven't been for some time. Now that we have
functional documentation generated via Doxygen, it is time to get rid of
the obsolete stuff.
This change deletes the entire man folder, and doesn't change anything
else, since it was self-contained.
[skip ci]