diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index 3e9117dd..6ef4204c 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: true matrix: - config: ["asan", "code coverage", "memcheck", "docs", "format"] + config: ["asan", "code coverage", "memcheck", "docs", "format", "warning"] steps: - name: install-dependencies @@ -73,16 +73,24 @@ jobs: run: | set -x export CC=gcc - cmake -S g2c -B g2c/build -DUSE_AEC=ON -DJasper_ROOT=$GITHUB_WORKSPACE/nceplibs/jasper -DBUILD_G2C=ON -DLOGGING=On -DPTHREADS=ON -DFTP_TEST_FILES=ON -DFTP_LARGE_TEST_FILES=OFF -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug-DCMAKE_C_FLAGS="-Werror -g -O0 -fsanitize=address -fno-omit-frame-pointer" + cmake -S g2c -B g2c/build -DUSE_AEC=ON -DJasper_ROOT=$GITHUB_WORKSPACE/nceplibs/jasper -DBUILD_G2C=ON -DLOGGING=On -DPTHREADS=ON -DFTP_TEST_FILES=ON -DFTP_LARGE_TEST_FILES=OFF -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror -g -O0 -fsanitize=address -fno-omit-frame-pointer" cmake --build g2c/build --parallel 2 --verbose ctest --test-dir g2c/build --verbose --output-on-failure --rerun-failed + - name: warning + if: matrix.config == 'warning' + run: | + set -x + export CC=gcc + cmake -S g2c -B g2c/build -DUSE_AEC=ON -DJasper_ROOT=$GITHUB_WORKSPACE/nceplibs/jasper -DBUILD_G2C=ON -DLOGGING=On -DPTHREADS=ON -DFTP_TEST_FILES=ON -DFTP_LARGE_TEST_FILES=OFF -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Wall -Werror" + cmake --build g2c/build --verbose + - name: code_coverage if: matrix.config == 'code coverage' run: | set -x export CC=gcc - cmake -S g2c -B g2c/build -DUSE_AEC=ON -DJasper_ROOT=$GITHUB_WORKSPACE/nceplibs/jasper -DBUILD_G2C=ON -DLOGGING=On -DPTHREADS=ON -DFTP_TEST_FILES=ON -DFTP_LARGE_TEST_FILES=OFF -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug-DCMAKE_C_FLAGS="-g -fprofile-arcs -ftest-coverage -fprofile-abs-path -O0" + cmake -S g2c -B g2c/build -DUSE_AEC=ON -DJasper_ROOT=$GITHUB_WORKSPACE/nceplibs/jasper -DBUILD_G2C=ON -DLOGGING=On -DPTHREADS=ON -DFTP_TEST_FILES=ON -DFTP_LARGE_TEST_FILES=OFF -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-g -fprofile-arcs -ftest-coverage -fprofile-abs-path -O0" pwd cd g2c/build make VERBOSE=1 diff --git a/tests/tst_files.c b/tests/tst_files.c index 1c577925..c38765c0 100644 --- a/tests/tst_files.c +++ b/tests/tst_files.c @@ -104,16 +104,16 @@ main() /* /\* Create max number of files. *\/ */ /* for (i = 0; i < G2C_MAX_FILES; i++) */ /* if ((ret = g2c_create(FILE_NAME, G2C_CLOBBER, &g2cid[i]))) */ - /* return ret; */ + /* return ret; */ /* /\* Try to create one more. *\/ */ /* if (g2c_create(FILE_NAME, G2C_CLOBBER, &g2cid2) != G2C_ETOOMANYFILES) */ /* return G2C_ERROR; */ - /* /\* Close all open files. *\/ */ + /* /\* Close all open files. *\/ */ /* for (i = 0; i < G2C_MAX_FILES; i++) */ /* if ((ret = g2c_close(g2cid[i]))) */ - /* return ret; */ + /* return ret; */ /* } */ /* printf("ok!\n"); */ printf("Testing g2c_find_msg2 on file %s...", WAVE_FILE); @@ -280,9 +280,10 @@ main() } { - int pds_template_len, pds_template[G2C_MAX_PDS_TEMPLATE_MAPLEN]; - int gds_template_len, gds_template[G2C_MAX_GDS_TEMPLATE_MAPLEN]; - int drs_template_len, drs_template[G2C_MAX_DRS_TEMPLATE_MAPLEN]; + int pds_template_len, gds_template_len, drs_template_len; + long long int pds_template[G2C_MAX_PDS_TEMPLATE_MAPLEN]; + long long int gds_template[G2C_MAX_GDS_TEMPLATE_MAPLEN]; + long long int drs_template[G2C_MAX_DRS_TEMPLATE_MAPLEN]; int t; if ((ret = g2c_inq_prod(g2cid, m, 0, &pds_template_len, pds_template, @@ -295,15 +296,15 @@ main() return G2C_ERROR; printf("pds_template {"); for (t = 0; t < pds_template_len; t++) - printf("%d, ", pds_template[t]); + printf("%lld, ", pds_template[t]); printf("}\n"); printf("gds_template {"); for (t = 0; t < gds_template_len; t++) - printf("%d, ", gds_template[t]); + printf("%lld, ", gds_template[t]); printf("}\n"); printf("drs_template {"); for (t = 0; t < drs_template_len; t++) - printf("%d, ", drs_template[t]); + printf("%lld, ", drs_template[t]); printf("}\n"); } }