From fb17080142ed3baad8eef187f514a6fd7ceb759f Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Mon, 2 May 2011 16:53:10 +0000 Subject: [PATCH] - Added unit tests for comparison operators (except compare()) - Fixed Value::operator <= implementation (had the semantic of operator >=). Found when addigin unit tests for comparison operators. --- NEWS.txt | 3 +++ src/lib_json/json_value.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS.txt b/NEWS.txt index 7978c0a..9b5d69c 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -86,6 +86,9 @@ - Bug #3139678: stack buffer overflow when parsing a double with a length of 32 characters. + + - Fixed Value::operator <= implementation (had the semantic of operator >=). + Found when addigin unit tests for comparison operators. * License diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index c8e0478..fd1266b 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -600,7 +600,7 @@ Value::operator <( const Value &other ) const bool Value::operator <=( const Value &other ) const { - return !(other > *this); + return !(other < *this); } bool