Skip to content

Commit 1a531c7

Browse files
committed
Use consistent init syntax for size_t in tests
1 parent 274a35d commit 1a531c7

File tree

6 files changed

+164
-140
lines changed

6 files changed

+164
-140
lines changed

test/ClientTests.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,28 +111,28 @@ TEST_F(ClientCase, QueryEverything)
111111
auto state = std::make_shared<today::RequestState>(1);
112112
auto result =
113113
_service->resolve({ query, {}, std::move(variables), std::launch::async, state }).get();
114-
EXPECT_EQ(size_t(1), _getAppointmentsCount)
114+
EXPECT_EQ(size_t { 1 }, _getAppointmentsCount)
115115
<< "today service lazy loads the appointments and caches the result";
116-
EXPECT_EQ(size_t(1), _getTasksCount)
116+
EXPECT_EQ(size_t { 1 }, _getTasksCount)
117117
<< "today service lazy loads the tasks and caches the result";
118-
EXPECT_EQ(size_t(1), _getUnreadCountsCount)
118+
EXPECT_EQ(size_t { 1 }, _getUnreadCountsCount)
119119
<< "today service lazy loads the unreadCounts and caches the result";
120-
EXPECT_EQ(size_t(1), state->appointmentsRequestId)
120+
EXPECT_EQ(size_t { 1 }, state->appointmentsRequestId)
121121
<< "today service passed the same RequestState";
122-
EXPECT_EQ(size_t(1), state->tasksRequestId) << "today service passed the same RequestState";
123-
EXPECT_EQ(size_t(1), state->unreadCountsRequestId)
122+
EXPECT_EQ(size_t { 1 }, state->tasksRequestId) << "today service passed the same RequestState";
123+
EXPECT_EQ(size_t { 1 }, state->unreadCountsRequestId)
124124
<< "today service passed the same RequestState";
125-
EXPECT_EQ(size_t(1), state->loadAppointmentsCount) << "today service called the loader once";
126-
EXPECT_EQ(size_t(1), state->loadTasksCount) << "today service called the loader once";
127-
EXPECT_EQ(size_t(1), state->loadUnreadCountsCount) << "today service called the loader once";
125+
EXPECT_EQ(size_t { 1 }, state->loadAppointmentsCount) << "today service called the loader once";
126+
EXPECT_EQ(size_t { 1 }, state->loadTasksCount) << "today service called the loader once";
127+
EXPECT_EQ(size_t { 1 }, state->loadUnreadCountsCount) << "today service called the loader once";
128128

129129
try
130130
{
131131
ASSERT_TRUE(result.type() == response::Type::Map);
132132
auto serviceResponse = client::parseServiceResponse(std::move(result));
133133
const auto response = parseResponse(std::move(serviceResponse.data));
134134

135-
EXPECT_EQ(size_t {}, serviceResponse.errors.size()) << "no errors expected";
135+
EXPECT_EQ(size_t { 0 }, serviceResponse.errors.size()) << "no errors expected";
136136

137137
ASSERT_TRUE(response.appointments.edges.has_value()) << "appointments should be set";
138138
ASSERT_EQ(size_t { 1 }, response.appointments.edges->size())
@@ -212,7 +212,7 @@ TEST_F(ClientCase, MutateCompleteTask)
212212
auto serviceResponse = client::parseServiceResponse(std::move(result));
213213
const auto response = parseResponse(std::move(serviceResponse.data));
214214

215-
EXPECT_EQ(size_t {}, serviceResponse.errors.size()) << "no errors expected";
215+
EXPECT_EQ(size_t { 0 }, serviceResponse.errors.size()) << "no errors expected";
216216

217217
const auto& completedTask = response.completedTask;
218218
const auto& task = completedTask.completedTask;
@@ -260,7 +260,7 @@ TEST_F(ClientCase, SubscribeNextAppointmentChangeDefault)
260260
auto serviceResponse = client::parseServiceResponse(std::move(result));
261261
const auto response = parseResponse(std::move(serviceResponse.data));
262262

263-
EXPECT_EQ(size_t {}, serviceResponse.errors.size()) << "no errors expected";
263+
EXPECT_EQ(size_t { 0 }, serviceResponse.errors.size()) << "no errors expected";
264264

265265
const auto& appointmentNode = response.nextAppointment;
266266
ASSERT_TRUE(appointmentNode.has_value()) << "should get back a task";

test/NoIntrospectionTests.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,20 +149,20 @@ TEST_F(NoIntrospectionServiceCase, QueryEverything)
149149
_service->resolve(
150150
{ query, "Everything"sv, std::move(variables), std::launch::async, state })
151151
.get();
152-
EXPECT_EQ(size_t(1), _getAppointmentsCount)
152+
EXPECT_EQ(size_t { 1 }, _getAppointmentsCount)
153153
<< "today service lazy loads the appointments and caches the result";
154-
EXPECT_EQ(size_t(1), _getTasksCount)
154+
EXPECT_EQ(size_t { 1 }, _getTasksCount)
155155
<< "today service lazy loads the tasks and caches the result";
156-
EXPECT_EQ(size_t(1), _getUnreadCountsCount)
156+
EXPECT_EQ(size_t { 1 }, _getUnreadCountsCount)
157157
<< "today service lazy loads the unreadCounts and caches the result";
158-
EXPECT_EQ(size_t(1), state->appointmentsRequestId)
158+
EXPECT_EQ(size_t { 1 }, state->appointmentsRequestId)
159159
<< "today service passed the same RequestState";
160-
EXPECT_EQ(size_t(1), state->tasksRequestId) << "today service passed the same RequestState";
161-
EXPECT_EQ(size_t(1), state->unreadCountsRequestId)
160+
EXPECT_EQ(size_t { 1 }, state->tasksRequestId) << "today service passed the same RequestState";
161+
EXPECT_EQ(size_t { 1 }, state->unreadCountsRequestId)
162162
<< "today service passed the same RequestState";
163-
EXPECT_EQ(size_t(1), state->loadAppointmentsCount) << "today service called the loader once";
164-
EXPECT_EQ(size_t(1), state->loadTasksCount) << "today service called the loader once";
165-
EXPECT_EQ(size_t(1), state->loadUnreadCountsCount) << "today service called the loader once";
163+
EXPECT_EQ(size_t { 1 }, state->loadAppointmentsCount) << "today service called the loader once";
164+
EXPECT_EQ(size_t { 1 }, state->loadTasksCount) << "today service called the loader once";
165+
EXPECT_EQ(size_t { 1 }, state->loadUnreadCountsCount) << "today service called the loader once";
166166

167167
try
168168
{

test/PegtlCombinedTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ using namespace tao::graphqlpeg;
1414

1515
TEST(PegtlCombinedCase, AnalyzeMixedGrammar)
1616
{
17-
ASSERT_EQ(size_t {}, analyze<mixed_document>(true))
17+
ASSERT_EQ(size_t { 0 }, analyze<mixed_document>(true))
1818
<< "there shouldn't be any infinite loops in the PEG version of the grammar";
1919
}

test/PegtlExecutableTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,6 @@ TEST(PegtlExecutableCase, ParseVariableDefaultEmptyList)
136136

137137
TEST(PegtlExecutableCase, AnalyzeExecutableGrammar)
138138
{
139-
ASSERT_EQ(size_t {}, analyze<executable_document>(true))
139+
ASSERT_EQ(size_t { 0 }, analyze<executable_document>(true))
140140
<< "there shouldn't be any infinite loops in the PEG version of the grammar";
141141
}

test/PegtlSchemaTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,6 @@ TEST(PegtlSchemaCase, ParseTodaySchema)
219219

220220
TEST(PegtlSchemaCase, AnalyzeSchemaGrammar)
221221
{
222-
ASSERT_EQ(size_t {}, analyze<schema_document>(true))
222+
ASSERT_EQ(size_t { 0 }, analyze<schema_document>(true))
223223
<< "there shouldn't be any infinite loops in the PEG version of the grammar";
224224
}

0 commit comments

Comments
 (0)