Closed Storegist closed 2 years ago
Еще не запускал, но есть предложение:
Было бы лучше ( и как путь доработки). Использовать ключи запуска не в формате 1,2,3... а согласно тикета ./test_prog --text='some text' --other-text='text2' -loop Output "some text"
Для решения этой задачи подойдут библиотеки описанные здесь https://stackoverflow.com/questions/9642732/parsing-command-line-arguments-in-c
В частности эта выглядит неплохо и довольно проста в реализации https://www.gnu.org/software/libc/manual/html_node/Getopt.html
Оk, I will try to correct it
Сценарий 1.
строка запуска:
./test_prog
ожидаемый результат:
Hello world
Полученный результат:
Комментарий: вместо одного сообщения выводит несколько (мелочи) и выводит сообщение о созданном файле. Лишнее сообщение будет мешать в автоматизированном тестировании.
Сценарий 2.
строка запуска:
./test_prog --text='soome text'
ожидаемый результат:
soome text
Полученный результат:
Комментарий: должно выводить только значение аргумента, без ключей
Сценарий 3.
строка запуска:
./test_prog --text='text1' --other-text='text2'
ожидаемый результат:
text1 text2
Полученный результат:
Комментарий: приложение не обрабатывает второй аргумент и завершает свою работу с "Segmentation fault: 11"
Сценарий 3.
строка запуска:
./test_prog --text='text1' --loop
ожидаемый результат:
text1 text1 text1
(бесконечный вывод text1 с задержкой между выводами 5 секунд)
Полученный результат:
Комментарий: все то же что и в предыдущих случаях. Но нам важно получиь приложение, которое добровольно не завершает свое выполнение никогда
Так же есть тревожные замечания от cppchecker такое не стоит игнорировать
I agree with all, that Andrey said and checked your program. You check arguments, if its number is three you need to add argv[2](last argument) to string, not argv[3](numbering starts from 0) and other elements of argv too.
I have corrected everything. Please check
Okey, it's cool and I have only recommendation:
So this is a separate application (in same codebase) that will help to test our Execution Manager https://github.com/ValentinSidorov/DeLorean_Team/tree/SerhiiShmahlii/tests/integration
Depending on the keys used, the program should work in the following combinations:
(how to launch each particular option is described in the brackets )