diff --git a/.github/workflows/cmake-windows.yml b/.github/workflows/cmake-windows.yml index ef0e0511..31fceb68 100644 --- a/.github/workflows/cmake-windows.yml +++ b/.github/workflows/cmake-windows.yml @@ -34,8 +34,8 @@ jobs: # access regardless of the host operating system shell: bash working-directory: ${{runner.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DWITH_TESTS=yes @@ -48,6 +48,6 @@ jobs: - name: Test working-directory: ${{runner.workspace}}/build shell: bash - # Execute tests defined by the CMake configuration. + # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest -C $BUILD_TYPE diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ac588566..29dee491 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -27,8 +27,8 @@ jobs: # access regardless of the host operating system shell: bash working-directory: ${{runner.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_TESTS=yes -DBUILD_SHARED_LIBS=on @@ -41,6 +41,6 @@ jobs: - name: Test working-directory: ${{runner.workspace}}/build shell: bash - # Execute tests defined by the CMake configuration. + # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest -C $BUILD_TYPE diff --git a/.travis.yml b/.travis.yml index 9d21088d..454d02be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ dist: trusty sudo: required language: c - + compiler: - gcc diff --git a/CMakeLists.txt b/CMakeLists.txt index 773e0374..74053ee6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,7 +79,7 @@ if(MSVC) add_definitions(-Dstrncasecmp=_strnicmp) add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) - + if(WITH_TOOLS) find_path(GETOPT_INCLUDE_DIR getopt.h PATH_SUFFIXES include) find_library(GETOPT_LIBRARIES getopt PATH_SUFFIXES lib) diff --git a/COPYING b/COPYING index 2d2d780e..4362b491 100644 --- a/COPYING +++ b/COPYING @@ -1,9 +1,8 @@ - GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -23,8 +22,7 @@ specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations -below. +strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that @@ -89,9 +87,9 @@ libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it -becomes a de-facto standard. To achieve this, non-free programs must -be allowed to use the library. A more frequent case is that a free +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. @@ -138,8 +136,8 @@ included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control -compilation and installation of the library. +interface definition files, plus the scripts used to control compilation +and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of @@ -305,10 +303,10 @@ of these things: the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. - c) Accompany the work with a written offer, valid for at least - three years, to give the same user the materials specified in - Subsection 6a, above, for a charge no more than the cost of - performing this distribution. + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above @@ -386,10 +384,9 @@ all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply, and the section as a whole is intended to apply in other -circumstances. +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any @@ -407,11 +404,11 @@ be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License -may add an explicit geographical distribution limitation excluding those -countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. @@ -465,15 +462,13 @@ DAMAGES. If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms -of the ordinary General Public License). - - To apply these terms, attach the following notices to the library. -It is safest to attach them to the start of each source file to most -effectively convey the exclusion of warranty; and each file should -have at least the "copyright" line and a pointer to where the full -notice is found. +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. Copyright (C) @@ -490,21 +485,18 @@ notice is found. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. -You should also get your employer (if you work as a programmer) or -your school, if any, to sign a "copyright disclaimer" for the library, -if necessary. Here is a sample; alter the names: +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James - Random Hacker. + library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! - - diff --git a/Makefile.am b/Makefile.am index d631b6df..6e7b35ab 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,7 +33,7 @@ README: $(README_markdown_optional) EXTRA_DIST = libqrencode.pc.in autogen.sh configure.ac acinclude.m4 \ Makefile.am tests/Makefile.am \ qrencode.1.in Doxyfile \ - CMakeLists.txt cmake/FindIconv.cmake + CMakeLists.txt cmake/FindIconv.cmake if BUILD_TOOLS bin_PROGRAMS = qrencode diff --git a/README.md b/README.md index dbbfe097..4391b3be 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ configure, or "-DWITH\_TESTS=YES" to cmake. You can download and install libqrencode using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager: - + ``` git clone https://github.com/Microsoft/vcpkg.git cd vcpkg @@ -99,7 +99,7 @@ cd vcpkg ./vcpkg integrate install ./vcpkg install libqrencode ``` - + The libqrencode port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the diff --git a/mqrspec.h b/mqrspec.h index 0eaa4907..76b5114f 100644 --- a/mqrspec.h +++ b/mqrspec.h @@ -73,7 +73,7 @@ extern int MQRspec_getMinimumVersion(int size, QRecLevel level); extern int MQRspec_getWidth(int version); /** - * Return the numer of remainder bits. + * Return the number of remainder bits. * @param version version of the symbol * @return number of remainder bits */ @@ -86,7 +86,7 @@ extern int MQRspec_getRemainder(int version); /** * Return the size of length indicator for the mode and version. * @param mode encode mode - * @param version vesion of the symbol + * @param version version of the symbol * @return the size of the appropriate length indicator (bits). */ extern int MQRspec_lengthIndicator(QRencodeMode mode, int version); @@ -94,7 +94,7 @@ extern int MQRspec_lengthIndicator(QRencodeMode mode, int version); /** * Return the maximum length for the mode and version. * @param mode encode mode - * @param version vesion of the symbol + * @param version version of the symbol * @return the maximum length (bytes) */ extern int MQRspec_maximumWords(QRencodeMode mode, int version); @@ -106,7 +106,7 @@ extern int MQRspec_maximumWords(QRencodeMode mode, int version); /** * Return BCH encoded version information pattern that is used for the symbol * of version 7 or greater. Use lower 18 bits. - * @param version vesion of the symbol + * @param version version of the symbol * @return BCH encoded version information pattern */ extern unsigned int MQRspec_getVersionPattern(int version); diff --git a/qrenc.c b/qrenc.c index c09c4ab6..9ca604dc 100644 --- a/qrenc.c +++ b/qrenc.c @@ -237,7 +237,7 @@ static int color_set(unsigned char color[4], const char *value) return 0; } -#define MAX_DATA_SIZE (7090 * 2) /* timed by the safty factor 2 */ +#define MAX_DATA_SIZE (7090 * 2) /* multiplied by the safety factor 2 */ static unsigned char data_buffer[MAX_DATA_SIZE]; static unsigned char *readFile(FILE *fp, int *length) { diff --git a/qrencode.h b/qrencode.h index 1a934cc1..05e5febe 100644 --- a/qrencode.h +++ b/qrencode.h @@ -62,7 +62,7 @@ * * \section structured Structured append * Libqrencode can generate "Structured-appended" symbols that enables to split - * a large data set into mulitple QR codes. A QR code reader concatenates + * a large data set into multiple QR codes. A QR code reader concatenates * multiple QR code symbols into a string. * Just like QRcode_encodeString(), you can use QRcode_encodeStringStructured() * to generate structured-appended symbols. This functions returns an instance @@ -191,8 +191,8 @@ extern QRinput *QRinput_newMQR(int version, QRecLevel level); * @param size size of data (byte). * @param data a pointer to the memory area of the input data. * @retval 0 success. - * @retval -1 an error occurred and errno is set to indeicate the error. - * See Execptions for the details. + * @retval -1 an error occurred and errno is set to indicate the error. + * See Exceptions for the details. * @throw ENOMEM unable to allocate memory. * @throw EINVAL input data is invalid. * @@ -204,8 +204,8 @@ extern int QRinput_append(QRinput *input, QRencodeMode mode, int size, const uns * @param input input object. * @param ecinum ECI indicator number (0 - 999999) * @retval 0 success. - * @retval -1 an error occurred and errno is set to indeicate the error. - * See Execptions for the details. + * @retval -1 an error occurred and errno is set to indicate the error. + * See Exceptions for the details. * @throw ENOMEM unable to allocate memory. * @throw EINVAL input data is invalid. * @@ -232,7 +232,7 @@ extern int QRinput_setVersion(QRinput *input, int version); /** * Get current error correction level. * @param input input object. - * @return Current error correcntion level. + * @return Current error correction level. */ extern QRecLevel QRinput_getErrorCorrectionLevel(QRinput *input); @@ -248,7 +248,7 @@ extern int QRinput_setErrorCorrectionLevel(QRinput *input, QRecLevel level); /** * Set version and error correction level of the QR code at once. - * This function is recommened for Micro QR Code. + * This function is recommended for Micro QR Code. * @param input input object. * @param version version number (0 = auto) * @param level Error correction level. @@ -332,8 +332,8 @@ extern QRinput_Struct *QRinput_splitQRinputToStruct(QRinput *input); * a parity and set it if the parity is not set yet. * @param s input structure * @retval 0 success. - * @retval -1 an error occurred and errno is set to indeicate the error. - * See Execptions for the details. + * @retval -1 an error occurred and errno is set to indicate the error. + * See Exceptions for the details. * @throw EINVAL invalid input object. * @throw ENOMEM unable to allocate memory. */ diff --git a/qrinput.c b/qrinput.c index 34bedc2a..ead10927 100644 --- a/qrinput.c +++ b/qrinput.c @@ -241,7 +241,7 @@ int QRinput_append(QRinput *input, QRencodeMode mode, int size, const unsigned c * @param number index number of the symbol. (1 <= number <= size) * @param parity parity among input data. (NOTE: each symbol of a set of structured symbols has the same parity data) * @retval 0 success. - * @retval -1 error occurred and errno is set to indeicate the error. See Execptions for the details. + * @retval -1 error occurred and errno is set to indicate the error. See Exceptions for the details. * @throw EINVAL invalid parameter. * @throw ENOMEM unable to allocate memory. */ @@ -404,8 +404,8 @@ int QRinput_estimateBitsModeNum(int size) * @param entry * @param mqr * @retval 0 success - * @retval -1 an error occurred and errno is set to indeicate the error. - * See Execptions for the details. + * @retval -1 an error occurred and errno is set to indicate the error. + * See Exceptions for the details. * @throw ENOMEM unable to allocate memory. */ static int QRinput_encodeModeNum(QRinput_List *entry, BitStream *bstream, int version, int mqr) @@ -509,8 +509,8 @@ int QRinput_estimateBitsModeAn(int size) * @param entry * @param mqr * @retval 0 success - * @retval -1 an error occurred and errno is set to indeicate the error. - * See Execptions for the details. + * @retval -1 an error occurred and errno is set to indicate the error. + * See Exceptions for the details. * @throw ENOMEM unable to allocate memory. * @throw EINVAL invalid version. */ @@ -573,8 +573,8 @@ int QRinput_estimateBitsMode8(int size) * @param entry * @param mqr * @retval 0 success - * @retval -1 an error occurred and errno is set to indeicate the error. - * See Execptions for the details. + * @retval -1 an error occurred and errno is set to indicate the error. + * See Exceptions for the details. * @throw ENOMEM unable to allocate memory. */ static int QRinput_encodeMode8(QRinput_List *entry, BitStream *bstream, int version, int mqr) @@ -647,8 +647,8 @@ static int QRinput_checkModeKanji(int size, const unsigned char *data) * @param entry * @param mqr * @retval 0 success - * @retval -1 an error occurred and errno is set to indeicate the error. - * See Execptions for the details. + * @retval -1 an error occurred and errno is set to indicate the error. + * See Exceptions for the details. * @throw ENOMEM unable to allocate memory. * @throw EINVAL invalid version. */ @@ -699,8 +699,8 @@ static int QRinput_encodeModeKanji(QRinput_List *entry, BitStream *bstream, int * @param entry * @param mqr * @retval 0 success - * @retval -1 an error occurred and errno is set to indeicate the error. - * See Execptions for the details. + * @retval -1 an error occurred and errno is set to indicate the error. + * See Exceptions for the details. * @throw ENOMEM unable to allocate memory. * @throw EINVAL invalid entry. */ @@ -1077,8 +1077,8 @@ static int QRinput_encodeBitStream(QRinput_List *entry, BitStream *bstream, int * Convert the input data to a bit stream. * @param input input data. * @retval 0 success - * @retval -1 an error occurred and errno is set to indeicate the error. - * See Execptions for the details. + * @retval -1 an error occurred and errno is set to indicate the error. + * See Exceptions for the details. * @throw ENOMEM unable to allocate memory. */ static int QRinput_createBitStream(QRinput *input, BitStream *bstream) @@ -1104,8 +1104,8 @@ static int QRinput_createBitStream(QRinput *input, BitStream *bstream) * @param input input data. * @param bstream where the converted data is stored. * @retval 0 success - * @retval -1 an error occurred and errno is set to indeicate the error. - * See Execptions for the details. + * @retval -1 an error occurred and errno is set to indicate the error. + * See Exceptions for the details. * @throw ENOMEM unable to allocate memory. * @throw ERANGE input data is too large. */ @@ -1139,8 +1139,8 @@ static int QRinput_convertData(QRinput *input, BitStream *bstream) * @param bstream Bitstream to be appended. * @param input input data. * @retval 0 success - * @retval -1 an error occurred and errno is set to indeicate the error. - * See Execptions for the details. + * @retval -1 an error occurred and errno is set to indicate the error. + * See Exceptions for the details. * @throw ERANGE input data is too large. * @throw ENOMEM unable to allocate memory. */ @@ -1188,8 +1188,8 @@ static int QRinput_appendPaddingBit(BitStream *bstream, QRinput *input) * @param bstream Bitstream to be appended. * @param input input data. * @retval 0 success - * @retval -1 an error occurred and errno is set to indeicate the error. - * See Execptions for the details. + * @retval -1 an error occurred and errno is set to indicate the error. + * See Exceptions for the details. * @throw ERANGE input data is too large. * @throw ENOMEM unable to allocate memory. */ diff --git a/qrinput.h b/qrinput.h index 5892c482..bd8aefda 100644 --- a/qrinput.h +++ b/qrinput.h @@ -88,7 +88,7 @@ extern QRinput *QRinput_dup(QRinput *input); extern const signed char QRinput_anTable[128]; /** - * Look up the alphabet-numeric convesion table (see JIS X0510:2004, pp.19). + * Look up the alphabet-numeric conversion table (see JIS X0510:2004, pp.19). * @param __c__ character * @return value */ diff --git a/qrspec.h b/qrspec.h index 4d01879e..e525ed22 100644 --- a/qrspec.h +++ b/qrspec.h @@ -59,14 +59,14 @@ extern int QRspec_getMinimumVersion(int size, QRecLevel level); /** * Return the width of the symbol for the version. - * @param version vesion of the symbol + * @param version version of the symbol * @return width of the symbol */ extern int QRspec_getWidth(int version); /** - * Return the numer of remainder bits. - * @param version vesion of the symbol + * Return the number of remainder bits. + * @param version version of the symbol * @return number of remainder bits */ extern int QRspec_getRemainder(int version); @@ -78,7 +78,7 @@ extern int QRspec_getRemainder(int version); /** * Return the size of length indicator for the mode and version. * @param mode encode mode - * @param version vesion of the symbol + * @param version version of the symbol * @return the size of the appropriate length indicator (bits). */ extern int QRspec_lengthIndicator(QRencodeMode mode, int version); @@ -86,7 +86,7 @@ extern int QRspec_lengthIndicator(QRencodeMode mode, int version); /** * Return the maximum length for the mode and version. * @param mode encode mode - * @param version vesion of the symbol + * @param version version of the symbol * @return the maximum length (bytes) */ extern int QRspec_maximumWords(QRencodeMode mode, int version); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4c4a5e81..50a2fdbb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -50,8 +50,8 @@ MAKE_TEST(test_split) if(TARGET ICONV::ICONV) add_library(decoder STATIC - decoder.c decoder.h - datachunk.c datachunk.h + decoder.c decoder.h + datachunk.c datachunk.h rsecc_decoder.c rsecc_decoder.h) target_link_libraries(decoder ICONV::ICONV) @@ -71,11 +71,10 @@ if(TARGET ICONV::ICONV) return 0; }" FIXED_SIZE_BUFFER_INITIALIZATION) - + if(FIXED_SIZE_BUFFER_INITIALIZATION) MAKE_TEST(test_mask decoder) MAKE_TEST(test_mmask decoder) MAKE_TEST(test_rs rscode decoder) endif() endif() - diff --git a/tests/common.c b/tests/common.c index 3d9f3041..53bbf215 100644 --- a/tests/common.c +++ b/tests/common.c @@ -91,7 +91,7 @@ void testReport(int expectedTests) printf("Total %d tests, %d fails.\n", tests, failed); if(failed) exit(-1); if(expectedTests != tests) { - printf("WARNING: the number of the executed tests (%d) is not equal to the expecetd (%d).\n", tests, expectedTests); + printf("WARNING: the number of the executed tests (%d) is not equal to the expected (%d).\n", tests, expectedTests); } } diff --git a/tests/decoder.c b/tests/decoder.c index 706dc31e..829b6592 100644 --- a/tests/decoder.c +++ b/tests/decoder.c @@ -430,7 +430,7 @@ int QRcode_decodeVersion(QRcode *code) } if(v1 != v2) { - printf("Two verion patterns are different.\n"); + printf("Two version patterns are different.\n"); return -1; } diff --git a/tests/decoder.h b/tests/decoder.h index 087ec6f1..98b4e802 100644 --- a/tests/decoder.h +++ b/tests/decoder.h @@ -34,7 +34,7 @@ BitStream *QRcode_extractBits(QRcode *code, int *dataLength, int *eccLength); QRdata *QRcode_decodeBits(QRcode *code); QRdata *QRcode_decode(QRcode *code); -int QRcode_decodeFormatMQR(QRcode *code, int *vesion, QRecLevel *level, int *mask); +int QRcode_decodeFormatMQR(QRcode *code, int *version, QRecLevel *level, int *mask); unsigned char *QRcode_unmaskMQR(QRcode *code); BitStream *QRcode_extractBitsMQR(QRcode *code, int *dataLength, int *eccLength, int *version, QRecLevel *level); QRdata *QRcode_decodeBitsMQR(QRcode *code); diff --git a/tests/rscode.c b/tests/rscode.c index 2d4c47e1..3ebd52c3 100644 --- a/tests/rscode.c +++ b/tests/rscode.c @@ -92,7 +92,7 @@ static RS *init_rs_char(int symsize, int gfpoly, int fcr, int prim, int nroots, RS *rs; -/* Common code for intializing a Reed-Solomon control block (char or int symbols) +/* Common code for initializing a Reed-Solomon control block (char or int symbols) * Copyright 2004 Phil Karn, KA9Q * May be used under the terms of the GNU Lesser General Public License (LGPL) */ diff --git a/tests/test_configure.sh b/tests/test_configure.sh index 4a301259..740a8807 100755 --- a/tests/test_configure.sh +++ b/tests/test_configure.sh @@ -9,44 +9,44 @@ LIBQRENCODE_PC="$BASEDIR/libqrencode.pc" echo "Testing configure scripts..." -(cd $BASEDIR; ./autogen.sh) +(cd "$BASEDIR"; ./autogen.sh) # test config.h.in -grep "#undef HAVE_LIBPTHREAD" $CONFIG_H_IN > /dev/null +grep "#undef HAVE_LIBPTHREAD" "$CONFIG_H_IN" > /dev/null if test ! $? -eq 0; then echo "HAVE_LIBPTHREAD undefined in config.h.in." exit 1 fi # test libqrencode.pc.in -grep "Libs.private: @LIBPTHREAD@" $LIBQRENCODE_PC_IN > /dev/null +grep "Libs.private: @LIBPTHREAD@" "$LIBQRENCODE_PC_IN" > /dev/null if test ! $? -eq 0; then echo "Pthread is not handled in libqrencode.pc.in." exit 1 fi # test pthread checks in configure -(cd $BASEDIR; ./configure --with-tests --enable-thread-safety > /dev/null) -grep "#define HAVE_LIBPTHREAD 1" $CONFIG_H > /dev/null +(cd "$BASEDIR"; ./configure --with-tests --enable-thread-safety > /dev/null) +grep "#define HAVE_LIBPTHREAD 1" "$CONFIG_H" > /dev/null if test ! $? -eq 0; then echo "HAVE_LIBPTHREAD undefined in config.h." exit 1 fi -grep "Libs.private: -lpthread" $LIBQRENCODE_PC > /dev/null +grep "Libs.private: -lpthread" "$LIBQRENCODE_PC" > /dev/null if test ! $? -eq 0; then echo "Pthread is not handled in libqrencode.pc." exit 1 fi -(cd $BASEDIR; ./configure --with-tests --disable-thread-safety > /dev/null) -grep "#define HAVE_LIBPTHREAD 1" $CONFIG_H > /dev/null +(cd "$BASEDIR"; ./configure --with-tests --disable-thread-safety > /dev/null) +grep "#define HAVE_LIBPTHREAD 1" "$CONFIG_H" > /dev/null if test ! $? -eq 1; then echo "HAVE_LIBPTHREAD incorrectly defined in config.h." exit 1 fi -grep "Libs.private: -lpthread" $LIBQRENCODE_PC > /dev/null +grep "Libs.private: -lpthread" "$LIBQRENCODE_PC" > /dev/null if test ! $? -eq 1; then echo "Pthread is incorrectly handled in libqrencode.pc." exit 1 @@ -54,7 +54,7 @@ fi echo "All tests of configure script passed. Now reconfiguring..." -(cd $BASEDIR; ./configure --with-tests > /dev/null) +(cd "$BASEDIR"; ./configure --with-tests > /dev/null) echo "Done." diff --git a/tests/test_mmask.c b/tests/test_mmask.c index c6cab14a..eeae9d8e 100644 --- a/tests/test_mmask.c +++ b/tests/test_mmask.c @@ -114,27 +114,27 @@ static void test_maskEvaluation(void) testStart("Test mask evaluation"); score = MMask_evaluateSymbol(w, pattern); - assert_equal(score, 0, "Mask score caluculation is incorrect. (score=%d (%d expected)\n", score, 0); + assert_equal(score, 0, "Mask score calculation is incorrect. (score=%d (%d expected)\n", score, 0); for(i=0; i