Skip to content

Commit 73ab8c8

Browse files
author
Vinod Cherian
committed
Remove unit test related to Twitter functions
1 parent 67fa859 commit 73ab8c8

File tree

3 files changed

+4
-45
lines changed

3 files changed

+4
-45
lines changed

extras/test/testSetFunctions/testSetFunctions.ino

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
testSetField unit test
44
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.
66
77
This test use the ArduinoUnit 2.1.0 unit test framework. Visit https://github.com/mmurdoch/arduinounit to learn more.
88
@@ -16,7 +16,7 @@
1616
1717
For licensing information, see the accompanying license file.
1818
19-
Copyright 2020, The MathWorks, Inc.
19+
Copyright 2020-2025, The MathWorks, Inc.
2020
*/
2121

2222
//#define USE_WIFI101_SHIELD
@@ -269,47 +269,6 @@ test(setFieldCase)
269269
assertEqual(TS_OK_SUCCESS,ThingSpeak.writeFields(testChannelNumber, testChannelWriteAPIKey));
270270
}
271271

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-
}
313272

314273
/* This test case checks for the following:
315274
- emptry string values (String class and const char *)

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ThingSpeak
2-
version=2.1.0
2+
version=2.1.1
33
author=MathWorks <[email protected]>
44
maintainer=MathWorks <[email protected]>
55
sentence=ThingSpeak Communication Library for Arduino, ESP8266 & EPS32

src/ThingSpeak.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#ifndef ThingSpeak_h
1919
#define ThingSpeak_h
2020

21-
#define TS_VER "2.1.0"
21+
#define TS_VER "2.1.1"
2222

2323
#include "Arduino.h"
2424
#include <Client.h>

0 commit comments

Comments
 (0)