Commit Graph

109 Commits

Author SHA1 Message Date
Siim Meerits
456a1d598b Remove trailing whitespace from all *.h and *.c files. 2020-07-27 17:37:00 +03:00
Yuri Chornoivan
d385c32653 Fix minor typos 2020-05-25 12:32:37 +03:00
Hans Ulrich Niedermann
6f65d24796 Make sure both C and C++ programs including gphoto2 headers compile
Check that programs including libgphoto2 headers compile
when compiled for a number of different language standards:

    C:   ansi c99 c11
    C++: ansi c++98 c++11 c++14 c++17

For each of these language standards, if the compiler does not
compile an empty example program, we do not test whether compiling
with the gphoto2/*.h headers included works.

This will work with GCC as the compiler, and also should work with
CLANG as the compiler as CLANG is mostly compatible in these matters.

On other compilers, the test compile of the empty program should
fail, and thus no checks with the gphoto2/*.h headers included will
be performed.

C90/ANSI C apparently does not define __STDC_VERSION__, so the
C source code needed to be changed to become ANSI C compatible.

In C++ pedantic compilation source, we now use actual C++ code
instead of relying on C code working when compiled as C++ code.

In Travis CI, we now actually require both C and C++.
2020-02-19 05:10:00 +01:00
Hans Ulrich Niedermann
2b294a074c tests/Makefile.am: Consistent comments and definitions
Consistently define test programs, and use comments to
structurize the tests/Makefile.am file.
2020-02-19 05:08:08 +01:00
Hans Ulrich Niedermann
94c0fdb0e1 Add print-libgphoto2-version program
The new print-libgphoto2-version program prints the complete
libgphoto2 version message in both short and verbose.

This functionality had not been available before, and we
want it for checking later changes to the camlib list part
of the version messages.
2020-02-15 02:56:38 +01:00
Hans Ulrich Niedermann
c02ffbc1f1 Add $(AM_MAKEFLAGS) for every $(MAKE)
For every $(MAKE) use in Makefile.am or Makefile-files, we
add $(AM_MAKEFLAGS) so we can pass the make flags to the
called make subprocess.
2020-01-18 19:33:16 +01:00
Marcus Meissner
29b16546b6 add log_remove func too 2017-06-03 17:50:04 +02:00
Marcus Meissner
033b9cf60e also use gp_log_remove_func, to test
https://github.com/gphoto/libgphoto2/pull/171
2017-06-03 11:35:21 +02:00
Marcus Meissner
452bf3f6d6 remove umlauts from files
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15020 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-06-27 05:16:32 +00:00
Marcus Meissner
e403964868 From: "Daniel P. Berrange" <dan@berrange.com>
The test-filesys.c code is calling gp_filesystem_get_folder and
passing in a 'const char **' instead of 'char **'. It then forgets
to free the heap-allocated result.




git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14892 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-04-11 19:56:23 +00:00
Marcus Meissner
098b80e900 fixed big endian
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14799 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-02-26 07:57:51 +00:00
Marcus Meissner
9952f513f9 fixed building
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14798 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-02-26 07:28:38 +00:00
Marcus Meissner
ac04ac3bf4 added a test-endian to check our endianess macros
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14797 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-02-26 07:07:09 +00:00
Marcus Meissner
b2e00b55c4 new fsf address
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14607 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-01-01 20:07:21 +00:00
Marcus Meissner
b15c00a672 test for duplicated names.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14591 67ed7778-7388-44ab-90cf-0a291f65f57c
2013-12-01 20:04:25 +00:00
Marcus Meissner
60038db2e4 cleaned up AM_CPPFLAGS and CPPFLAGS usage patterns.
AM_CPPFLAGS and CPPFLAGS are used both during build, so
no need to use merge them together in configure.
also move the -I$(xx) stuff into Makefile* to avoid
shell expansion issues.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14269 67ed7778-7388-44ab-90cf-0a291f65f57c
2013-03-10 14:59:08 +00:00
Dan Fandrich
69465b70e3 Replaced C99-style comments
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@13311 67ed7778-7388-44ab-90cf-0a291f65f57c
2010-09-15 08:08:24 +00:00
Marcus Meissner
f39d48a509 use the new functions, fix logging
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12847 67ed7778-7388-44ab-90cf-0a291f65f57c
2010-03-26 21:24:37 +00:00
Marcus Meissner
76a2142364 logging functions are not varargs anymore
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12810 67ed7778-7388-44ab-90cf-0a291f65f57c
2010-03-20 22:24:24 +00:00
Dan Fandrich
7eb2debedc Removed unneeded and incorrect check for HAVE_FLEX_BISON
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12323 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-07-31 08:12:23 +00:00
Dan Fandrich
f6c4c628f3 Fixed a bunch of C89 and SUS portability issues.
Fixed a buffer overflow in the AOX driver.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12305 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-07-30 18:15:21 +00:00
Marcus Meissner
a3ee73043c * removed CameraFileInfoFile.name, adjusted users
and callers.
* added filename argument to put_file_func, 
  set_info_noop and set_file_noop functions.
adjusted all camlibs


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11773 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-01-25 20:30:53 +00:00
Marcus Meissner
0769632ad9 removed .cvsignore
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11354 67ed7778-7388-44ab-90cf-0a291f65f57c
2008-09-26 12:27:36 +00:00
Hans Ulrich Niedermann
3664ae290f Also link against $(LIBLTDL) if linking against libgphoto2.la
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10794 67ed7778-7388-44ab-90cf-0a291f65f57c
2007-10-17 03:02:57 +00:00
Hans Ulrich Niedermann
85df1337a9 Rework testing of camera libs
* remove check-camera-list.sh script
* run test-camera-list at "make check" with not-yet-installed camlibs
* run test-camera-list at "make installcheck" with the installed camlibs
* rely on presence of working "env" command for these tests


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10582 67ed7778-7388-44ab-90cf-0a291f65f57c
2007-08-11 19:01:46 +00:00
Hans Ulrich Niedermann
43e9290933 fix typo in path
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10581 67ed7778-7388-44ab-90cf-0a291f65f57c
2007-08-11 18:48:16 +00:00
Hans Ulrich Niedermann
74e4970f64 Fix typo, code cosmetics
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10580 67ed7778-7388-44ab-90cf-0a291f65f57c
2007-08-11 18:47:44 +00:00
Marcus Meissner
b96c54c9a5 revert to prev checkin
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9829 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-12-31 18:54:14 +00:00
Marcus Meissner
d4e727834d fixed warning for \' by just using '
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9828 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-12-31 18:36:23 +00:00
Hans Ulrich Niedermann
e64144813f make sure that the pedantic compilation tests work
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9768 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-12-29 11:01:45 +00:00
Hans Ulrich Niedermann
506a5ec0fa Add version comments for print-camera-list, rename conditional for gp2ddb
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9567 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-12-11 15:57:04 +00:00
Hans Ulrich Niedermann
ae18c4917a print camlibs directory used
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9358 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-17 09:52:44 +00:00
Hans Ulrich Niedermann
cb23f70b2a Use _GPHOTO2_INTERNAL_CODE to compile internal code, put GP_DEBUG there.
* GP_DEBUG now is only available if _GPHOTO2_INTERNAL_CODE is defined.
  * _GPHOTO2_INTERNAL_CODE is defined via AM_CPPFLAGS, so all code should
    be compiled correctly.
  * Users of GP_DEBUG external to the gphoto project should use something
    else.



git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9265 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-04 19:08:12 +00:00
Hans Ulrich Niedermann
aa9ae98115 less testcase output clutter
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9262 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-04 18:10:19 +00:00
Hans Ulrich Niedermann
dcb5cc7c4b cheat about variadic macros in C++ pedantic compilation
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9259 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-03 20:03:28 +00:00
Hans Ulrich Niedermann
f254047b9a separate between CPPFLAGS, CFLAGS, CXXFLAGS and their AM_ equivalent
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9258 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-03 20:01:36 +00:00
Hans Ulrich Niedermann
df143cc2e6 check for C++ compiler, define HAVE_GCC an HAVE_CXX, make test-pedantic-cxx depend on HAVE_CXX
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9254 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-03 14:01:21 +00:00
Hans Ulrich Niedermann
eca2286ad2 add gphoto2-port header files
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9253 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-03 13:54:21 +00:00
Hans Ulrich Niedermann
9a5a1357a4 compile C++ pedantic test case, add more header files
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9252 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-03 13:51:25 +00:00
Hans Ulrich Niedermann
f6e08ef867 add pedantic compilation test cases
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9251 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-03 13:43:35 +00:00
Hans Ulrich Niedermann
ccf2a1ab38 add pedantic compilation test cases
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9250 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-03 13:33:43 +00:00
Hans Ulrich Niedermann
c56e6ed9e2 use libdir as default for utilsdir (libexecdir available via option)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9249 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-02 21:18:12 +00:00
Hans Ulrich Niedermann
4b8a7c7514 configure/make cleanup removing about 60 lines of make/check/config code
* generate check- scripts from config.status
  * use libexecdir for print-* utilities
  * let utilsdir be defined from configure
  * require libexif >= 0.6.13; automatically update libgphoto2.pc with that.
  * get rid of "make check" local installation
  * moved some tests from "make check" to "make installcheck"
  * use one common rule file for "make installcheck"



git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9231 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-09-29 15:15:04 +00:00
Hans Ulrich Niedermann
c96bda51dd Consistently use #include <gphoto2/gphoto2-foo.h> everywhere.
This moves the header files to a new subdirectory gphoto2 in both
  libgphoto2 and libphoto2_port/libgphoto2. All references are
  adapted appropriately.



git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9221 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-09-28 03:04:21 +00:00
Hans Ulrich Niedermann
30ac3cc51d get rid of a few GNU-make-isms (% rules)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9219 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-09-28 02:31:30 +00:00
Hans Ulrich Niedermann
a08d71a23b added copyright notices to ddb code
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9193 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-09-19 15:43:29 +00:00
Hans Ulrich Niedermann
8cc785fd7e split ddb parser from test program
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9191 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-09-19 15:36:46 +00:00
Hans Ulrich Niedermann
0f8b1a3e04 cosmetics
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9190 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-09-19 15:35:49 +00:00
Hans Ulrich Niedermann
a9fa23cbc9 Check that numbers are in range.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9189 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-09-19 15:35:15 +00:00
Hans Ulrich Niedermann
3a929bdabf do less 'make check' local test install hacks -> do 'make installcheck' instead
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9187 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-09-19 02:18:28 +00:00