hydrobyte / McJSON

A Delphi / Lazarus / C++Builder simple and small class for fast JSON parsing.
MIT License
58 stars 20 forks source link

PrjTestMcJSON - many exception #6

Closed totyaxy closed 1 year ago

totyaxy commented 1 year ago

Hi!

With release mode, the result is: "6 test failed"

With debug mode, I got many exceptions...

Lazarus 2.2.4 x64 official on Windows x64

hydrobyte commented 1 year ago

Hi!

I'm not able to reproduce these errors with Lazarus version 2.3.0.

Could you show more details about why these tests failed and what kind of exceptions (lines and description) did you find with the Debug mode?

Also, could you find in Lazarus 2.2.4 release notes what kind of improvement was done in 2.3.0 that explains these differences?

Regards,

Marcelo.

totyaxy commented 1 year ago

Okay, but in first time please correct it the "PrjTestMcJSON.lpr" code, because if I started it, I got an empty form.

I do it already, but now I updated via svn, and I got the default state again. Please fix the code so it can be run, then I can test it for you.

hydrobyte commented 1 year ago

Hi,

Could you test today's update? I've tested with Lazarus 2.2.0 and it has worked fine.

Note: use the .lpi file that was added.

Also, check if your Decimal Separator is "." within Windows' Region configuration.

Regards,

Marcelo

totyaxy commented 1 year ago

Hi,

Now I can run this test without any problem.

Decimal separator is "," in my country. This library doesn't work correctly with ',' separator?

For the test with "," spearator:

[PASS] Test 01: parse simple object [PASS] Test 02: parse simple array [PASS] Test 03: parse simple sub object array [PASS] Test 04: simple object value change [PASS] Test 05: Add, Insert, Delete functions [PASS] Test 06: object is nil Error: Invalid index: get item by index 3 [PASS] Test 07: getters and setters [FAIL] Test 08: numbers: scientific notation Error: Can't convert item "number" with value "-1.23456789E-10" to "double" [PASS] Test 09: escapes [PASS] Test 10: invalid JSON [PASS] Test 11: valid or unusual JSON [FAIL] Test 12: type transformations [FAIL] Test 13: Save and Load using files [PASS] Test 14: constructors [PASS] Test 15: Copy, Clone, IsEqual, Remove functions [PASS] Test 16: exceptions Error: Object reference is nil: get item by key "not" Error: Object reference is nil: get item by key "not" Error: Object reference is nil: get item by index 1 Error: Invalid item type: expected "object" got "value" Error: Can't convert item "string" with value "123a" to "integer" Error: Can't convert item "null" to "integer" Error: Error while parsing text: "duplicated key k" at pos "14" [PASS] Test 17: enumerators [FAIL] Test 18: example like JsonDataObjects [PASS] Test 19: At() shortener for array item access [PASS] Test 20: key paths [FAIL] Test: Github readme.md content Error: Error while parsing text: "expected : got 3" at pos "48"

5 tests FAILED

With "." separator:

[PASS] Test 01: parse simple object [PASS] Test 02: parse simple array [PASS] Test 03: parse simple sub object array [PASS] Test 04: simple object value change [PASS] Test 05: Add, Insert, Delete functions [PASS] Test 06: object is nil Error: Invalid index: get item by index 3 [PASS] Test 07: getters and setters [PASS] Test 08: numbers: scientific notation [PASS] Test 09: escapes [PASS] Test 10: invalid JSON [PASS] Test 11: valid or unusual JSON [PASS] Test 12: type transformations [FAIL] Test 13: Save and Load using files [PASS] Test 14: constructors [PASS] Test 15: Copy, Clone, IsEqual, Remove functions [PASS] Test 16: exceptions Error: Object reference is nil: get item by key "not" Error: Object reference is nil: get item by key "not" Error: Object reference is nil: get item by index 1 Error: Invalid item type: expected "object" got "value" Error: Can't convert item "string" with value "123a" to "integer" Error: Can't convert item "null" to "integer" Error: Error while parsing text: "duplicated key k" at pos "14" [PASS] Test 17: enumerators [PASS] Test 18: example like JsonDataObjects [PASS] Test 19: At() shortener for array item access [PASS] Test 20: key paths [PASS] Test: Github readme.md content

1 tests FAILED

Thanks!

hydrobyte commented 1 year ago

Hi,

OK, I'll try to improve it, but region awareness was not an original requirement.

In mean while, try to improve and send a pull request.

Best.