+2017-09-28 Pedro Alves <palves@redhat.com>
+
+ * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
+ unittests/common-utils-selftests.c.
+ (SUBDIR_UNITTESTS_OBS): Add common-utils-selftests.o.
+ (COMMON_OBS): Remove utils-selftests.o.
+ * utils-selftests.c: Move to ...
+ * unittests/common-utils-selftests.c: ... here and rename self
+ test to "string_printf".
+
2017-09-28 Alexander Shaposhnikov <alexander.v.shaposhnikov@gmail.com> (tiny patch)
* dwarf2read.c (open_and_init_dwp_file): Protect against dwp_file
SUBDIR_UNITTESTS_SRCS = \
unittests/array-view-selftests.c \
+ unittests/common-utils-selftests.c \
unittests/environ-selftests.c \
unittests/function-view-selftests.c \
unittests/offset-type-selftests.c \
SUBDIR_UNITTESTS_OBS = \
array-view-selftests.o \
+ common-utils-selftests.o \
environ-selftests.o \
function-view-selftests.o \
offset-type-selftests.o \
ui-out.o \
user-regs.o \
utils.o \
- utils-selftests.o \
valarith.o \
valops.o \
valprint.o \
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "defs.h"
+#include "common-defs.h"
#include "selftest.h"
-#if GDB_SELF_TEST
-
namespace selftests {
-/* common-utils self tests. Defined here instead of in
- common/common-utils.c because that file is shared with
- gdbserver. */
-
static void
-common_utils_tests (void)
+string_printf_tests ()
{
SELF_CHECK (string_printf ("%s", "") == "");
SELF_CHECK (string_printf ("%d comes before 2", 1) == "1 comes before 2");
} /* namespace selftests */
-#endif
-
void
-_initialize_utils_selftests (void)
+_initialize_common_utils_selftests ()
{
-#if GDB_SELF_TEST
- selftests::register_test ("common-utils", selftests::common_utils_tests);
-#endif
+ selftests::register_test ("string_printf", selftests::string_printf_tests);
}