|
2 | 2 | /*
|
3 | 3 | testSetField unit test
|
4 | 4 |
|
5 |
| - Unit Test for the writeFields and setField functions in the ThingSpeak Communication Library for Arduino along with setTwitter, setStatus and setCreatedAt functionalities. |
| 5 | + Unit Test for the writeFields and setField functions in the ThingSpeak Communication Library for Arduino along with setStatus and setCreatedAt functionalities. |
6 | 6 |
|
7 | 7 | This test use the ArduinoUnit 2.1.0 unit test framework. Visit https://github.com/mmurdoch/arduinounit to learn more.
|
8 | 8 |
|
|
16 | 16 |
|
17 | 17 | For licensing information, see the accompanying license file.
|
18 | 18 |
|
19 |
| - Copyright 2020, The MathWorks, Inc. |
| 19 | + Copyright 2020-2025, The MathWorks, Inc. |
20 | 20 | */
|
21 | 21 |
|
22 | 22 | //#define USE_WIFI101_SHIELD
|
@@ -269,47 +269,6 @@ test(setFieldCase)
|
269 | 269 | assertEqual(TS_OK_SUCCESS,ThingSpeak.writeFields(testChannelNumber, testChannelWriteAPIKey));
|
270 | 270 | }
|
271 | 271 |
|
272 |
| - /* This test case checks for the following: |
273 |
| - - emptry string values (String class and const char *) |
274 |
| - - twitter handle and tweet character limits via String (positive and negative cases) |
275 |
| - */ |
276 |
| - test(setTwitterTweetCase) |
277 |
| - { |
278 |
| - const char * constChar_twitter = ""; |
279 |
| - String string_twitter = ""; |
280 |
| - // Always wait to ensure that rate limit isn't hit |
281 |
| - delay(WRITE_DELAY_FOR_THINGSPEAK); |
282 |
| - |
283 |
| - // Test empty string |
284 |
| - assertEqual(TS_OK_SUCCESS, ThingSpeak.setTwitterTweet(string_twitter, string_twitter)); // First argument is the twitter handle, second argument is the tweet |
285 |
| - assertEqual(TS_OK_SUCCESS, ThingSpeak.setTwitterTweet(constChar_twitter, constChar_twitter)); // First argument is the twitter handle, second argument is the tweet |
286 |
| - |
287 |
| - unsigned int numChar = 256; |
288 |
| - String longTwitter; |
289 |
| - longTwitter.reserve(numChar); |
290 |
| - |
291 |
| - String normalTwitter = "normalString"; |
292 |
| - |
293 |
| - // Test twitter character limits |
294 |
| - for(unsigned int i = 0; i < 255; i++) |
295 |
| - { |
296 |
| - longTwitter += '0'; |
297 |
| - } |
298 |
| - |
299 |
| - // longTwitter will have 256 '0' characters, since the number of characters ThingSpeak status can store is limited to 256 characters. |
300 |
| - |
301 |
| - assertEqual(TS_OK_SUCCESS, ThingSpeak.setTwitterTweet(longTwitter, normalTwitter)); // First argument is the twitter handle, second argument is the tweet |
302 |
| - assertEqual(TS_OK_SUCCESS, ThingSpeak.setTwitterTweet(normalTwitter, longTwitter)); // First argument is the twitter handle, second argument is the tweet |
303 |
| - |
304 |
| - longTwitter += '0'; |
305 |
| - |
306 |
| - // longTwitter will now have 257 '0' characters. Out of range error. |
307 |
| - |
308 |
| - assertEqual(TS_ERR_OUT_OF_RANGE, ThingSpeak.setTwitterTweet(longTwitter, normalTwitter)); // First argument is the twitter handle, second argument is the tweet |
309 |
| - assertEqual(TS_ERR_OUT_OF_RANGE, ThingSpeak.setTwitterTweet(normalTwitter, longTwitter)); // First argument is the twitter handle, second argument is the tweet |
310 |
| - |
311 |
| - assertEqual(TS_OK_SUCCESS,ThingSpeak.writeFields(testChannelNumber, testChannelWriteAPIKey)); |
312 |
| - } |
313 | 272 |
|
314 | 273 | /* This test case checks for the following:
|
315 | 274 | - emptry string values (String class and const char *)
|
|
0 commit comments