Merged PR 816097: Fix failing unit tests in Ubuntu 24.04

Resolving the issues related to Ubuntu 24.04
![Screenshot (22).png](https://dev.azure.com/mseng/9ed2c125-1cd5-4a17-886b-9d267f3a5fab/_apis/git/repositories/50d331c7-ea65-45eb-833f-0303c6c2387e/pullRequests/816097/attachments/Screenshot%20%2822%29.png)

Related work items: #2227479
This commit is contained in:
Sahiti Chandramouli 2024-11-19 18:42:57 +00:00
Родитель 7ac3188a10
Коммит 24aa2399ce
2 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -76,16 +76,16 @@ int FileDescriptorAccessesFullyResolvesPath()
}
int ExecReportsCorrectExecutableAndArgumentsSuccess() {
char *const args[] = {"/bin/echo", "hello world", nullptr};
execv(args[0], args);
const char *const args[] = {"/bin/echo", "hello world", nullptr};
execv(args[0], const_cast<char* const*>(args));
// execv should have succeeded and we should never hit this return statement
return 1;
}
int ExecReportsCorrectExecutableAndArgumentsFailed() {
char *const args[] = {"/bin/echooooo", "hello world", nullptr};
execv(args[0], args);
const char *const args[] = {"/bin/echooooo", "hello world", nullptr};
execv(args[0], const_cast<char* const*>(args));
// expecting execv to fail here
return EXIT_SUCCESS;

Просмотреть файл

@ -4,6 +4,7 @@
#include <linux/sched.h>
#include <sys/syscall.h>
#include <cstdint>
#include "syscalltests.hpp"
// clone3 is available on linux kernel 5.3+