table: limit prefix length in StrategyChoice
refs #4262
Change-Id: Iddebeb555b2f3315515a298f8cded353fb51854d
diff --git a/tests/daemon/table/strategy-choice.t.cpp b/tests/daemon/table/strategy-choice.t.cpp
index eeba048..0173af4 100644
--- a/tests/daemon/table/strategy-choice.t.cpp
+++ b/tests/daemon/table/strategy-choice.t.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
@@ -144,6 +144,21 @@
BOOST_CHECK(!sc.insert("/D", oneParamUnversioned));
}
+BOOST_AUTO_TEST_CASE(InsertLongName)
+{
+ Name n1;
+ while (n1.size() < NameTree::getMaxDepth()) {
+ n1.append("A");
+ }
+ Name n2 = n1;
+ while (n2.size() < NameTree::getMaxDepth() * 2) {
+ n2.append("B");
+ }
+
+ BOOST_CHECK(sc.insert(n1, strategyNameP));
+ BOOST_CHECK(!sc.insert(n2, strategyNameP));
+}
+
BOOST_AUTO_TEST_CASE(Get)
{
BOOST_CHECK(sc.insert("/", strategyNameP));