Repository: avro
Updated Branches:
  refs/heads/master f5cbd7378 -> 3ab93ca43


AVRO-1930 fixed


Project: http://git-wip-us.apache.org/repos/asf/avro/repo
Commit: http://git-wip-us.apache.org/repos/asf/avro/commit/3ab93ca4
Tree: http://git-wip-us.apache.org/repos/asf/avro/tree/3ab93ca4
Diff: http://git-wip-us.apache.org/repos/asf/avro/diff/3ab93ca4

Branch: refs/heads/master
Commit: 3ab93ca43aa2dbcac3c7b50c201bd3e297dc493b
Parents: f5cbd73
Author: Thiruvalluvan M G <[email protected]>
Authored: Sun Jan 29 17:02:00 2017 +0530
Committer: Thiruvalluvan M G <[email protected]>
Committed: Sun Jan 29 17:02:00 2017 +0530

----------------------------------------------------------------------
 lang/c++/impl/json/JsonIO.cc | 8 ++++++++
 lang/c++/test/JsonTests.cc   | 3 +++
 2 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/avro/blob/3ab93ca4/lang/c++/impl/json/JsonIO.cc
----------------------------------------------------------------------
diff --git a/lang/c++/impl/json/JsonIO.cc b/lang/c++/impl/json/JsonIO.cc
index 2e7d82f..eafd579 100644
--- a/lang/c++/impl/json/JsonIO.cc
+++ b/lang/c++/impl/json/JsonIO.cc
@@ -171,6 +171,10 @@ JsonParser::Token JsonParser::tryNumber(char ch)
                     state = 3;
                     sv.push_back(ch);
                     continue;
+                } else if (ch == 'e' || ch == 'E') {
+                    sv.push_back(ch);
+                    state = 5;
+                    continue;
                 }
                 hasNext = true;
             }
@@ -185,6 +189,10 @@ JsonParser::Token JsonParser::tryNumber(char ch)
                     state = 3;
                     sv.push_back(ch);
                     continue;
+                } else if (ch == 'e' || ch == 'E') {
+                    sv.push_back(ch);
+                    state = 5;
+                    continue;
                 }
                 hasNext = true;
             }

http://git-wip-us.apache.org/repos/asf/avro/blob/3ab93ca4/lang/c++/test/JsonTests.cc
----------------------------------------------------------------------
diff --git a/lang/c++/test/JsonTests.cc b/lang/c++/test/JsonTests.cc
index 823f15f..79e6c27 100644
--- a/lang/c++/test/JsonTests.cc
+++ b/lang/c++/test/JsonTests.cc
@@ -56,6 +56,9 @@ TestData<double> doubleData[] = {
     { "1.0", etDouble, 1.0 },
     { "4.7e3", etDouble, 4700.0 },
     { "-7.2e-4", etDouble, -0.00072 },
+    { "1e4", etDouble, 10000 },
+    { "-1e-4", etDouble, -0.0001 },
+    { "-0e0", etDouble, 0.0 },
 };
 
 TestData<const char*> stringData[] = {

Reply via email to