2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2019-02-27 18:39:32 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "runtime/utilities/directory.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
#include "test.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
#include <fstream>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2017-12-21 07:45:38 +08:00
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
TEST(Directory, GetFiles) {
|
|
|
|
ofstream tempfile("temp_file_that_does_not_exist.tmp");
|
|
|
|
tempfile << " ";
|
|
|
|
tempfile.flush();
|
|
|
|
tempfile.close();
|
|
|
|
|
|
|
|
string path = ".";
|
|
|
|
vector<string> files = Directory::getFiles(path);
|
|
|
|
|
|
|
|
EXPECT_LT(0u, files.size());
|
|
|
|
remove("temp_file_that_does_not_exist.tmp");
|
|
|
|
}
|