@@ -59,9 +59,15 @@ TEST(WorkerPool, PoolReturnsNullptrWhenNoWorkerAvaialable) {
59
59
ioc_thread.join ();
60
60
}
61
61
62
+ class EventProcessorTests : public ::testing::Test {
63
+ public:
64
+ EventProcessorTests () : locale(" en_US.utf-8" ) {}
65
+ std::locale locale;
66
+ };
67
+
62
68
// This test is a temporary test that exists only to ensure the event processor
63
69
// compiles; it should be replaced by more robust tests (and contract tests.)
64
- TEST (EventProcessorTests, ProcessorCompiles) {
70
+ TEST_F (EventProcessorTests, ProcessorCompiles) {
65
71
using namespace launchdarkly ;
66
72
67
73
Logger logger{
@@ -95,33 +101,34 @@ TEST(EventProcessorTests, ProcessorCompiles) {
95
101
ioc_thread.join ();
96
102
}
97
103
98
- TEST (EventProcessorTests, ParseValidDateHeader) {
104
+ TEST_F (EventProcessorTests, ParseValidDateHeader) {
99
105
using namespace launchdarkly ;
100
106
101
107
using Clock = std::chrono::system_clock;
102
- auto date = events::ParseDateHeader<Clock>(" Wed, 21 Oct 2015 07:28:00 GMT" );
108
+ auto date =
109
+ events::ParseDateHeader<Clock>(" Wed, 21 Oct 2015 07:28:00 GMT" , locale);
103
110
104
111
ASSERT_TRUE (date);
105
112
106
113
ASSERT_EQ (date->time_since_epoch (),
107
114
std::chrono::microseconds (1445412480000000 ));
108
115
}
109
116
110
- TEST (EventProcessorTests, ParseInvalidDateHeader) {
117
+ TEST_F (EventProcessorTests, ParseInvalidDateHeader) {
111
118
using namespace launchdarkly ;
112
119
113
120
auto not_a_date = events::ParseDateHeader<std::chrono::system_clock>(
114
- " this is definitely not a date" );
121
+ " this is definitely not a date" , locale );
115
122
116
123
ASSERT_FALSE (not_a_date);
117
124
118
125
auto not_gmt = events::ParseDateHeader<std::chrono::system_clock>(
119
- " Wed, 21 Oct 2015 07:28:00 PST" );
126
+ " Wed, 21 Oct 2015 07:28:00 PST" , locale );
120
127
121
128
ASSERT_FALSE (not_gmt);
122
129
123
130
auto missing_year = events::ParseDateHeader<std::chrono::system_clock>(
124
- " Wed, 21 Oct 07:28:00 GMT" );
131
+ " Wed, 21 Oct 07:28:00 GMT" , locale );
125
132
126
133
ASSERT_FALSE (missing_year);
127
134
}
0 commit comments