PageRenderTime 36ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llvfs/tests/lldiriterator_test.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 65 lines | 26 code | 7 blank | 32 comment | 0 complexity | 7142615b8235daa9d7e3853c966a9d79 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lldiriterator_test.cpp
  3. * @date 2011-06
  4. * @brief LLDirIterator test cases.
  5. *
  6. * $LicenseInfo:firstyear=2011&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2011, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.,
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. */
  27. #include "linden_common.h"
  28. #include "lltut.h"
  29. #include "../lldiriterator.h"
  30. namespace tut
  31. {
  32. struct LLDirIteratorFixture
  33. {
  34. LLDirIteratorFixture()
  35. {
  36. }
  37. };
  38. typedef test_group<LLDirIteratorFixture> LLDirIteratorTest_factory;
  39. typedef LLDirIteratorTest_factory::object LLDirIteratorTest_t;
  40. LLDirIteratorTest_factory tf("LLDirIterator");
  41. /*
  42. CHOP-662 was originally introduced to deal with crashes deleting files from
  43. a directory (VWR-25500). However, this introduced a crash looking for
  44. old chat logs as the glob_to_regex function in lldiriterator wasn't escaping lots of regexp characters
  45. */
  46. void test_chop_662(void)
  47. {
  48. // Check a selection of bad group names from the crash reports
  49. LLDirIterator iter(".","+bad-group-name]+??-??.*");
  50. LLDirIterator iter1(".","))--@---bad-group-name2((??-??.*\\.txt");
  51. LLDirIterator iter2(".","__^v--x)Cuide d sua vida(x--v^__??-??.*");
  52. }
  53. template<> template<>
  54. void LLDirIteratorTest_t::test<1>()
  55. {
  56. test_chop_662();
  57. }
  58. }