+/*
+ * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
#include "squid.h"
#include "event.h"
-#include "Mem.h"
#include "SquidString.h"
#include "testString.h"
+#include "unitTestMain.h"
CPPUNIT_TEST_SUITE_REGISTRATION( testString );
/* init memory pools */
-struct Initer
+void
+testString::setUp()
{
- Initer() {Mem::Init();}
-};
-
-static Initer ensure_mempools;
+ Mem::Init();
+}
void
testString::testCmpDefault()
CPPUNIT_ASSERT(right.cmp("foo") < 0);
CPPUNIT_ASSERT(right.cmp("foo", 1) < 0);
}
+
+void testString::testSubstr()
+{
+ String s("0123456789");
+ String check=s.substr(3,5);
+ String ref("34");
+ CPPUNIT_ASSERT(check == ref);
+}
+