From 4247b81e7756ce1ff01e097e634a9dcbc0912787 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 28 Jan 2023 17:06:57 +0100 Subject: Added tests --- diff.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'diff.cpp') diff --git a/diff.cpp b/diff.cpp index ee17fad..99a2f14 100644 --- a/diff.cpp +++ b/diff.cpp @@ -115,6 +115,10 @@ void Diff::create(const std::string& xml) m_pos0 = tree.get("diff.start"); m_pos1 = tree.get("diff.end"); + + if (m_pos0 > m_pos1) + throw std::runtime_error("Bad range in diff"); + m_data = tree.get("diff.data"); } -- cgit v1.2.3