Skip to content

Commit b93c087

Browse files
committed
Add more tests cases using libcurl
1 parent 9e420fe commit b93c087

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tests/0014-http-posts.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define INVALID_UUID "/abcdefg"
2323

2424
// It should returns 200 when UUID, TOPIC and MESSAGE are valids
25-
static void test_valid_POST() {
25+
static void Test_Valid_POST() {
2626
CURL *curl;
2727
CURLcode res;
2828
long http_code = 0;
@@ -52,7 +52,7 @@ static void test_valid_POST() {
5252
}
5353

5454
// It should returns 401 when UUID is not valid
55-
static void test_invalid_UUID() {
55+
static void Test_Invalid_UUID() {
5656
CURL *curl;
5757
CURLcode res;
5858
long http_code = 0;
@@ -82,7 +82,7 @@ static void test_invalid_UUID() {
8282
}
8383

8484
// It should returns 403 when Topic is not valid
85-
static void test_invalid_topic() {
85+
static void Test_Invalid_Topic() {
8686
CURL *curl;
8787
CURLcode res;
8888
long http_code = 0;
@@ -111,7 +111,7 @@ static void test_invalid_topic() {
111111
free(url);
112112
}
113113

114-
static void test_no_topic() {
114+
static void Test_No_Topic() {
115115
CURL *curl;
116116
CURLcode res;
117117
long http_code = 0;
@@ -139,7 +139,7 @@ static void test_no_topic() {
139139
free(url);
140140
}
141141

142-
static void test_empty_body() {
142+
static void Test_Empty_Body() {
143143
CURL *curl;
144144
CURLcode res;
145145
long http_code = 0;
@@ -169,7 +169,7 @@ static void test_empty_body() {
169169
}
170170

171171
// It should returns 403 when Topic is not valid
172-
static void test_invalid_URL() {
172+
static void Test_Invalid_URL() {
173173
CURL *curl;
174174
CURLcode res;
175175
long http_code = 0;
@@ -199,7 +199,7 @@ static void test_invalid_URL() {
199199
}
200200

201201
// It should returns 403 when Topic is not valid
202-
static void test_deflate() {
202+
static void Test_Deflate() {
203203
z_stream defstream;
204204
defstream.zalloc = Z_NULL;
205205
defstream.zfree = Z_NULL;
@@ -278,10 +278,10 @@ int main() {
278278
sleep(1);
279279

280280
const struct CMUnitTest tests[] = {
281-
cmocka_unit_test(test_valid_POST), cmocka_unit_test(test_invalid_UUID),
282-
cmocka_unit_test(test_invalid_topic), cmocka_unit_test(test_no_topic),
283-
cmocka_unit_test(test_invalid_URL), cmocka_unit_test(test_deflate),
284-
cmocka_unit_test(test_empty_body)};
281+
cmocka_unit_test(Test_Valid_POST), cmocka_unit_test(Test_Invalid_UUID),
282+
cmocka_unit_test(Test_Invalid_Topic), cmocka_unit_test(Test_No_Topic),
283+
cmocka_unit_test(Test_Invalid_URL), cmocka_unit_test(Test_Deflate),
284+
cmocka_unit_test(Test_Empty_Body)};
285285
const int res = cmocka_run_group_tests(tests, NULL, NULL);
286286

287287
curl_global_cleanup();

0 commit comments

Comments
 (0)