1 /*
2  * ====================================================================
3  *    Licensed to the Apache Software Foundation (ASF) under one
4  *    or more contributor license agreements.  See the NOTICE file
5  *    distributed with this work for additional information
6  *    regarding copyright ownership.  The ASF licenses this file
7  *    to you under the Apache License, Version 2.0 (the
8  *    "License"); you may not use this file except in compliance
9  *    with the License.  You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  *    Unless required by applicable law or agreed to in writing,
14  *    software distributed under the License is distributed on an
15  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  *    KIND, either express or implied.  See the License for the
17  *    specific language governing permissions and limitations
18  *    under the License.
19  * ====================================================================
20  */
21 
22 #include <boost/test/unit_test.hpp>
23 
24 #include "../src/private/depth_private.hpp"
25 
26 namespace svn = ::apache::subversion::svnxx;
27 namespace impl = ::apache::subversion::svnxx::impl;
28 
29 BOOST_AUTO_TEST_SUITE(depth);
30 
BOOST_AUTO_TEST_CASE(convert_to)31 BOOST_AUTO_TEST_CASE(convert_to)
32 {
33   BOOST_TEST((impl::convert(svn::depth::unknown)    == svn_depth_unknown));
34   BOOST_TEST((impl::convert(svn::depth::exclude)    == svn_depth_exclude));
35   BOOST_TEST((impl::convert(svn::depth::empty)      == svn_depth_empty));
36   BOOST_TEST((impl::convert(svn::depth::files)      == svn_depth_files));
37   BOOST_TEST((impl::convert(svn::depth::immediates) == svn_depth_immediates));
38   BOOST_TEST((impl::convert(svn::depth::infinity)   == svn_depth_infinity));
39 }
40 
BOOST_AUTO_TEST_CASE(convert_from)41 BOOST_AUTO_TEST_CASE(convert_from)
42 {
43   BOOST_TEST((impl::convert(svn_depth_unknown)    == svn::depth::unknown));
44   BOOST_TEST((impl::convert(svn_depth_exclude)    == svn::depth::exclude));
45   BOOST_TEST((impl::convert(svn_depth_empty)      == svn::depth::empty));
46   BOOST_TEST((impl::convert(svn_depth_files)      == svn::depth::files));
47   BOOST_TEST((impl::convert(svn_depth_immediates) == svn::depth::immediates));
48   BOOST_TEST((impl::convert(svn_depth_infinity)   == svn::depth::infinity));
49 }
50 
BOOST_AUTO_TEST_CASE(char_names)51 BOOST_AUTO_TEST_CASE(char_names)
52 {
53   BOOST_TEST((to_string(svn::depth::unknown)    == "unknown"));
54   BOOST_TEST((to_string(svn::depth::exclude)    == "exclude"));
55   BOOST_TEST((to_string(svn::depth::empty)      == "empty"));
56   BOOST_TEST((to_string(svn::depth::files)      == "files"));
57   BOOST_TEST((to_string(svn::depth::immediates) == "immediates"));
58   BOOST_TEST((to_string(svn::depth::infinity)   == "infinity"));
59 }
60 
BOOST_AUTO_TEST_CASE(wchar_names)61 BOOST_AUTO_TEST_CASE(wchar_names)
62 {
63   BOOST_TEST((to_wstring(svn::depth::unknown)    == L"unknown"));
64   BOOST_TEST((to_wstring(svn::depth::exclude)    == L"exclude"));
65   BOOST_TEST((to_wstring(svn::depth::empty)      == L"empty"));
66   BOOST_TEST((to_wstring(svn::depth::files)      == L"files"));
67   BOOST_TEST((to_wstring(svn::depth::immediates) == L"immediates"));
68   BOOST_TEST((to_wstring(svn::depth::infinity)   == L"infinity"));
69 }
70 
BOOST_AUTO_TEST_CASE(char16_names)71 BOOST_AUTO_TEST_CASE(char16_names)
72 {
73   BOOST_TEST((to_u16string(svn::depth::unknown)    == u"unknown"));
74   BOOST_TEST((to_u16string(svn::depth::exclude)    == u"exclude"));
75   BOOST_TEST((to_u16string(svn::depth::empty)      == u"empty"));
76   BOOST_TEST((to_u16string(svn::depth::files)      == u"files"));
77   BOOST_TEST((to_u16string(svn::depth::immediates) == u"immediates"));
78   BOOST_TEST((to_u16string(svn::depth::infinity)   == u"infinity"));
79 }
80 
BOOST_AUTO_TEST_CASE(char32_names)81 BOOST_AUTO_TEST_CASE(char32_names)
82 {
83   BOOST_TEST((to_u32string(svn::depth::unknown)    == U"unknown"));
84   BOOST_TEST((to_u32string(svn::depth::exclude)    == U"exclude"));
85   BOOST_TEST((to_u32string(svn::depth::empty)      == U"empty"));
86   BOOST_TEST((to_u32string(svn::depth::files)      == U"files"));
87   BOOST_TEST((to_u32string(svn::depth::immediates) == U"immediates"));
88   BOOST_TEST((to_u32string(svn::depth::infinity)   == U"infinity"));
89 }
90 
91 BOOST_AUTO_TEST_SUITE_END();
92