moved from Catch to doctest for unit tests

This commit is contained in:
onqtam 2019-01-13 18:41:21 +02:00
parent e5753b14a8
commit 2f44ac1def
52 changed files with 5517 additions and 11854 deletions

View file

@ -27,7 +27,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "catch.hpp"
#include "doctest_compatibility.h"
#include <nlohmann/json.hpp>
using nlohmann::json;
@ -342,7 +342,7 @@ TEST_CASE("JSON patch")
// check that evaluation throws
CHECK_THROWS_AS(doc.patch(patch), json::other_error&);
CHECK_THROWS_WITH(doc.patch(patch), "[json.exception.other_error.501] unsuccessful: " + patch[0].dump());
CHECK_THROWS_WITH_STD_STR(doc.patch(patch), "[json.exception.other_error.501] unsuccessful: " + patch[0].dump());
}
SECTION("A.10. Adding a Nested Member Object")
@ -483,7 +483,7 @@ TEST_CASE("JSON patch")
// check that evaluation throws
CHECK_THROWS_AS(doc.patch(patch), json::other_error&);
CHECK_THROWS_WITH(doc.patch(patch), "[json.exception.other_error.501] unsuccessful: " + patch[0].dump());
CHECK_THROWS_WITH_STD_STR(doc.patch(patch), "[json.exception.other_error.501] unsuccessful: " + patch[0].dump());
}
SECTION("A.16. Adding an Array Value")
@ -1182,7 +1182,7 @@ TEST_CASE("JSON patch")
// the test will fail
CHECK_THROWS_AS(doc.patch(patch), json::other_error&);
CHECK_THROWS_WITH(doc.patch(patch), "[json.exception.other_error.501] unsuccessful: " + patch[0].dump());
CHECK_THROWS_WITH_STD_STR(doc.patch(patch), "[json.exception.other_error.501] unsuccessful: " + patch[0].dump());
}
}
}
@ -1268,7 +1268,7 @@ TEST_CASE("JSON patch")
for (const auto& test : suite)
{
CAPTURE(test.value("comment", ""))
INFO_WITH_TEMP(test.value("comment", ""));
// skip tests marked as disabled
if (test.value("disabled", false))