> > Nit, since the function is now public, I'd consider moving the unit > > tests to under gdb/unittests/ instead, like, to a new > > copy_bitwise-selftests.c file. (I'm mildly thinking that'd be a better > > filename than utils-selftest.c because the function may well > > move again in the future. Notice how gdb_realpath's unit tests > > were left behind in gdb/utils.c even though gdb_realpath moved to > > common/pathstuff.c.) > > > > If you do that, you can drop the > > '#if GDB_SELF_TEST' around the tests, since files in that > > directory are not compiled if unit tests are disabled. > > I can do that. Since you said you're file reguardless, it's a little > easier for me to do it in two stages, so I'll go ahead and push this > one. I'll start on moving the unit tests again right after, and > will finish ASAP if it's not finished by end of today. Here it is: gdb/ChangeLog: * unittests/copy_bitwise-selftests.c: New file. * utils.c (selftests::bits_to_str, selftests::check_copy_bitwise) (selftests::copy_bitwise_tests): Delete, moving this code to unittests/copy_bitwise-selftests.c instead. (_initialize_utils): Do not register copy_bitwise tests. * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add unittests/copy_bitwise-selftests.c. Tested on x86_64-linux using the official testsuite, but also by verifying that "maintenance selftests" still runs the copy_bitwise tests. OK to push to master? Thank you! -- Joel