From 2d9774c26cd1dc3155e0a0cfb21007dc1a427742 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 17 Oct 2020 18:38:38 +0100 Subject: Remove unrequired case_less comparator --- slicer/slicer/modelParts.h | 10 ---------- slicer/test/serializers.cpp | 20 -------------------- 2 files changed, 30 deletions(-) diff --git a/slicer/slicer/modelParts.h b/slicer/slicer/modelParts.h index c3dd87d..bcc6a05 100644 --- a/slicer/slicer/modelParts.h +++ b/slicer/slicer/modelParts.h @@ -122,16 +122,6 @@ namespace Slicer { const std::string * nameStr; }; - struct case_less { - template - inline bool - operator()(const A & a, const B & b) const - { - const auto cmp = strncasecmp(a.data(), b.data(), std::min(a.length(), b.length())); - return (cmp < 0) || (!cmp && a.length() < b.length()); - } - }; - class DLL_PUBLIC ModelPart : public std::enable_shared_from_this { public: ModelPart() = default; diff --git a/slicer/test/serializers.cpp b/slicer/test/serializers.cpp index 6b4393b..db22535 100644 --- a/slicer/test/serializers.cpp +++ b/slicer/test/serializers.cpp @@ -719,26 +719,6 @@ BOOST_AUTO_TEST_CASE(customerModelPartCounters) BOOST_REQUIRE_EQUAL(21, TestModule::completions); } -BOOST_FIXTURE_TEST_SUITE(l, Slicer::case_less); - -BOOST_AUTO_TEST_CASE(case_less_test) -{ - using namespace std::literals; - const auto & lc {*this}; - BOOST_CHECK(!lc(""sv, ""sv)); - BOOST_CHECK(lc("a"sv, "b"sv)); - BOOST_CHECK(lc("A"sv, "b"sv)); - BOOST_CHECK(lc("Aa"sv, "b"sv)); - BOOST_CHECK(lc("AA"sv, "b"sv)); - BOOST_CHECK(lc("aA"sv, "b"s)); - BOOST_CHECK(lc("A"s, "B"sv)); - BOOST_CHECK(lc("Aa"sv, "Bb"s)); - BOOST_CHECK(lc("AA"s, "bB"s)); - BOOST_CHECK(lc("aA"s, "BB"s)); -} - -BOOST_AUTO_TEST_SUITE_END(); - BOOST_AUTO_TEST_CASE(enum_lookups) { BOOST_CHECK_EQUAL("One", Slicer::ModelPartForEnum::lookup(TestModule::SomeNumbers::One)); -- cgit v1.2.3