add cJSON-test.cpp

This commit is contained in:
pikastech 2022-06-02 16:34:30 +08:00
parent b0bb4e15d0
commit b016924634
3 changed files with 19 additions and 3 deletions

View File

@ -6,4 +6,4 @@ import json
class cJSON(TinyObj): class cJSON(TinyObj):
def __init__(self): ... def __init__(self): ...
def print(self) -> str: ... def print(self) -> str: ...
def parse(self, val: str) -> any: ... def parse(self, value: str) -> any: ...

View File

@ -1,8 +1,9 @@
#include "cJSON_cJSON.h" #include "cJSON_cJSON.h"
#include "cJSON.h"
void cJSON_cJSON___init__(PikaObj* self) {} void cJSON_cJSON___init__(PikaObj* self) {}
Arg* cJSON_cJSON_parse(PikaObj* self, char* val) { Arg* cJSON_cJSON_parse(PikaObj* self, char* value) {
return NULL; cJSON* cJSON_struct = cJSON_Parse(value);
} }
char* cJSON_cJSON_print(PikaObj* self) { char* cJSON_cJSON_print(PikaObj* self) {
return NULL; return NULL;

View File

@ -0,0 +1,15 @@
#include "gtest/gtest.h"
#include "test_common.h"
extern "C" {
#include "PikaMain.h"
#include "PikaParser.h"
#include "PikaStdLib_MemChecker.h"
#include "PikaVM.h"
#include "dataArgs.h"
#include "dataMemory.h"
#include "dataStrs.h"
#include "pikaScript.h"
#include "pika_config_gtest.h"
}
extern PikaMemInfo pikaMemInfo;