native.pass.cpp 988 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // UNSUPPORTED: c++98, c++03
  10. // <experimental/filesystem>
  11. // class path
  12. // const string_type& native() const noexcept;
  13. #include <experimental/filesystem>
  14. #include <type_traits>
  15. #include <cassert>
  16. #include "test_macros.h"
  17. #include "filesystem_test_helper.hpp"
  18. namespace fs = std::experimental::filesystem;
  19. int main()
  20. {
  21. using namespace fs;
  22. const char* const value = "hello world";
  23. path p(value);
  24. { // Check signature
  25. ASSERT_SAME_TYPE(path::string_type const&, decltype(p.native()));
  26. ASSERT_NOEXCEPT(p.native());
  27. }
  28. { // native() is tested elsewhere
  29. path p(value);
  30. assert(p.native() == value);
  31. }
  32. }