Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include <locale.h> | |
| 6 | |
| 7 #include "base/test/scoped_locale.h" | |
|
Paweł Hajdan Jr.
2011/06/10 17:00:51
nit: This must always be the first header.
Joao da Silva
2011/06/14 16:48:44
Done.
| |
| 8 | |
| 9 namespace base { | |
| 10 | |
| 11 ScopedSetLocale::ScopedSetLocale(const std::string& locale) { | |
| 12 prev_locale_ = setlocale(LC_ALL, NULL); | |
| 13 current_locale_ = setlocale(LC_ALL, locale.c_str()); | |
|
Joao da Silva
2011/06/10 15:53:56
We can't do much in the ctor about it, so I've add
Paweł Hajdan Jr.
2011/06/10 17:00:51
I'd prefer using gtest's EXPECT_ macro and getting
Joao da Silva
2011/06/14 16:48:44
I tried that (see patch set 4), and it worked fine
Paweł Hajdan Jr.
2011/06/14 20:20:07
Can we get the locale installed on the bots? The p
Joao da Silva
2011/06/15 10:15:13
I'll try to get the locale on the linux bots.
Not
Paweł Hajdan Jr.
2011/06/16 10:33:27
Thanks, I've noticed the bug - sounds good.
Joao da Silva
2011/06/16 11:12:18
It's not clear to me what you mean here. Did you m
Paweł Hajdan Jr.
2011/06/16 11:46:19
Sorry, I think I meant
3. actually use EXPECT_TRU
| |
| 14 } | |
| 15 | |
| 16 ScopedSetLocale::~ScopedSetLocale() { | |
| 17 setlocale(LC_ALL, prev_locale_); | |
| 18 } | |
| 19 | |
| 20 } // namespace base | |
| OLD | NEW |