From 48fb38e6e3bdd5bd3d2fb3eec2d2da95115fa749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Sun, 4 Jan 2015 11:51:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TinySTL/Test/SuffixArrayTest.cpp | 6 ++++-- TinySTL/Test/SuffixArrayTest.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/TinySTL/Test/SuffixArrayTest.cpp b/TinySTL/Test/SuffixArrayTest.cpp index 658e17f..fa1bc59 100644 --- a/TinySTL/Test/SuffixArrayTest.cpp +++ b/TinySTL/Test/SuffixArrayTest.cpp @@ -3,9 +3,11 @@ namespace TinySTL{ namespace SuffixArrayTest{ void testCase(){ - char arr[] = { 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'b' }; + //char arr[] = { 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'b' }; + std::string str("aabaaaab"); - TinySTL::suffix_array sa(arr, 8); + //TinySTL::suffix_array sa(arr, 8); + TinySTL::suffix_array sa(str.data(), str.size()); auto sa1 = sa.suffixArray(); auto sa2 = TinySTL::suffix_array::array_type{3, 4, 5, 0, 6, 1, 7, 2}; assert(TinySTL::Test::container_equal(sa1, sa2)); diff --git a/TinySTL/Test/SuffixArrayTest.h b/TinySTL/Test/SuffixArrayTest.h index e6ff62b..a0c801b 100644 --- a/TinySTL/Test/SuffixArrayTest.h +++ b/TinySTL/Test/SuffixArrayTest.h @@ -6,6 +6,7 @@ #include "../SuffixArray.h" #include +#include namespace TinySTL{ namespace SuffixArrayTest{