2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
17 * @file test_for-each-file.cpp
18 * @author Kyungwook Tak (k.tak@samsung.com)
21 #include <for-each-file.h>
23 #include <boost/test/unit_test.hpp>
24 #include <boost/test/results_reporter.hpp>
31 BOOST_AUTO_TEST_SUITE(TRAVERSE_DIR_TEST)
33 BOOST_AUTO_TEST_CASE(T010_check_prefix)
35 std::vector<std::string> files;
37 forEachFile(DB_TEST_DIR "/traverse", [&files](const std::string & filename) {
38 if (filename.find("res-") == std::string::npos)
41 files.push_back(filename);
44 BOOST_REQUIRE_MESSAGE(files.size() == 10,
45 "files num in traverse dir should be 10");
48 BOOST_AUTO_TEST_SUITE_END()