]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/experimental/filesystem/operations/canonical.cc
2.cc: Remove unused using declaration.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / experimental / filesystem / operations / canonical.cc
CommitLineData
818ab71a 1// Copyright (C) 2015-2016 Free Software Foundation, Inc.
30362998
JW
2//
3// This file is part of the GNU ISO C++ Library. This library is free
4// software; you can redistribute it and/or modify it under the
5// terms of the GNU General Public License as published by the
6// Free Software Foundation; either version 3, or (at your option)
7// any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License along
15// with this library; see the file COPYING3. If not see
16// <http://www.gnu.org/licenses/>.
17
18// { dg-options "-std=gnu++11 -lstdc++fs" }
19// { dg-require-filesystem-ts "" }
20
21#include <experimental/filesystem>
22#include <testsuite_hooks.h>
23#include <testsuite_fs.h>
24
25namespace fs = std::experimental::filesystem;
26
27void
28test01()
29{
30 bool test __attribute__((unused)) = false;
31
32 std::error_code ec;
33 auto p = __gnu_test::nonexistent_path();
34 canonical( p, ec );
35 VERIFY( ec );
36
37 p = fs::current_path();
38 canonical( p, ec );
39 VERIFY( !ec );
40
41 p = "/";
42 p = canonical( p, ec );
43 VERIFY( p == "/" );
44 VERIFY( !ec );
45
46 p = "/.";
47 p = canonical( p, ec );
48 VERIFY( p == "/" );
49 VERIFY( !ec );
50
51 p = "/..";
52 p = canonical( p, ec );
53 VERIFY( p == "/" );
54 VERIFY( !ec );
55
56 p = "/../.././.";
57 p = canonical( p, ec );
58 VERIFY( p == "/" );
59 VERIFY( !ec );
30362998
JW
60}
61
62int
63main()
64{
65 test01();
66}