Skip to content

Commit

Permalink
lsb-vsx: overall clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdebek committed Jul 12, 2023
1 parent 348d646 commit 4122736
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 42 deletions.
2 changes: 1 addition & 1 deletion lsb_vsx_posix/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME := lsb_vsx_posix
LOCAL_SRCS := lsb_vsx_posix.c

include $(binary.mk)
include $(binary.mk)
14 changes: 7 additions & 7 deletions lsb_vsx_posix/lsb_vsx_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ int main(int argc, char **argv)
const char *cmd_single_test = "/usr/test/lsb_vsx_posix/files/bin/tcc -p -e -s /usr/test/lsb_vsx_posix/files/test_sets/scen_single.exec -j -";
const char *cmd_clean = "/usr/test/lsb_vsx_posix/files/bin/tcc -p -c -s /usr/test/lsb_vsx_posix/files/test_sets/scen_single.exec";
const char *cwd = "/usr/test/lsb_vsx_posix/files/test_sets";
const char *resultPath = "/usr/test/lsb_vsx_posix/files/test_sets/results";

char *line = NULL;
char total[40];
Expand All @@ -27,7 +26,7 @@ int main(int argc, char **argv)
return 1;
}

/* Set necessary enviroment variables */
/* Set necessary environment variables */
if (setenv("TET_ROOT", "/usr/test/lsb_vsx_posix/files", 0) != 0) {
perror("setenv() - setting \"TET_ROOT\" failed");
return 1;
Expand All @@ -42,17 +41,17 @@ int main(int argc, char **argv)
if (argc == 2) {
/* File containing all tests */
all_tests_f = fopen("/usr/test/lsb_vsx_posix/files/test_sets/scen.exec", "r");
if (all_tests_f == -1) {
if (all_tests_f == NULL) {
perror("fopen");
exit(EXIT_FAILURE);
}
/* File which we gonna pass to tcc, this file will contain 2 required lines and one test name */
single_test_f = open("/usr/test/lsb_vsx_posix/files/test_sets/scen_single.exec", O_WRONLY | O_CREAT | O_TRUNC);
if (single_test_f == NULL) {
if (single_test_f == -1) {
perror("fopen");
exit(EXIT_FAILURE);
}
/* append "all" to start of scenario file in order to follow file format*/
/* append "all" to start of scenario file in order to follow file format */
write(single_test_f, "all\n", 5);

while ((nread = getline(&line, &len, all_tests_f)) != -1) {
Expand All @@ -61,15 +60,16 @@ int main(int argc, char **argv)
* the line we need will reside in buffer "total".
*/
if (strstr(line, "total tests in") != NULL) {
strncpy(total, line, 40);
strncpy(total, line, 39);
total[40] = '\0';

Check warning on line 64 in lsb_vsx_posix/lsb_vsx_posix.c

View workflow job for this annotation

GitHub Actions / call-ci / build (armv7a7-imx6ull-evk)

array subscript 40 is above array bounds of 'char[40]' [-Warray-bounds]

Check warning on line 64 in lsb_vsx_posix/lsb_vsx_posix.c

View workflow job for this annotation

GitHub Actions / call-ci / build (armv7a9-zynq7000-qemu)

array subscript 40 is above array bounds of 'char[40]' [-Warray-bounds]

Check warning on line 64 in lsb_vsx_posix/lsb_vsx_posix.c

View workflow job for this annotation

GitHub Actions / call-ci / build (armv7a9-zynq7000-zedboard)

array subscript 40 is above array bounds of 'char[40]' [-Warray-bounds]

Check warning on line 64 in lsb_vsx_posix/lsb_vsx_posix.c

View workflow job for this annotation

GitHub Actions / call-ci / build (armv7a9-zynq7000-zturn)

array subscript 40 is above array bounds of 'char[40]' [-Warray-bounds]

Check warning on line 64 in lsb_vsx_posix/lsb_vsx_posix.c

View workflow job for this annotation

GitHub Actions / call-ci / build (armv7m4-stm32l4x6-nucleo)

array subscript 40 is above array bounds of 'char[40]' [-Warray-bounds]

Check warning on line 64 in lsb_vsx_posix/lsb_vsx_posix.c

View workflow job for this annotation

GitHub Actions / call-ci / build (armv7m7-imxrt106x-evk)

array subscript 40 is above array bounds of 'char[40]' [-Warray-bounds]

Check warning on line 64 in lsb_vsx_posix/lsb_vsx_posix.c

View workflow job for this annotation

GitHub Actions / call-ci / build (armv7m7-imxrt117x-evk)

array subscript 40 is above array bounds of 'char[40]' [-Warray-bounds]

Check warning on line 64 in lsb_vsx_posix/lsb_vsx_posix.c

View workflow job for this annotation

GitHub Actions / call-ci / build (ia32-generic-pc)

array subscript 40 is above array bounds of 'char[40]' [-Warray-bounds]

Check warning on line 64 in lsb_vsx_posix/lsb_vsx_posix.c

View workflow job for this annotation

GitHub Actions / call-ci / build (ia32-generic-qemu)

array subscript 40 is above array bounds of 'char[40]' [-Warray-bounds]

Check warning on line 64 in lsb_vsx_posix/lsb_vsx_posix.c

View workflow job for this annotation

GitHub Actions / call-ci / build (riscv64-generic-qemu)

array subscript 40 is above array bounds of 'char[40]' [-Warray-bounds]

Check warning on line 64 in lsb_vsx_posix/lsb_vsx_posix.c

View workflow job for this annotation

GitHub Actions / call-ci / build (riscv64-generic-spike)

array subscript 40 is above array bounds of 'char[40]' [-Warray-bounds]
}
if (strstr(line, argv[1]) != NULL) {
/* Write second line */
write(single_test_f, total, strlen(total));
/* Write test name */
write(single_test_f, line, nread);

/*Test found, everything we need written, so close and clean */
/* Test found, everything we need written, so close and clean */
fclose(all_tests_f);
close(single_test_f);
free(line);
Expand Down
34 changes: 0 additions & 34 deletions trunner/harnesses/factory.py

This file was deleted.

0 comments on commit 4122736

Please sign in to comment.