提交 8be8f079 编写于 作者: F FondMemoryVVV

Modify the format

Signed-off-by: NFondMemoryVVV <mashuai53@huawei.com>
上级 f1486d77
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
#include "gettestfiles.cpp" #include "gettestfiles.cpp"
#include "runtest.h" #include "runtest.h"
namespace OHOS{
using namespace std; using namespace std;
static vector<std::string> filenames; static vector<std::string> filenames;
vector<std::string> GetFileNames(std::string path) std::vector<std::string> runtest::GetFileNames(std::string path)
{ {
vector<string> tempName; vector<string> tempName;
GetTestNames(path, tempName); GetTestNames(path, tempName);
...@@ -37,4 +37,5 @@ vector<std::string> GetFileNames(std::string path) ...@@ -37,4 +37,5 @@ vector<std::string> GetFileNames(std::string path)
filenames.push_back(tempName[i]); filenames.push_back(tempName[i]);
} }
return filenames; return filenames;
} }
\ No newline at end of file } //namespace OHOS
\ No newline at end of file
...@@ -18,8 +18,13 @@ ...@@ -18,8 +18,13 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <vector> #include <vector>
namespace OHOS {
int t_setrlim(int r, long lim); class runtest
std::vector<std::string> GetFileNames(std::string path); {
public:
static int t_setrlim(int r, long lim);
static std::vector<std::string> GetFileNames(std::string path);
};
} //namespace OHOS
#endif // TOOLCHAIN_LIBC_TEST_INCLUDE_RUNTEST_H_ #endif // TOOLCHAIN_LIBC_TEST_INCLUDE_RUNTEST_H_
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
#include <sys/resource.h> #include <sys/resource.h>
#include "runtest.h" #include "runtest.h"
namespace OHOS{
int t_setrlim(int r, long lim) int runtest::t_setrlim(int r, long lim)
{ {
struct rlimit rl; struct rlimit rl;
...@@ -40,4 +40,5 @@ int t_setrlim(int r, long lim) ...@@ -40,4 +40,5 @@ int t_setrlim(int r, long lim)
return -1; return -1;
} }
return 0; return 0;
} }
\ No newline at end of file } //namespace OHOS
\ No newline at end of file
...@@ -37,7 +37,7 @@ namespace OHOS { ...@@ -37,7 +37,7 @@ namespace OHOS {
class toolchaintest : public ::testing::TestWithParam<string> {}; class toolchaintest : public ::testing::TestWithParam<string> {};
static string filepath = "/data/local/tmp/libc-test/src"; static string filepath = "/data/local/tmp/libc-test/src";
static vector<string> temp = GetFileNames(filepath); static vector<std::string> temp = runtest::GetFileNames(filepath);
volatile int t_status = 0; volatile int t_status = 0;
static void handler(int s) static void handler(int s)
...@@ -50,7 +50,7 @@ static int start(char *wrap, const char *argvs) ...@@ -50,7 +50,7 @@ static int start(char *wrap, const char *argvs)
pid = fork(); pid = fork();
if (pid == 0) { if (pid == 0) {
t_setrlim(RLIMIT_STACK, space_size); runtest::t_setrlim(RLIMIT_STACK, space_size);
int exe = execl(argvs, "strptime", nullptr); int exe = execl(argvs, "strptime", nullptr);
printf("exe:%d %s exec failed: %s\n", exe, argvs, strerror(errno)); printf("exe:%d %s exec failed: %s\n", exe, argvs, strerror(errno));
exit(1); exit(1);
...@@ -64,11 +64,13 @@ static int runTests(const char *argvs) ...@@ -64,11 +64,13 @@ static int runTests(const char *argvs)
int timeoutsec = 5, timeout = 0; int timeoutsec = 5, timeout = 0;
int status, pid; int status, pid;
sigset_t set; sigset_t set;
void (*retfunc)(int);
sigemptyset(&set); sigemptyset(&set);
sigaddset(&set, SIGCHLD); sigaddset(&set, SIGCHLD);
sigprocmask(SIG_BLOCK, &set, nullptr); sigprocmask(SIG_BLOCK, &set, nullptr);
if (signal(SIGCHLD, handler) == SIG_ERR) { retfunc = signal(SIGCHLD, handler);
if (retfunc == SIG_ERR) {
printf("signal triggering failed:%s\n", strerror(errno)); printf("signal triggering failed:%s\n", strerror(errno));
} }
pid = start(wrap, argvs); pid = start(wrap, argvs);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册