1 /*
2 ** Copyright 2012-2013 Centreon
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 ** For more information : contact@centreon.com
17 */
18 
19 #include <cstdlib>
20 #include <iostream>
21 #include "com/centreon/exceptions/basic.hh"
22 #include "com/centreon/io/file_entry.hh"
23 
24 using namespace com::centreon;
25 
26 /**
27  *  Check that class can be created.
28  *
29  *  @return EXIT_SUCCESS on success.
30  */
main(int argc,char * argv[])31 int main(int argc, char* argv[]) {
32   (void)argc;
33 
34   int ret(EXIT_FAILURE);
35   try {
36     {
37       io::file_entry entry(NULL);
38       if (!entry.path().empty())
39         throw(basic_error() << "invalid constructor: path is not empty");
40     }
41 
42     {
43       io::file_entry entry(argv[0]);
44       if (entry.path().empty())
45         throw(basic_error() << "invalid constructor: path is empty");
46     }
47 
48     ret = EXIT_SUCCESS;
49   } catch (std::exception const& e) {
50     std::cerr << e.what() << std::endl;
51   }
52   return (ret);
53 }
54