yjson: debug error format object, add check NULL before free
This commit is contained in:
1 parent
c0e610641f
commit
fe3a0cf11e
2 files changed
+38
-3
No files matched your search
@@ -500,6 +500,18 @@ printf("\n##############################################\n");
|
||||
|
||||
}
|
||||
|
||||
TEST(errorFormat){
|
||||
char *val1="{ \"hey\" }";
|
||||
struct js_value *js = create_js_value(val1, NULL);
|
||||
|
||||
EXPECT_EQ(js==NULL,1);
|
||||
char *val2="{ \"hey }";
|
||||
js = create_js_value(val2, NULL);
|
||||
EXPECT_EQ(js==NULL,1);
|
||||
char *val3="{ 123 }";
|
||||
js = create_js_value(val3, NULL);
|
||||
EXPECT_EQ(js==NULL,1);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv){
|
||||
|
||||
|
||||
Reference in new issue
Block a user