utf8rewind
1.5.1
System library for processing UTF-8 encoded text
helpers-locale.hpp
Go to the documentation of this file.
1
#pragma once
2
10
#include "
helpers-base.hpp
"
11
12
#define EXPECT_LOCALE_EQ(_expected, _actual) EXPECT_PRED_FORMAT2(::helpers::CompareLocale, _expected, _actual)
13
14
#define RESET_LOCALE() setlocale(LC_ALL, "C")
15
16
#if _WINDOWS
17
#define SET_LOCALE_AZERI() EXPECT_STREQ("az-Latn-AZ", setlocale(LC_ALL, "az-Latn-AZ"))
18
#define SET_LOCALE_DANISH() EXPECT_STREQ("da-DK", setlocale(LC_ALL, "da-DK"))
19
#define SET_LOCALE_ENGLISH() EXPECT_STREQ("en-US", setlocale(LC_ALL, "en-US"))
20
#define SET_LOCALE_FRENCH() EXPECT_STREQ("fr-FR", setlocale(LC_ALL, "fr-FR"))
21
#define SET_LOCALE_GERMAN() EXPECT_STREQ("de-DE", setlocale(LC_ALL, "de-DE"))
22
#define SET_LOCALE_GREEK() EXPECT_STREQ("el-GR", setlocale(LC_ALL, "el-GR"))
23
#define SET_LOCALE_HEBREW() EXPECT_STREQ("he-IL", setlocale(LC_ALL, "he-IL"))
24
#define SET_LOCALE_HUNGARIAN() EXPECT_STREQ("hu-HU", setlocale(LC_ALL, "hu-HU"))
25
#define SET_LOCALE_ICELANDIC() EXPECT_STREQ("is-IS", setlocale(LC_ALL, "is-IS"))
26
#define SET_LOCALE_IRISH() EXPECT_STREQ("ga-IE", setlocale(LC_ALL, "ga-IE"))
27
#define SET_LOCALE_JAPANESE() EXPECT_STREQ("ja-JP", setlocale(LC_ALL, "ja-JP"))
28
#define SET_LOCALE_LITHUANIAN() EXPECT_STREQ("lt-LT", setlocale(LC_ALL, "lt-LT"))
29
#define SET_LOCALE_POLISH() EXPECT_STREQ("pl-PL", setlocale(LC_ALL, "pl-PL"))
30
#define SET_LOCALE_RUSSIAN() EXPECT_STREQ("ru-RU", setlocale(LC_ALL, "ru-RU"))
31
#define SET_LOCALE_SPANISH() EXPECT_STREQ("es-ES", setlocale(LC_ALL, "es-ES"))
32
#define SET_LOCALE_THAI() EXPECT_STREQ("th-TH", setlocale(LC_ALL, "th-TH"))
33
#define SET_LOCALE_TURKISH() EXPECT_STREQ("tr-TR", setlocale(LC_ALL, "tr-TR"))
34
#else
35
#define SET_LOCALE_AZERI() EXPECT_STREQ("az_AZ.utf8", setlocale(LC_ALL, "az_AZ.utf8"))
36
#define SET_LOCALE_DANISH() EXPECT_STREQ("da_DK.utf8", setlocale(LC_ALL, "da_DK.utf8"))
37
#define SET_LOCALE_ENGLISH() EXPECT_STREQ("en_US.utf8", setlocale(LC_ALL, "en_US.utf8"))
38
#define SET_LOCALE_FRENCH() EXPECT_STREQ("fr_FR.utf8", setlocale(LC_ALL, "fr_FR.utf8"))
39
#define SET_LOCALE_GERMAN() EXPECT_STREQ("de_DE.utf8", setlocale(LC_ALL, "de_DE.utf8"))
40
#define SET_LOCALE_GREEK() EXPECT_STREQ("el_GR.utf8", setlocale(LC_ALL, "el_GR.utf8"))
41
#define SET_LOCALE_HEBREW() EXPECT_STREQ("he_IL.utf8", setlocale(LC_ALL, "he_IL.utf8"))
42
#define SET_LOCALE_HUNGARIAN() EXPECT_STREQ("hu_HU.utf8", setlocale(LC_ALL, "hu_HU.utf8"))
43
#define SET_LOCALE_ICELANDIC() EXPECT_STREQ("is_IS.utf8", setlocale(LC_ALL, "is_IS.utf8"))
44
#define SET_LOCALE_IRISH() EXPECT_STREQ("ga_IE.utf8", setlocale(LC_ALL, "ga_IE.utf8"))
45
#define SET_LOCALE_JAPANESE() EXPECT_STREQ("ja_JP.utf8", setlocale(LC_ALL, "ja_JP.utf8"))
46
#define SET_LOCALE_LITHUANIAN() EXPECT_STREQ("lt_LT.utf8", setlocale(LC_ALL, "lt_LT.utf8"))
47
#define SET_LOCALE_POLISH() EXPECT_STREQ("pl_PL.utf8", setlocale(LC_ALL, "pl_PL.utf8"))
48
#define SET_LOCALE_RUSSIAN() EXPECT_STREQ("ru_RU.utf8", setlocale(LC_ALL, "ru_RU.utf8"))
49
#define SET_LOCALE_SPANISH() EXPECT_STREQ("es_ES.utf8", setlocale(LC_ALL, "es_ES.utf8"))
50
#define SET_LOCALE_THAI() EXPECT_STREQ("th_TH.utf8", setlocale(LC_ALL, "th_TH.utf8"))
51
#define SET_LOCALE_TURKISH() EXPECT_STREQ("tr_TR.utf8", setlocale(LC_ALL, "tr_TR.utf8"))
52
#endif
53
54
namespace
helpers {
55
56
std::string locale(
size_t
value);
57
58
::testing::AssertionResult CompareLocale(
59
const
char
* expressionExpected,
const
char
* expressionActual,
60
size_t
localeExpected,
size_t
localeActual);
61
62
};
63
helpers-base.hpp
Base includes for helper methods.
source
helpers
helpers-locale.hpp
Generated by
1.8.12