156 Commits
Author SHA1 Message Date
Anatolii Sakhnik 7e02d41e23 Adjust version to 2.9.1
:Release Notes:
Increase version to 2.9.1

:Detailed Notes:

:Testing Performed:
Build and unit tests

:QA Notes:

:Issues Addressed:
[BHV-12121] SmartShare application doesn't support -1/2x rewind

Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>

Change-Id: I3cd55c59625f82aae445e247708b73128433b5c5
submissions/39 versions/2.9.1
2014-08-04 16:49:20 +03:00
Anatolii Sakhnik e80704d2f1 Fix number parsing in range (-1, 0)
:Release Notes:
Fix parsing negative fractional numbers with zero whole part.

:Detailed Notes:
Proprietary number parsing algorithm is buggy. Whole part was used to
carry sign to the fractional part. If the whole part is zero, the
information about the sign was lost.

:Testing Performed:
Unit tests.

:QA Notes:

:Issues Addressed:
[BHV-12121] SmartShare application doesn't have support for -1/2x rewind

Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>

Change-Id: I6002daa31d1132c26df4bccefa4d11072305b0ab
Reviewed-on: https://g2g.palm.com/6371
Reviewed-by: DCO Verification
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Oleksii Rudenko <oleksii.rudenko@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-08-04 06:36:33 -07:00
Andrii Zora 6927da3918 Merge branch 'develop'
Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>
versions/2.9.0 submissions/38
2014-06-10 14:38:32 +03:00
Andrii Zora 2dea7526a9 Version bump to 2.9.0
:Release Notes:

:Detailed Notes:

:Testing Performed:
unit tests

:QA Notes:

:Issues Addressed:

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: I1646c228dcdd7c9bb96be8b1aa0a0ec5511918a9
Reviewed-on: https://g2g.palm.com/5949
Reviewed-by: DCO Verification
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Sergiy Kryvonos <sergiy.kryvonos@lge.com>
submissions/37
2014-06-10 03:55:22 -07:00
Andrii Zora 0224018b14 get rid of Resource class
:Release Notes:
remove redundant Resource in JSchema

:Detailed Notes:
Resource reference counter caused concurrency bug

:Testing Performed:
unit tests

:QA Notes:

:Issues Addressed:
[BHV-9935] pbnjson resources reference counting is not thread-safe

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: I3acd5bc92e1697da4b69ffee7202baf11f853bbb
Reviewed-on: https://g2g.palm.com/5917
Reviewed-by: DCO Verification
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-06-10 02:30:03 -07:00
Andrii Zora 8224ff2aee fix resolving in cross referenced schemas
:Release Notes:
fix resolving in cross referenced schemas

:Detailed Notes:
fix resolving,
add sufficient tests

:Testing Performed:
unit tests

:QA Notes:

:Issues Addressed:
[BHV-9511] libpbnjson: fix resolving in cross referenced schemas

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: Id8c9e2831b3465b937dd9be7a57cf300ab7d00af
Reviewed-on: https://g2g.palm.com/5911
Reviewed-by: DCO Verification
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-06-10 02:23:33 -07:00
Andrii Zora a1885609f7 Merge develop branch into master
:Release Notes:

:Detailed Notes:

:Testing Performed:
unit tests

:QA Notes:

:Issues Addressed:

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: I3b8cdeee5d4cb07fac76f87939f87a8ec8b947a8
versions/2.8.0 submissions/36
2014-05-30 14:17:04 +03:00
Andrii Zora ed5a782860 Version bump to 2.8.0
:Release Notes:

:Detailed Notes:

:Testing Performed:
unit tests

:QA Notes:

:Issues Addressed:

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: I7bdbabd3bb2c668b6266775ce716e383966ce4a8
Reviewed-on: https://g2g.palm.com/5856
Reviewed-by: DCO Verification
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-05-30 03:43:17 -07:00
Andrii Zora b10a7d3045 Fix local URI resolution
:Release Notes:
Fix local URI resolution

:Detailed Notes:
fix root_scope when parsing schema from the file
fix local URI resolution in referenced file

:Testing Performed:
unit tests

:QA Notes:

:Issues Addressed:
[BHV-1568] [api] Fix local URI resolution

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: I59c095e64026a9c3000ecc9e7c27c86b4d4e6857
Reviewed-on: https://g2g.palm.com/5801
Reviewed-by: DCO Verification
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-05-30 02:49:07 -07:00
Nikolay Orliuk 5c3db70d95 drop fragments stack
:Release Notes:

:Detailed Notes:
- removed unused stack of fragments with associated tests
- escape_json_pointer changed to work with non-ASCIIz strings
- fixed compiler/gcc/builtins.h to be able included alone without others
- factored out uri_scope_get_uri_unsafe as access to top of uri_scope
  with expectation that it present

:Testing Performed:
unit tests under desktop

:QA Notes:

:Issues Addressed:
[BHV-8631] libpbnjson: fix 'oneOf' behaviour for fragments without id's

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>

Change-Id: Ic9256d8388b3ab35fd4b588cadb6c59864302570
Reviewed-on: https://g2g.palm.com/5797
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-05-29 03:56:55 -07:00
Nikolay Orliuk bf922af4d0 fix bug caused a schema id collision
:Release Notes:
Fix message "The same fragment XXX is added second time!" reported
during oneOf/anyOf/allOf schemas parsing. Fix for refs in definitions.

:Detailed Notes:
- put assert for fragment duplication check to track such issues
- factor out collect_schema from collect_uri_enter to grab more control
  over process of traversing
- cleaned out address calculation for non-addressable elements
- collect definitions with ref-schema
- add tests for definitions with ref-schema

:Testing Performed:
unit tests under desktop build

:QA Notes:

:Issues Addressed:
[BHV-8631] libpbnjson: fix 'oneOf' behaviour for fragments without id's

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>

Change-Id: If92cef529bb7f24b94c5d547fa664f2418595b41
Reviewed-on: https://g2g.palm.com/5766
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-05-27 08:36:09 -07:00
Alekseyev Oleksandr 6f703a11e3 Provide mechanism to add default values to jvalue
:Release Notes:
Add functional to insert default values to existing jvalues
Default values are defined in schema

:Detailed Notes:

:Testing Performed:
Unit tests + MiniBat

:QA Notes:

:Issues Addressed:
[BHV-3142] Provide possibility to fill-up default values in jvalue according to schema

Open-webOS-DCO-1.0-Signed-off-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>

Change-Id: Idf7909ea2223e82b70354c902bb00be0edbd8c05
Reviewed-on: https://g2g.palm.com/5687
Reviewed-by: DCO Verification
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Tested-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Sergiy Kryvonos <sergiy.kryvonos@lge.com>
2014-05-22 03:03:25 -07:00
Andrii Zora 5a19d2ce6d Fix compatibility with 2.6 version of pbnjson
:Release Notes:
resolve external references in DomParser

:Detailed Notes:
add reference resolving to support the old interface

:Testing Performed:
unit tests, build

:QA Notes:

:Issues Addressed:
[BHV-1564] Resolve referred schemas right after parsing

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: Ia7b585c63bd271fcc8b0b2324eca2d78fdd84c86
Reviewed-on: https://g2g.palm.com/5664
Reviewed-by: DCO Verification
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
submissions/35
2014-05-16 06:17:27 -07:00
Andrii Zora 11b3b3631a Add compatibility with 2.6 version of pbnjson
:Release Notes:
add back compatibility

:Detailed Notes:
add deleted virtual methods, mark them deprecated
fix tests

:Testing Performed:
Unit tests, build starfish

:QA Notes:

:Issues Addressed:
[BHV-2621] Develop a command line tool to validate JSON against schema

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: Ib066f36d69db093bfc32f082cd6c72d133868941
Reviewed-on: https://g2g.palm.com/5614
Reviewed-by: DCO Verification
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
submissions/34
2014-05-12 08:14:53 -07:00
Andrii Zora 01debbf3f0 Merge branch bhv-2621-validator into master
:Release Notes:
Parse JSON to validate against a schema

:Detailed Notes:
Conflicts:
	include/public/pbnjson/cxx/JSchemaFile.h
	src/pbnjson_cxx/JSchemaFile.cpp

:Testing Performed:
Unit tests, starfish build

:QA Notes:

:Issues Addressed:
[BHV-2621] Develop a command line tool to validate JSON against schema

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: Id4f72f76496b03ace94b07e2de521b6893aa0f31
versions/2.7.0 submissions/33
2014-05-08 16:25:20 +03:00
Andrii Zora 0a214cf26c Resolve referred schemas right after parsing
:Release Notes:
Perform resolving references process right after the schema parsing

:Detailed Notes:
change the API
change unit tests

:Testing Performed:
Unit tests

:QA Notes:

:Issues Addressed:
[BHV-1564] Resolve referred schemas right after parsing

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: Id9012b319af14deb10819b8fb9435dc48841410e
Reviewed-on: https://g2g.palm.com/5426
Reviewed-by: DCO Verification
Reviewed-by: Sergiy Kryvonos <sergiy.kryvonos@lge.com>
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
2014-05-07 08:35:25 -07:00
Anatolii Sakhnik 95943929e1 Implement JSON validation in the pbnjson_validate
:Release Notes:
Parse JSON to validate against a schema

:Detailed Notes:

:Testing Performed:
Build succeeded, smoke test.

:QA Notes:

:Issues Addressed:
[BHV-2621] Develop a command line tool to validate JSON against schema

Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>

Change-Id: I0b74b95ffc3bd762459b60313e8eaca4f3cf327a
Reviewed-on: https://g2g.palm.com/5471
Reviewed-by: DCO Verification
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Tested-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
2014-05-07 06:45:04 -07:00
Anatolii Sakhnik d66e2ba06c Allow reporting schema parsing errors in C++
:Release Notes:
Allow specifying error callbacks for JSchemaFile.

:Detailed Notes:

:Testing Performed:
Build and unit tests

:QA Notes:

:Issues Addressed:
[BHV-2621] Develop a command line tool to validate JSON against schema

Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>

Change-Id: Id29a80c6bbfb719c66fa6274706e791fb5073e53
Reviewed-on: https://g2g.palm.com/5470
Reviewed-by: DCO Verification
Reviewed-by: Sergiy Kryvonos <sergiy.kryvonos@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Reviewed-by: Oleksii Rudenko <oleksii.rudenko@lge.com>
Tested-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
2014-05-07 06:44:37 -07:00
Anatolii Sakhnik 0b4cd67a8d Create skeleton for pbnjson_validate
:Release Notes:
Implement command line parsing.

:Detailed Notes:

:Testing Performed:
Build succeeded

:QA Notes:

:Issues Addressed:
[BHV-2621] Develop a command line tool to validate JSON against schema

Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>

Change-Id: I37a4fb455477843637dd850103d89a829a1d0e14
Reviewed-on: https://g2g.palm.com/5469
Reviewed-by: DCO Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Sergiy Kryvonos <sergiy.kryvonos@lge.com>
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
2014-04-30 08:40:37 -07:00
Alexandr Smoktal 4f2bce252c Add NO_LOGGING flag to disable logging
:Release Notes:
Add NO_LOGGING cmake flag to allow building
without any logging, to avoid PmLogLib dependency.

:Detailed Notes:

:Testing Performed:
Unit-tests.

:QA Notes:

:Issues Addressed:
[BHV-8] pbnjson: Refactor logging to use pmloglib

Open-webOS-DCO-1.0-Signed-off-by: Alexandr Smoktal <alexandr.smoktal@lge.com>

Change-Id: Ie034c50d6120ced7e5806df0ec1e8e126c38361e
Reviewed-on: https://g2g.palm.com/5177
Reviewed-by: DCO Verification
Reviewed-by: Alexandr Smoktal <alexandr.smoktal@lge.com>
Tested-by: Alexandr Smoktal <alexandr.smoktal@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
versions/2.6.0 submissions/32
2014-04-08 08:25:05 -07:00
Andrii Zora 23e96d0a15 Provide JSON value type in C++ API
:Release Notes:
Provide getType() method for JSON value.

:Detailed Notes:
Add getType() method to JValue class.
Add new method to unit tests.

:Testing Performed:
Unit tests

:QA Notes:

:Issues Addressed:
[BHV-36] pbnjson: Provide JSON value type in C++ API

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: Ib326b95df46d75bcd3d9647dbb4a29d6cf1ab3cc
Reviewed-on: https://g2g.palm.com/5224
Reviewed-by: DCO Verification
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-04-08 03:18:49 -07:00
Nikolay Orliuk 1164956c4a introduce schema building by traversing jvalue
:Release Notes:
New API to parse schema from jvalue.

:Detailed Notes:
- tie together jtraverse and jschema_builder
- expose schema builder and parsing callbacks in public API
- add unit-tests for parsing schema from jvalue

:Testing Performed:
unit-tests

:QA Notes:

:Issues Addressed:
[BHV-3085] Provide pbnjson API for schema construction from jvalue

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>

Change-Id: Ica96a9e7e6826487996e66e63785c49df2e6816c
Reviewed-on: https://g2g.palm.com/5145
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-04-07 05:51:29 -07:00
Nikolay Orliuk b1f6a6487f transform yajl callbacks to schema builder methods
:Release Notes:
Prepare code infrastructure to provide new API

:Detailed Notes:
- move yajl callbacks for schema parsing to schema_build.c as visitor
  methods
- drop mentioning of yajl
- TODO: expose schema builder and parsing callbacks in public API

:Testing Performed:
unit-tests

:QA Notes:

:Issues Addressed:
[BHV-3085] Provide pbnjson API for schema construction from jvalue

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>

Change-Id: I131e61a0848e62dc744abef3e280909e2798c58f
Reviewed-on: https://g2g.palm.com/5088
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-04-07 02:59:20 -07:00
Nikolay Orliuk f9b1ba9d84 factor out schema builder
:Release Notes:
Prepare code infrastructure to provide new API

:Detailed Notes:
- factored out builder
- TODO: drop mentioning of yajl
- TODO: expose schema builder and parsing callbacks in public API

:Testing Performed:
unit-tests

:QA Notes:

:Issues Addressed:
[BHV-3085] Provide pbnjson API for schema construction from jvalue

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>

Change-Id: I39e30dc9b39ae06d1dd53287a247f871eded7234
Reviewed-on: https://g2g.palm.com/5078
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-04-07 02:57:36 -07:00
Andrii Zora 0e81cdbad3 Factor out the mempool into its own source file
:Release Notes:
Extract the source code of the memory pool into its own file,
create unit tests for it.

:Detailed Notes:
Extract memory pool to parser_memory_pool.
Create unit tests TestParserMemPool.
Change size of the pool.

:Testing Performed:
Unit tests

:QA Notes:

:Issues Addressed:
[BHV-2369] pbnjson: Factor out the mempool into its own source file

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: I478c292522fbc319f7c8f1b14148b1986f78113a
Reviewed-on: https://g2g.palm.com/5203
Reviewed-by: DCO Verification
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Sergiy Kryvonos <sergiy.kryvonos@lge.com>
2014-04-03 06:21:12 -07:00
Alexandr Smoktal 58f314e3b6 fix PJ_LOG_DBG, logging stub and weak magic
:Release Notes:
Made test run successfully without linking with pmloglib

:Detailed Notes:
- Moved liblog.c to be compiled directly as a part of shared library.
  Otherwise unexplained segfault happens when it comes from shared
  library jvalue.
- Fixed usage and define of PJ_LOG_DBG macro.
- Fixed stub for _PmLogMsgKV

:Testing Performed:
Unit-tests.

:QA Notes:

:Issues Addressed:
[BHV-8] pbnjson: Refactor logging to use pmloglib

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>

Change-Id: I6ffc5c1af487b58db058665077622e70f2c9c008
Reviewed-on: https://g2g.palm.com/5174
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-04-01 06:08:18 -07:00
Alexandr Smoktal 2ae4cf6a4f Log using new pmloglib API
:Release Notes:
Changed to use new key-value pmloglib API.

:Detailed Notes:
To use PmLogLib key-value logging, user application can
be linked with PmLogLib library. This will enable logging
with PmLogLib automatically.

:Testing Performed:
Unit-tests. MiniBAT.

:QA Notes:

:Issues Addressed:
[BHV-8] pbnjson: Refactor logging to use pmloglib

Open-webOS-DCO-1.0-Signed-off-by: Alexandr Smoktal <alexandr.smoktal@lge.com>

Change-Id: Ie3a762963aa6cbe0be4731e7656736afaea7d4df
Reviewed-on: https://g2g.palm.com/4741
Reviewed-by: DCO Verification
Reviewed-by: Alexandr Smoktal <alexandr.smoktal@lge.com>
Tested-by: Alexandr Smoktal <alexandr.smoktal@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-03-28 08:09:55 -07:00
Andrii Zora 0b8a8365c4 unify jvalue traversal
:Release Notes:
Implement a generic jvalue traverse.
Refactor the code.

:Detailed Notes:
Implement a generic jvalue traverse.
Add yajl_dont_validate_strings for yajl-2.
Rid of dynamic memory allocation of validator.
Correct use of snprintf.
Make a little test modification of double type.

:Testing Performed:
Gtest

:QA Notes:

:Issues Addressed:
[BHV-1560] Unify jvalue traversal (used in jvalidation.c jparse_stream.c)

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: Iacb6417f9d4fff3f2ad90535d09410d7738c83c5
Reviewed-on: https://g2g.palm.com/5014
Reviewed-by: DCO Verification
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
submissions/31
2014-03-27 04:13:55 -07:00
Andrii Zora fdde77fa6a Improve performance in json stream parsing
:Release Notes:
Add yajl_dont_validate_strings for Yajl 2.
Custom simple memory pool.
Throughput measurement in MBps.
Add pool of dom parsers.

:Detailed Notes:
Add yajl_dont_validate_strings for Yajl 2.
Memory pool gives us a big win in performance.
Fix performance tests to measure the throughput in MB/s.
Some small improvements and code refactoring.

:Testing Performed:
gtest

:QA Notes:

:Issues Addressed:
[BHV-123] pbnjson: Improve performance of json parsing with YAJL

Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: Ic2b49103cf438c77e48f961258e9842fd84fb7d0
Reviewed-on: https://g2g.palm.com/4631
Reviewed-by: DCO Verification
Reviewed-by: Andrii Zora <andrii.zora@lge.com>
Tested-by: Andrii Zora <andrii.zora@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-03-14 02:38:59 -07:00
Nikolay Orliuk 6b138cbac1 allow comments in json
:Release Notes:
Now pbnjson doesn't report error on comments in json

:Detailed Notes:
- turned on flag allow_comments for yajl
- bumped version to 2.5.0 for proper dependencies from other components

:Testing Performed:
qemux86 build together with luna-service2 that uses pbnjson instead of
cjson

:QA Notes:

:Issues Addressed:
[BHV-2034] We need either support for comments in libpbnjson or role-files stripping

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>

Change-Id: I7836653e5bde58357104a5704b47911ddad432fc
Reviewed-on: https://g2g.palm.com/4911
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
submissions/30 versions/2.5.0
2014-03-12 08:10:01 -07:00
Nikolay Orliuk 450d04882c Avoid changing source folders
:Release Notes:
Now build process only changes build/binary folder.

:Detailed Notes:
- changed apply_lemon.sh to avoid generation of files inside of source
  folder
- added dependency on apply_lemon.sh for targets generated by it

:Testing Performed:
Desktop build

:QA Notes:

:Issues Addressed:
[BHV-123] pbnjson: Improve performance of json parsing with YAJL

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>

Change-Id: I7e0011d5202ce52af559a036b304d41bb3d34f63
Reviewed-on: https://g2g.palm.com/4862
Reviewed-by: DCO Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
2014-03-06 15:55:46 -08:00
Nikolay Orliuk f272e377cf C++ wrappers benchmark
:Release Notes:
Added tests for C++ wrappers

:Detailed Notes:
- benchmark JDomParse
- fix linkage for desktop build

:Testing Performed:
tests

:QA Notes:

:Issues Addressed:
[BHV-123] pbnjson: Improve performance of json parsing with YAJL

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>

Change-Id: Ic5ba5fcbb79962136d375facb25ccd4cdee867a7
Reviewed-on: https://g2g.palm.com/4539
Reviewed-by: DCO Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-03-06 09:44:13 -08:00
Nikolay Orliuk 809c4e3056 Enhance benchmarking
:Release Notes:
Better reproducibility of benchmarking tests

:Detailed Notes:
- process speedup by avoiding extra cycle if warmup already hit the
  measure_time
- tolerance to system load by using CPU usage time if available
- tolerance to spikes by using median instead of average

:Testing Performed:
gtest

:QA Notes:

:Issues Addressed:
[BHV-123] pbnjson: Improve performance of json parsing with YAJL

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Open-webOS-DCO-1.0-Signed-off-by: Andrii Zora <andrii.zora@lge.com>

Change-Id: I661407ce08ef807361cb481578674f845c18570e
Reviewed-on: https://g2g.palm.com/4540
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-03-06 09:23:56 -08:00
Mykola Kryvonos caa890f7cc Fix JSON schema 'required' keyword parsing
:Release Notes:
Added checking of duplicate and empty values for "required" keyword
during JSON Schema parsing

:Detailed Notes:

:Testing Performed:
Unit tests with memcheck

:QA Notes:

:Issues Addressed:
[ANG-1452] pbnjson: Ensure the property "required" isn't an empty array

Open-webOS-DCO-1.0-Signed-off-by: Mykola Kryvonos <mykola.kryvonos@lge.com>

Change-Id: Id6f5149c19106457593e738205a30d6b2cae0565
Reviewed-on: https://g2g.palm.com/4624
Reviewed-by: DCO Verification
Reviewed-by: Alexandr Smoktal <alexandr.smoktal@lge.com>
Tested-by: Alexandr Smoktal <alexandr.smoktal@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
submissions/29
2014-02-18 01:31:58 -08:00
Anatolii Sakhnik 37e300ba2f Fix potential memory leak in jobject_create_var()
:Release Notes:
jobject_create_var() should always iterate through all the arguments
even in case of early failure.

:Detailed Notes:

:Testing Performed:
Unit tests.

:QA Notes:

:Issues Addressed:
[ANG-552] pbnjson: jobject_create_var may fail with memory leak

Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>

Change-Id: Id7324a081695bfdbe626886ddad159414f9f874b
Reviewed-on: https://g2g.palm.com/4629
Reviewed-by: DCO Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
versions/2.4.0 submissions/28
2014-02-12 06:01:06 -08:00
Anatolii Sakhnik 4902eeb68b Fix minor issues detected by cppcheck
:Release Notes:
Fix too wide scope of local variables, useless initialization, and
other minor issues.

:Detailed Notes:

:Testing Performed:
Unit tests on desktop

:QA Notes:

:Issues Addressed:
[ANG-849] pbnjson: Investigate and fix issues found by cppcheck

Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>

Change-Id: I62f3e9981df73db2012dcbfaa1ede0fd4790776e
Reviewed-on: https://g2g.palm.com/4666
Reviewed-by: DCO Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
2014-02-12 05:55:11 -08:00
Anatolii Sakhnik c746278aca Remove obsolete SchemaExtensions.txt
:Release Notes:

:Detailed Notes:
SchemaExtensions.txt described peculiarities of the former
implementation. Current implementation carefully follows the
revision 4 of the JSON schema specification.

:Testing Performed:
Trivial change.

:QA Notes:

:Issues Addressed:
[ANG-263] pnbjson: Remove SchemaExtensions.txt

Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>

Change-Id: I4d8cb3f2cfa44f3ab48d6f44852f03b323f518e1
Reviewed-on: https://g2g.palm.com/4659
Reviewed-by: DCO Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Alexandr Smoktal <alexandr.smoktal@lge.com>
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
2014-02-12 04:49:33 -08:00
Alekseyev Oleksandr 178cb73bb7 Add stream sax/dom parsers
:Release Notes:
Add new json parsers with ablility to parse streams

:Detailed Notes:

:Testing Performed:
Unit tests

:QA Notes:

:Issues Addressed:
[ANG-304] pbnjson: Enhance SAX parser API to handle chunked input

Open-webOS-DCO-1.0-Signed-off-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>

Change-Id: If768889ce6097c8a3973c8b62b85172ebea54c5b
Reviewed-on: https://g2g.palm.com/4535
Reviewed-by: DCO Verification
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Tested-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-02-12 04:43:45 -08:00
Mykola Kryvonos 64c63d53ec Add 'pattern' keyword to JSON Schema
:Release Notes:
Implemented 'pattern' schema keyword for string validation

:Detailed Notes:

:Testing Performed:
Unit tests with memcheck

:QA Notes:

:Issues Addressed:
[ANG-341] pbnjson: Implement missing schema keywords

Open-webOS-DCO-1.0-Signed-off-by: Mykola Kryvonos <mykola.kryvonos@lge.com>

Change-Id: Ibd78d14f3824c6fe17d40b85ca758b6dad7c2785
Reviewed-on: https://g2g.palm.com/4627
Reviewed-by: DCO Verification
Reviewed-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Tested-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
versions/2.3.0 submissions/27
2014-02-06 04:28:28 -08:00
Mykola Kryvonos 33aed9b852 Add 'multipleOf' keyword to JSON Schema
:Release Notes:
Implemented 'multipleOf' schema keyword for numbers validation

:Detailed Notes:

:Testing Performed:
Unit tests with memcheck

:QA Notes:

:Issues Addressed:
[ANG-341] pbnjson: Implement missing schema keywords

Open-webOS-DCO-1.0-Signed-off-by: Mykola Kryvonos <mykola.kryvonos@lge.com>

Change-Id: I0894339cff060d034c2fb4cd6ce1905c9a41b2dd
Reviewed-on: https://g2g.palm.com/4626
Reviewed-by: DCO Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-02-06 04:14:24 -08:00
Mykola Kryvonos eaa9d380b9 Add 'not' keyword to JSON Schema
:Release Notes:
Implemented 'not' schema keyword

:Detailed Notes:

:Testing Performed:
Unit tests with memcheck

:QA Notes:

:Issues Addressed:
[ANG-341] pbnjson: Implement missing schema keywords

Open-webOS-DCO-1.0-Signed-off-by: Mykola Kryvonos <mykola.kryvonos@lge.com>

Change-Id: Ib5cff2099c51e641db348263202850aceb2a6edb
Reviewed-on: https://g2g.palm.com/4625
Reviewed-by: DCO Verification
Reviewed-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Tested-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-02-06 04:09:32 -08:00
Mykola Kryvonos e18c810fb5 Add error reporting during JSON Schema parsing
:Release Notes:
Implemented detailed error reporting during schema parsing.

:Detailed Notes:

:Testing Performed:
Unit tests with memcheck

:QA Notes:

:Issues Addressed:
[ANG-301] pbnjson: Provide more detailed error reporting during schema
          parsing

Open-webOS-DCO-1.0-Signed-off-by: Mykola Kryvonos <mykola.kryvonos@lge.com>

Change-Id: Icfaed82b422311dccc7882a56fc5d01d0d5661db
Reviewed-on: https://g2g.palm.com/4315
Reviewed-by: DCO Verification
Reviewed-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Tested-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-on: https://g2g.palm.com/4623
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-02-06 03:36:58 -08:00
Mykola Kryvonos 7917e68ad1 Fix error reporting during schema parsing
:Release Notes:
Fixed case when error occurred during schema parsing but schema was
parsed entirely.

:Detailed Notes:

:Testing Performed:
Unit tests with memcheck

:QA Notes:

:Issues Addressed:
[ANG-301] pbnjson: Provide more detailed error reporting during schema
          parsing

Open-webOS-DCO-1.0-Signed-off-by: Mykola Kryvonos <mykola.kryvonos@lge.com>

Change-Id: I445eac21a18bed371d27788bc634a344cc150ab7
Reviewed-on: https://g2g.palm.com/4306
Reviewed-by: DCO Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Tested-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Reviewed-on: https://g2g.palm.com/4622
2014-02-06 03:31:36 -08:00
Mykola Kryvonos 9430e47af7 Fix 'integer' type restrictions in JSON Schema
:Release Notes:
Fixed 'integer' type restrictions if number related properties (ex.
'maximum') are provided in JSON Schema

:Detailed Notes:

:Testing Performed:
Unit tests with memcheck.

:QA Notes:

:Issues Addressed:
[ANG-302] pbnjson: 'integer' type restriction doesn't work if number
          properties are provided

Open-webOS-DCO-1.0-Signed-off-by: Mykola Kryvonos <mykola.kryvonos@lge.com>

Change-Id: Id34508a6d9264dc10fe98df470358cf82b85271a
Reviewed-on: https://g2g.palm.com/4277
Reviewed-by: DCO Verification
Reviewed-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Tested-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-on: https://g2g.palm.com/4621
2014-02-06 03:20:11 -08:00
Mykola Kryvonos bf85beed31 Fix JSON schema 'type' keyword parsing
:Release Notes:
Added checking of duplicate values for "type" keyword during JSON Schema
parsing

:Detailed Notes:

:Testing Performed:
Unit tests with memcheck.

:QA Notes:

:Issues Addressed:
[ANG-303] pbnjson: Fix schema keywords validation

Open-webOS-DCO-1.0-Signed-off-by: Mykola Kryvonos <mykola.kryvonos@lge.com>

Change-Id: Ie04b34a4d4bdcf123615a5be33023f3ddd0ce436
Reviewed-on: https://g2g.palm.com/4268
Reviewed-by: DCO Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-on: https://g2g.palm.com/4620
Reviewed-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Tested-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
2014-02-06 03:13:53 -08:00
Mykola Kryvonos 4c9b837091 Fix JSON schema 'enum' keyword parsing
:Release Notes:
Added checking of duplicate values for "enum" keyword during JSON Schema
parsing

:Detailed Notes:
To check duplicate values validator compiration functions were
implemented.

:Testing Performed:
Unit tests with memcheck. New unit tests added

:QA Notes:

:Issues Addressed:
[ANG-303] pbnjson: Fix schema keywords validation

Open-webOS-DCO-1.0-Signed-off-by: Mykola Kryvonos <mykola.kryvonos@lge.com>

Change-Id: I2e3457b3c5f30d77c9b83fdaca2c223e714aec51
Reviewed-on: https://g2g.palm.com/4266
Reviewed-by: DCO Verification
Reviewed-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Tested-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-on: https://g2g.palm.com/4619
2014-02-06 03:09:41 -08:00
Nikolay Orliuk 453d05fe0a introduce jinvalid value
:Release Notes:
Made a difference between jnull() and invalid value by introducing
jinvalid().

:Detailed Notes:
- added jis_valid to check answer for erroneous result
- extended jis_null to cover jinvalid() also
- jinvalid() returns JV_NULL value

:Testing Performed:
unit tests and performance test on desktop

:QA Notes:

:Issues Addressed:
[ANG-547] pbnjson: clash between error and null-value as result of jdom_parse

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>

Change-Id: I85b57891976a4bd6a8ef4ed74fec99d8f0b816ec
Reviewed-on: https://g2g.palm.com/4538
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-02-03 07:09:47 -08:00
Nikolay Orliuk 6c32c00856 factor out jis_const
:Release Notes:

:Detailed Notes:

:Testing Performed:
unit-tests and performance test on desktop

:QA Notes:

:Issues Addressed:
[ANG-547] pbnjson: clash between error and null-value as result of jdom_parse

Open-webOS-DCO-1.0-Signed-off-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Change-Id: I100d2a67275ea902deea7189434dccfd4990a8e9
Reviewed-on: https://g2g.palm.com/4537
Reviewed-by: DCO Verification
Reviewed-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Tested-by: Nikolay Orliuk <nikolay.orliuk@lge.com>
Reviewed-by: Alexandr Smoktal <alexandr.smoktal@lge.com>
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
2014-02-03 01:57:01 -08:00
Anatolii Sakhnik 0bce871f94 Fix multithreading issues with jschema_all()
:Release Notes:
Static instance of jschema_all() shouldn't be reference-counted.

:Detailed Notes:
Prevent potential race conditions in reference counting in
jschema_copy() and jschema_release(), when working with jschema_all().
Remove not used debugging code.

:Testing Performed:
Unit tests with memory checker.

:QA Notes:

:Issues Addressed:
[ANG-262] pbnjson: Fix potential multithreading issues in copy/release(jschema_all())

Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>

Change-Id: Ib6f0d1f95bbe07082768e8a01d0d39ed85addc17
Reviewed-on: https://g2g.palm.com/4442
Reviewed-by: DCO Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Alexandr Smoktal <alexandr.smoktal@lge.com>
Reviewed-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
2014-01-23 03:07:46 -08:00
Anatolii Sakhnik 0d98e32e7c Remove incorrect assert
:Release Notes:
When a string is copied, it's incorrectly to expect their c_str() to
point to the same address.

:Detailed Notes:

:Testing Performed:
Fix is trivial. Build succeeded. Unit tests.

:QA Notes:

:Issues Addressed:

Open-webOS-DCO-1.0-Signed-off-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>

Change-Id: I97e685df4361f33efed31df41734cbc516f4e212
Reviewed-on: https://g2g.palm.com/3956
Reviewed-by: DCO Verification
Reviewed-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Tested-by: Anatolii Sakhnik <anatolii.sakhnik@lge.com>
Reviewed-by: Mykola Kryvonos <mykola.kryvonos@lge.com>
Reviewed-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
Tested-by: Alekseyev Oleksandr <alekseyev.oleksandr@lge.com>
2013-11-20 08:30:39 -08:00