Fix build break with boost 1.71.0
[platform/core/security/key-manager.git] / tests / test_for-each-file.cpp
1 /*
2  *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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
15  */
16 /*
17  * @file       test_for-each-file.cpp
18  * @author     Kyungwook Tak (k.tak@samsung.com)
19  * @version    1.0
20  */
21 #include <for-each-file.h>
22
23 #include <boost/test/unit_test.hpp>
24 #include <boost/test/results_reporter.hpp>
25
26 #include <vector>
27 #include <string>
28
29 using namespace CKM;
30
31 BOOST_AUTO_TEST_SUITE(TRAVERSE_DIR_TEST)
32
33 BOOST_AUTO_TEST_CASE(T010_check_prefix)
34 {
35         std::vector<std::string> files;
36
37         forEachFile(DB_TEST_DIR "/traverse", [&files](const std::string & filename) {
38                 if (filename.find("res-") == std::string::npos)
39                         return;
40
41                 files.push_back(filename);
42         });
43
44         BOOST_REQUIRE_MESSAGE(files.size() == 10,
45                                                   "files num in traverse dir should be 10");
46 }
47
48 BOOST_AUTO_TEST_SUITE_END()