[libc][NFC] Remove extra ; in exhaustive_test.h. (#124216)
[llvm-project.git] / libcxx / test / std / input.output / stream.buffers / streambuf / streambuf.members / streambuf.locales / locales.pass.cpp
blob97b20f7019dd351938857dc7619805e733617f78
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // REQUIRES: locale.en_US.UTF-8
10 // REQUIRES: locale.fr_FR.UTF-8
12 // <streambuf>
14 // template <class charT, class traits = char_traits<charT> >
15 // class basic_streambuf;
17 // locale pubimbue(const locale& loc);
18 // locale getloc() const;
20 #include <streambuf>
21 #include <cassert>
23 #include "test_macros.h"
24 #include "platform_support.h" // locale name macros
26 template <class CharT>
27 struct test
28 : public std::basic_streambuf<CharT>
30 test() {}
32 void imbue(const std::locale&)
34 assert(this->getloc().name() == LOCALE_en_US_UTF_8);
38 int main(int, char**)
41 test<char> t;
42 assert(t.getloc().name() == "C");
44 std::locale::global(std::locale(LOCALE_en_US_UTF_8));
46 test<char> t;
47 assert(t.getloc().name() == LOCALE_en_US_UTF_8);
48 assert(t.pubimbue(std::locale(LOCALE_fr_FR_UTF_8)).name() ==
49 LOCALE_en_US_UTF_8);
50 assert(t.getloc().name() == LOCALE_fr_FR_UTF_8);
53 return 0;