From f17abb16793a9e7fc8ded00723dcde8c0ba47c76 Mon Sep 17 00:00:00 2001 From: jvelilla Date: Thu, 15 Nov 2012 08:26:51 -0200 Subject: [PATCH 1/2] Update Readme.txt Fixed documentation URI --- Readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.txt b/Readme.txt index bd8ce28d..1dc997a7 100644 --- a/Readme.txt +++ b/Readme.txt @@ -39,7 +39,7 @@ compatibility is not guranteed for changes in minor numbers! Currently the only documentation on eJSON is available at: - http://ejson.origo.ethz.ch/wiki/user_guide + https://github.com/eiffelhub/json/wiki/User-guide 5. Requirements and installation -------------------------------- From 233de09c48d7af2c268ce3617cfb122c6eede0b9 Mon Sep 17 00:00:00 2001 From: Olivier Ligot Date: Mon, 10 Dec 2012 17:39:22 +0100 Subject: [PATCH 2/2] Fix {JSON_OBJECT}.hash_code implementation Don't call {HASH_TABLE}.item_for_iteration when {HASH_TABLE}.off Use {HASH_TABLE}.out instead --- .gitignore | 3 ++- library/kernel/json_object.e | 2 +- test/autotest/test_suite/test_json_core.e | 11 +++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f1fddd3f..a1ff1e86 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*.swp \ No newline at end of file +*.swp +EIFGENs diff --git a/library/kernel/json_object.e b/library/kernel/json_object.e index 9e6ec34c..e4a16192 100644 --- a/library/kernel/json_object.e +++ b/library/kernel/json_object.e @@ -161,7 +161,7 @@ feature -- Report do from object.start - Result := object.item_for_iteration.hash_code + Result := object.out.hash_code until object.off loop diff --git a/test/autotest/test_suite/test_json_core.e b/test/autotest/test_suite/test_json_core.e index d2faa7e1..ec17537a 100644 --- a/test/autotest/test_suite/test_json_core.e +++ b/test/autotest/test_suite/test_json_core.e @@ -778,6 +778,17 @@ feature -- Test end + test_json_object_hash_code + local + ht: HASH_TABLE [ANY, JSON_VALUE] + jo: JSON_OBJECT + do + create ht.make (1) + create jo.make + ht.force ("", jo) + assert ("ht.has_key (jo)", ht.has_key (jo)) + end + test_json_failed_json_conversion -- Test converting an Eiffel object to JSON that is based on a class -- for which no JSON converter has been registered.