mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Rojas" <alexan...@mesosphere.io>
Subject Re: Review Request 32163: Added a function which checks if a json object is contained within another.
Date Fri, 01 May 2015 18:55:48 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32163/
-----------------------------------------------------------

(Updated May 1, 2015, 8:55 p.m.)


Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Marco Massenzio,
Niklas Nielsen, and Till Toenshoff.


Changes
-------

Adding tests for larger array.


Bugs: MESOS-2510
    https://issues.apache.org/jira/browse/MESOS-2510


Repository: mesos


Description
-------

Adds a function which allows to perform comparison tests on subsets of json blobs. i.e.

```cpp
JSON::Value expected = JSON::parse(
    "{"
    "  \"key\" : true"
	"}").get();

// Returned json:
// {
//   "uptime" : 45234.123,
//   "key" : true
// }
JSON::Value actual = bar();

// I'm only interested on the "key" entry and ignore the rest.
EXPECT_TRUE(contains(actual, expected));
```

Increasing readability for tests that include json.

For more information on the reason of why this patch is needed, please check the JIRA entry.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 334c898906018be6e663f53815abbe047806b95c

  3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp f60d1bbe60f2e2b6460c06bba98e8b85ebb6a3f9


Diff: https://reviews.apache.org/r/32163/diff/


Testing
-------

make check


Thanks,

Alexander Rojas


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message