@@ -123,6 +123,7 @@ SUITE(oauth1_tests)
123
123
124
124
#undef TEST_ACCESSOR
125
125
126
+ // clang-format off
126
127
TEST_FIXTURE (oauth1_token_setup, oauth1_signature_base_string)
127
128
{
128
129
// Basic base string generation.
@@ -137,9 +138,9 @@ SUITE(oauth1_tests)
137
138
138
139
utility::string_t base_string = m_oauth1_config._build_signature_base_string (r, state);
139
140
utility::string_t correct_base_string (
140
- U (" POST&http%3A%2F%2Fexample.com%2Frequest&a%3Db%26c%3Dd%26oauth_consumer_key%3Dtest_key%26oauth_nonce%"
141
- " 3DABCDEFGH%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D12345678%26oauth_token%3Dtest_"
142
- " token%26oauth_version%3D1.0" ));
141
+ U (" POST&http%3A%2F%2Fexample.com%2Frequest&a%3Db%26c%3Dd%26oauth_consumer_key%3Dtest_key%26oauth_nonce%" )
142
+ U ( " 3DABCDEFGH%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D12345678%26oauth_token%3Dtest_" )
143
+ U ( " token%26oauth_version%3D1.0" ));
143
144
VERIFY_ARE_EQUAL (correct_base_string, base_string);
144
145
}
145
146
@@ -155,9 +156,9 @@ SUITE(oauth1_tests)
155
156
156
157
utility::string_t base_string = m_oauth1_config._build_signature_base_string (r, state);
157
158
utility::string_t correct_base_string (
158
- U (" POST&http%3A%2F%2Fexample.com%2Frequest&a%3Db%26c%3Dd%26oauth_consumer_key%3Dtest_key%26oauth_nonce%"
159
- " 3DABCDEFGH%26oauth_signature_method%3DHMAC-SHA1%26oauth_test%3Dxyzzy%26oauth_timestamp%3D12345678%"
160
- " 26oauth_token%3Dtest_token%26oauth_version%3D1.0" ));
159
+ U (" POST&http%3A%2F%2Fexample.com%2Frequest&a%3Db%26c%3Dd%26oauth_consumer_key%3Dtest_key%26oauth_nonce%" )
160
+ U ( " 3DABCDEFGH%26oauth_signature_method%3DHMAC-SHA1%26oauth_test%3Dxyzzy%26oauth_timestamp%3D12345678%" )
161
+ U ( " 26oauth_token%3Dtest_token%26oauth_version%3D1.0" ));
161
162
VERIFY_ARE_EQUAL (correct_base_string, base_string);
162
163
}
163
164
@@ -173,9 +174,9 @@ SUITE(oauth1_tests)
173
174
174
175
utility::string_t base_string = m_oauth1_config._build_signature_base_string (r, state);
175
176
utility::string_t correct_base_string (
176
- U (" POST&http%3A%2F%2Fexample.com%2Frequest&a%3Db%26c%3Dd%26MyVariableOne%3DValueOne%26%26MyVariableTwo%"
177
- " 3DValueTwo%26oauth_consumer_key%3Dtest_key%26oauth_nonce%3DABCDEFGH%26oauth_signature_method%3DHMAC-"
178
- " SHA1%26oauth_timestamp%3D12345678%26oauth_token%3Dtest_token%26oauth_version%3D1.0" ));
177
+ U (" POST&http%3A%2F%2Fexample.com%2Frequest&a%3Db%26c%3Dd%26MyVariableOne%3DValueOne%26%26MyVariableTwo%" )
178
+ U ( " 3DValueTwo%26oauth_consumer_key%3Dtest_key%26oauth_nonce%3DABCDEFGH%26oauth_signature_method%3DHMAC-" )
179
+ U ( " SHA1%26oauth_timestamp%3D12345678%26oauth_token%3Dtest_token%26oauth_version%3D1.0" ));
179
180
}
180
181
}
181
182
@@ -214,8 +215,8 @@ SUITE(oauth1_tests)
214
215
m_server.server ()->next_request ().then ([](test_request* request) {
215
216
const utility::string_t header_authorization (request->m_headers [header_names::authorization]);
216
217
const utility::string_t prefix (
217
- U (" OAuth oauth_version=\" 1.0\" , oauth_consumer_key=\" test_key\" , oauth_token=\" test_token\" , "
218
- " oauth_signature_method=\" HMAC-SHA1\" , oauth_timestamp=\" " ));
218
+ U (" OAuth oauth_version=\" 1.0\" , oauth_consumer_key=\" test_key\" , oauth_token=\" test_token\" , " )
219
+ U ( " oauth_signature_method=\" HMAC-SHA1\" , oauth_timestamp=\" " ));
219
220
VERIFY_ARE_EQUAL (0 , header_authorization.find (prefix));
220
221
request->reply (status_codes::OK);
221
222
});
@@ -237,8 +238,8 @@ SUITE(oauth1_tests)
237
238
m_server.server ()->next_request ().then ([](test_request* request) {
238
239
const utility::string_t header_authorization (request->m_headers [header_names::authorization]);
239
240
const utility::string_t prefix (
240
- U (" OAuth oauth_version=\" 1.0\" , oauth_consumer_key=\" test_key\" , oauth_token=\" test_token\" , "
241
- " oauth_signature_method=\" PLAINTEXT\" , oauth_timestamp=\" " ));
241
+ U (" OAuth oauth_version=\" 1.0\" , oauth_consumer_key=\" test_key\" , oauth_token=\" test_token\" , " )
242
+ U ( " oauth_signature_method=\" PLAINTEXT\" , oauth_timestamp=\" " ));
242
243
VERIFY_ARE_EQUAL (0 , header_authorization.find (prefix));
243
244
request->reply (status_codes::OK);
244
245
});
@@ -254,8 +255,8 @@ SUITE(oauth1_tests)
254
255
const utility::string_t header_authorization (request->m_headers [header_names::authorization]);
255
256
256
257
// Verify prefix, and without 'oauth_token'.
257
- const utility::string_t prefix (U (" OAuth oauth_version=\" 1.0\" , oauth_consumer_key=\" test_key\" , "
258
- " oauth_signature_method=\" HMAC-SHA1\" , oauth_timestamp=\" " ));
258
+ const utility::string_t prefix (U (" OAuth oauth_version=\" 1.0\" , oauth_consumer_key=\" test_key\" , " )
259
+ U ( " oauth_signature_method=\" HMAC-SHA1\" , oauth_timestamp=\" " ));
259
260
VERIFY_ARE_EQUAL (0 , header_authorization.find (prefix));
260
261
261
262
// Verify suffix with proper 'oauth_callback'.
@@ -285,8 +286,8 @@ SUITE(oauth1_tests)
285
286
286
287
// Verify temporary token prefix.
287
288
const utility::string_t prefix (
288
- U (" OAuth oauth_version=\" 1.0\" , oauth_consumer_key=\" test_key\" , oauth_token=\" xyzzy\" , "
289
- " oauth_signature_method=\" HMAC-SHA1\" , oauth_timestamp=\" " ));
289
+ U (" OAuth oauth_version=\" 1.0\" , oauth_consumer_key=\" test_key\" , oauth_token=\" xyzzy\" , " )
290
+ U ( " oauth_signature_method=\" HMAC-SHA1\" , oauth_timestamp=\" " ));
290
291
VERIFY_ARE_EQUAL (0 , header_authorization.find (prefix));
291
292
292
293
// Verify suffix with 'oauth_verifier'.
@@ -313,6 +314,8 @@ SUITE(oauth1_tests)
313
314
VERIFY_ARE_EQUAL (m_oauth1_config.token ().secret (), U (" bar" ));
314
315
}
315
316
317
+ // clang-format on
318
+
316
319
} // SUITE(oauth1_tests)
317
320
318
321
} // namespace client
0 commit comments