2626#include <parse.h>
2727#include <time.h>
2828
29- #include "json .h"
29+ #include "simplejson .h"
3030
3131int totalTests = 0 ;
3232int successfullTests = 0 ;
@@ -95,8 +95,8 @@ static void pushCallback(ParseClient client, int error, const char *buffer) {
9595 char id [16 ] = {0 };
9696 char orig [16 ] = {0 };
9797 snprintf (orig , sizeof (orig ), "%ld" , run );
98- if (simpleJson (buffer , "data" , data , sizeof (data ))) {
99- if (simpleJson (data , "id" , id , sizeof (id ))) {
98+ if (simpleJsonProcessor (buffer , "data" , data , sizeof (data ))) {
99+ if (simpleJsonProcessor (data , "id" , id , sizeof (id ))) {
100100 if (strncmp (id , orig , sizeof (id )) == 0 ) {
101101 pushCounter ++ ;
102102 }
@@ -120,7 +120,6 @@ int main(int argc, char *argv[]) {
120120
121121
122122 // TEST INITIALIZATION
123-
124123 ParseClient client = parseInitialize (YOUR_APP_IP , YOUR_CLIENT_KEY );
125124 logResults (client != NULL , 1 , "parseInitialize call" , "failed to start parse" );
126125
@@ -144,7 +143,7 @@ int main(int argc, char *argv[]) {
144143 parseSendRequest (client , "POST" , classPathOne , "{\"test\":\"object1\", \"value\":1}" , callback );
145144 logResults (cachedRunResult != NULL , 0 , "create test object 1" , "creating object failed" );
146145 memset (objectId , 0 , sizeof (objectId ));
147- logResults (simpleJson (cachedRunResult , "objectId" , objectId , sizeof (objectId )), 0 , "object 1 created" , "could not create an object" );
146+ logResults (simpleJsonProcessor (cachedRunResult , "objectId" , objectId , sizeof (objectId )), 0 , "object 1 created" , "could not create an object" );
148147
149148 clearCachedResults ();
150149
@@ -158,7 +157,7 @@ int main(int argc, char *argv[]) {
158157 parseSendRequest (client , "POST" , classPathOne , "{\"test\":\"object1\", \"value\":2}" , callback );
159158 logResults (cachedRunResult != NULL , 0 , "create test object 2" , "creating object failed" );
160159 memset (objectId , 0 , sizeof (objectId ));
161- logResults (simpleJson (cachedRunResult , "objectId" , objectId , sizeof (objectId )), 0 , "object 2 created" , "could not create an object" );
160+ logResults (simpleJsonProcessor (cachedRunResult , "objectId" , objectId , sizeof (objectId )), 0 , "object 2 created" , "could not create an object" );
162161
163162 clearCachedResults ();
164163
@@ -172,7 +171,7 @@ int main(int argc, char *argv[]) {
172171 parseSendRequest (client , "POST" , classPathOne , "{\"test\":\"object1\", \"value\":3}" , callback );
173172 logResults (cachedRunResult != NULL , 0 , "create test object 3" , "creating object failed" );
174173 char objectIdKeepAround [11 ] = {0 };
175- logResults (simpleJson (cachedRunResult , "objectId" , objectIdKeepAround , sizeof (objectIdKeepAround )), 0 , "object 3 created" , "could not create an object" );
174+ logResults (simpleJsonProcessor (cachedRunResult , "objectId" , objectIdKeepAround , sizeof (objectIdKeepAround )), 0 , "object 3 created" , "could not create an object" );
176175
177176 clearCachedResults ();
178177
@@ -186,7 +185,7 @@ int main(int argc, char *argv[]) {
186185 parseSendRequest (client , "POST" , classPathOne , "{\"test\":\"object1\", \"value\":2}" , callback );
187186 logResults (cachedRunResult != NULL , 0 , "create test object 4" , "creating object failed" );
188187 memset (objectId , 0 , sizeof (objectId ));
189- logResults (simpleJson (cachedRunResult , "objectId" , objectId , sizeof (objectId )), 0 , "object 4 created" , "could not create an object" );
188+ logResults (simpleJsonProcessor (cachedRunResult , "objectId" , objectId , sizeof (objectId )), 0 , "object 4 created" , "could not create an object" );
190189
191190 clearCachedResults ();
192191
0 commit comments