diff options
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | xbmc/interfaces/python/test/Makefile | 10 | ||||
-rw-r--r-- | xbmc/interfaces/python/test/TestSwig.cpp | 33 |
3 files changed, 45 insertions, 0 deletions
diff --git a/Makefile.in b/Makefile.in index d06ff45bee..21e56ad9ba 100644 --- a/Makefile.in +++ b/Makefile.in @@ -253,10 +253,12 @@ GTEST_LIBS = $(GTEST_DIR)/lib/.libs/libgtest.a CHECK_DIRS = xbmc/filesystem/test \ xbmc/utils/test \ xbmc/threads/test \ + xbmc/interfaces/python/test \ xbmc/test CHECK_LIBS = xbmc/filesystem/test/filesystemTest.a \ xbmc/utils/test/utilsTest.a \ xbmc/threads/test/threadTest.a \ + xbmc/interfaces/python/test/pythonSwigTest.a \ xbmc/test/xbmc-test.a CHECK_PROGRAMS = xbmc-test diff --git a/xbmc/interfaces/python/test/Makefile b/xbmc/interfaces/python/test/Makefile new file mode 100644 index 0000000000..9f9c91e8b6 --- /dev/null +++ b/xbmc/interfaces/python/test/Makefile @@ -0,0 +1,10 @@ +SRCS= \ + TestSwig.cpp + +LIB=pythonSwigTest.a + +INCLUDES += -I../../../../lib/gtest/include +INCLUDES += -I/usr/include/python2.7 + +include ../../../../Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) diff --git a/xbmc/interfaces/python/test/TestSwig.cpp b/xbmc/interfaces/python/test/TestSwig.cpp new file mode 100644 index 0000000000..42af32dbf1 --- /dev/null +++ b/xbmc/interfaces/python/test/TestSwig.cpp @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2005-2012 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include "../swig.h" + +#include "gtest/gtest.h" + +using namespace PythonBindings; + +TEST(TestSwig, TypeConversion) +{ + EXPECT_TRUE(isParameterRightType("p.XBMCAddon::xbmcgui::ListItem","p.XBMCAddon::xbmcgui::ListItem","XBMCAddon::xbmc::")); + EXPECT_TRUE(isParameterRightType("p.XBMCAddon::xbmc::PlayList","p.PlayList","XBMCAddon::xbmc::")); + EXPECT_TRUE(isParameterRightType("p.PlayList","p.XBMCAddon::xbmc::PlayList","XBMCAddon::xbmc::")); +} + |