diff options
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc')
-rw-r--r-- | libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc b/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc index 0a92788296a..c02e1a77be9 100644 --- a/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc +++ b/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc @@ -1,6 +1,6 @@ // 2001-05-21 Benjamin Kosnik <bkoz@redhat.com> -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -21,6 +21,7 @@ // 27.8.1.4 Overridden virtual functions #include <fstream> +#include <locale> #include <testsuite_hooks.h> // @require@ %-*.tst %-*.txt @@ -514,6 +515,28 @@ void test06() VERIFY( buffer[0] == 'a' ); } +// libstdc++/9322 +void test07() +{ + using std::locale; + bool test = true; + + locale loc; + std::filebuf ob; + VERIFY( ob.getloc() == loc ); + + locale::global(locale("en_US")); + VERIFY( ob.getloc() == loc ); + + locale loc_de ("de_DE"); + locale ret = ob.pubimbue(loc_de); + VERIFY( ob.getloc() == loc_de ); + VERIFY( ret == loc ); + + locale::global(loc); + VERIFY( ob.getloc() == loc_de ); +} + main() { test01(); @@ -524,5 +547,6 @@ main() test05(); test06(); + test07(); return 0; } |