From fe1d7264661c4112575116bd7ef5c6aaba29575a Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Tue, 5 Feb 2013 16:23:25 -0500 Subject: Avoid FTBFS due to conflicting paths to gtest source, or because the relevant gtest files aren't found -- always use the xorg-gtest gtest source, and adjust path accordingly. --- configure.ac | 3 +-- debian/changelog | 7 +++++++ m4/gtest.m4 | 63 ------------------------------------------------------- tests/Makefile.am | 2 +- 4 files changed, 9 insertions(+), 66 deletions(-) delete mode 100644 m4/gtest.m4 diff --git a/configure.ac b/configure.ac index 1cb4bd4..2219ff0 100644 --- a/configure.ac +++ b/configure.ac @@ -133,8 +133,7 @@ AC_PATH_PROG([VALA_API_GEN], [vapigen]) dnl = Google Test Framework =================================================== -m4_include([m4/gtest.m4]) -CHECK_GTEST +dnl xorg-gtest also provides gtest. CHECK_XORG_GTEST dnl = GTK Doc Check =========================================================== diff --git a/debian/changelog b/debian/changelog index 793deb4..f108bf7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ido (12.10.3daily13.01.11-0ubuntu2) UNRELEASED; urgency=low + + * Fix build against libgtest/libxorg-gtest failing due to paths to gtest + source being incorrect. (LP: #1112775) + + -- Mathieu Trudel-Lapierre Tue, 05 Feb 2013 16:19:25 -0500 + ido (12.10.3daily13.01.11-0ubuntu1) raring; urgency=low [ Mathieu Trudel-Lapierre ] diff --git a/m4/gtest.m4 b/m4/gtest.m4 deleted file mode 100644 index 2de334c..0000000 --- a/m4/gtest.m4 +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright (C) 2012 Canonical, Ltd. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -# Checks whether the gtest source is available on the system. Allows for -# adjusting the include and source path. Sets have_gtest=yes if the source is -# present. Sets GTEST_CPPFLAGS and GTEST_SOURCE to the preprocessor flags and -# source location respectively. -AC_DEFUN([CHECK_GTEST], -[ - AC_ARG_WITH([gtest-include-path], - [AS_HELP_STRING([--with-gtest-include-path], - [location of the Google test headers])], - [GTEST_CPPFLAGS="-I$withval"]) - - AC_ARG_WITH([gtest-source-path], - [AS_HELP_STRING([--with-gtest-source-path], - [location of the Google test sources, defaults to /usr/src/gtest])], - [GTEST_SOURCE="$withval"], - [GTEST_SOURCE="/usr/src/gtest"]) - - GTEST_CPPFLAGS="$GTEST_CPPFLAGS -I$GTEST_SOURCE" - - AC_LANG_PUSH([C++]) - - tmp_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GTEST_CPPFLAGS" - - AC_CHECK_HEADER([gtest/gtest.h]) - - CPPFLAGS="$tmp_CPPFLAGS" - - AC_LANG_POP - - AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc] - [$GTEST_SOURCE/src/gtest_main.cc], - [have_gtest_source=yes], - [have_gtest_source=no]) - - AS_IF([test "x$ac_cv_header_gtest_gtest_h" = xyes -a \ - "x$have_gtest_source" = xyes], - [have_gtest=yes] - [AC_SUBST(GTEST_CPPFLAGS)] - [AC_SUBST(GTEST_SOURCE)], - [have_gtest=no]) -]) # CHECK_GTEST diff --git a/tests/Makefile.am b/tests/Makefile.am index 89b9b5b..5024fe7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,7 @@ AM_CPPFLAGS = \ nodist_libgtest_a_SOURCES = \ $(XORG_GTEST_SOURCE)/src/xorg-gtest-all.cpp \ - $(GTEST_SOURCE)/src/gtest-all.cc \ + $(GTEST_SOURCE)/gtest-all.cc \ $(XORG_GTEST_SOURCE)/src/xorg-gtest_main.cpp libgtest_a_CPPFLAGS = \ $(XORG_GTEST_CPPFLAGS) \ -- cgit v1.2.3 From d9aa6f031dab7dbee5b914ef2d90f6205711c835 Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Wed, 6 Feb 2013 10:10:11 -0500 Subject: Shut up coverity about CID:12650. --- src/idotimeline.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/idotimeline.c b/src/idotimeline.c index 24a6935..ba838ba 100644 --- a/src/idotimeline.c +++ b/src/idotimeline.c @@ -549,7 +549,8 @@ ido_timeline_set_fps (IdoTimeline *timeline, priv = IDO_TIMELINE_GET_PRIV (timeline); - priv->fps = fps; + /* Coverity CID: 12650/12651: guard against division by 0. */ + priv->fps = fps > 0 ? fps : priv->fps; if (ido_timeline_is_running (timeline)) { -- cgit v1.2.3 From f81bc0d3747f5ef86254a5597562ce1bb425eb97 Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Wed, 6 Feb 2013 11:54:10 -0500 Subject: Guard against CID:12651, division by zero of FPS value due to its use for timing timeline updates. --- src/idotimeline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/idotimeline.c b/src/idotimeline.c index ba838ba..8eea4b5 100644 --- a/src/idotimeline.c +++ b/src/idotimeline.c @@ -409,8 +409,8 @@ ido_timeline_start (IdoTimeline *timeline) else priv->timer = g_timer_new (); - /* sanity check */ - g_assert (priv->fps > 0); + /* sanity check; CID: 12651 */ + priv->fps = priv->fps > 0 ? priv->fps : DEFAULT_FPS; if (priv->screen) { -- cgit v1.2.3