1 /*
2    BAREOS® - Backup Archiving REcovery Open Sourced
3 
4    Copyright (C) 2019-2019 Bareos GmbH & Co. KG
5 
6    This program is Free Software; you can redistribute it and/or
7    modify it under the terms of version three of the GNU Affero General Public
8    License as published by the Free Software Foundation and included
9    in the file LICENSE.
10 
11    This program is distributed in the hope that it will be useful, but
12    WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14    Affero General Public License for more details.
15 
16    You should have received a copy of the GNU Affero General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19    02110-1301, USA.
20 */
21 #if defined(HAVE_MINGW)
22 #  include "include/bareos.h"
23 #  include "gtest/gtest.h"
24 #else
25 #  include "gtest/gtest.h"
26 #  include "include/bareos.h"
27 #endif
28 
29 #include "lib/parse_conf.h"
30 #include "filed/filed_globals.h"
31 #include "filed/filed_conf.h"
32 
33 namespace filedaemon {
34 
TEST(ConfigParser,test_filed_config)35 TEST(ConfigParser, test_filed_config)
36 {
37   OSDependentInit();
38   InitMsg(NULL, NULL); /* initialize message handler */
39 
40   std::string path_to_config_file = std::string(
41       RELATIVE_PROJECT_SOURCE_DIR "/configs/bareos-configparser-tests");
42   my_config = InitFdConfig(path_to_config_file.c_str(), M_ERROR_TERM);
43 
44   ASSERT_TRUE(my_config->ParseConfig());
45 
46   my_config->DumpResources(PrintMessage, NULL);
47 
48   delete my_config;
49 
50   TermMsg();         /* Terminate message handler */
51   CloseMemoryPool(); /* release free memory in pool */
52 }
53 
54 }  // namespace filedaemon
55