diff options
author | calamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-21 01:13:07 +0000 |
---|---|---|
committer | calamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-21 01:13:07 +0000 |
commit | 712eca0f458b38d5fe47c14932302ad3f14e292d (patch) | |
tree | 905236d46f0a4c471745ead8ad371910b89b5bd0 /tools/json_schema_compiler/util_cc_helper.py | |
parent | 17f5abff8f422bbfd63bfbb809a86464fd20f7ce (diff) | |
download | chromium_src-712eca0f458b38d5fe47c14932302ad3f14e292d.zip chromium_src-712eca0f458b38d5fe47c14932302ad3f14e292d.tar.gz chromium_src-712eca0f458b38d5fe47c14932302ad3f14e292d.tar.bz2 |
Add tests to tools/json_schema_compiler
Add tests for different json cases by compiling test jsons and running C++
tests against them. Also fixed bugs where tests failed, removed a dead flag and refactored for readability.
BUG=
TEST=
Review URL: http://codereview.chromium.org/9415001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122781 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/json_schema_compiler/util_cc_helper.py')
-rw-r--r-- | tools/json_schema_compiler/util_cc_helper.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/json_schema_compiler/util_cc_helper.py b/tools/json_schema_compiler/util_cc_helper.py index 4c5a13b..fe4e858 100644 --- a/tools/json_schema_compiler/util_cc_helper.py +++ b/tools/json_schema_compiler/util_cc_helper.py @@ -11,7 +11,7 @@ class UtilCCHelper(object): def __init__(self, type_manager): self._type_manager = type_manager - def GetArray(self, array_prop, src, name, dst): + def PopulateArrayFromDictionary(self, array_prop, src, name, dst): """Generates code to get an array from a src.name into dst. src: DictionaryValue* @@ -35,7 +35,7 @@ class UtilCCHelper(object): return val % sub - def GetArrayFromList(self, array_prop, src, dst): + def PopulateArrayFromList(self, array_prop, src, dst): """Generates code to get an array from src into dst. src: ListValue* @@ -56,7 +56,7 @@ class UtilCCHelper(object): return val % sub - def SetArray(self, array_prop, src, name, dst): + def PopulateDictionaryFromArray(self, array_prop, src, name, dst): """Generates code to set dst.name to the array at src src: std::vector or scoped_ptr<std::vector> @@ -75,12 +75,12 @@ class UtilCCHelper(object): val = ('%(namespace)s::PopulateDictionaryFromOptionalArray' '(%(src)s, "%(name)s", %(dst)s.get())') else: - val = ('%(namespace)s::PopulateDictionaryFromArray(%(src)s, ' - '"%(name)s", %(dst)s.get())') + val = ('%(namespace)s::PopulateDictionaryFromArray' + '(%(src)s, "%(name)s", %(dst)s.get())') return val % sub - def SetArrayToList(self, array_prop, src, dst): + def PopulateListFromArray(self, array_prop, src, dst): """Generates code to set dst to the array at src src: std::vector or scoped_ptr<std::vector> |