提交 c876dff1 编写于 作者: H hujiahui8

fix bug: update the path of poly UT

上级 7a14ca3e
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#define PATH_MAX 4096 #define PATH_MAX 4096
#define MAX_PATH_DEPTH 20
#include <fstream> #include <fstream>
#include <unistd.h> #include <unistd.h>
#include "poly/poly_util.h" #include "poly/poly_util.h"
...@@ -86,8 +87,7 @@ std::string ScheduleTreeHelper::UndoPrettyPrintSchTree(const std::string &schedu ...@@ -86,8 +87,7 @@ std::string ScheduleTreeHelper::UndoPrettyPrintSchTree(const std::string &schedu
} }
std::string ScheduleTreeHelper::GetPolyPassCasePath() { std::string ScheduleTreeHelper::GetPolyPassCasePath() {
std::string relative_path("/test/unittest_cpp/src/poly_pass_case/"); std::string relative_path("/tests/unittest_cpp/src/poly_pass_case/");
int max_path_depth = 16;
char cwd[PATH_MAX]; char cwd[PATH_MAX];
char *ret = getcwd(cwd, sizeof(cwd)); char *ret = getcwd(cwd, sizeof(cwd));
...@@ -113,7 +113,7 @@ std::string ScheduleTreeHelper::GetPolyPassCasePath() { ...@@ -113,7 +113,7 @@ std::string ScheduleTreeHelper::GetPolyPassCasePath() {
} }
dirname = parent_path; dirname = parent_path;
++path_depth_count; ++path_depth_count;
if (path_depth_count > max_path_depth) { if (path_depth_count > MAX_PATH_DEPTH) {
LOG(WARNING) << "Failed to find " << relative_path << " file."; LOG(WARNING) << "Failed to find " << relative_path << " file.";
return ""; return "";
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册