PageRenderTime 23ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llmessage/tests/llxfer_file_test.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 58 lines | 25 code | 6 blank | 27 comment | 1 complexity | 0a7bf6af44f6ecf3db333688068db63b MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llxfer_test.cpp
  3. * @author Moss
  4. * @date 2007-04-17
  5. *
  6. * $LicenseInfo:firstyear=2007&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, 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 "../llxfer_file.h"
  29. #include "../test/lltut.h"
  30. namespace tut
  31. {
  32. struct llxfer_data
  33. {
  34. };
  35. typedef test_group<llxfer_data> llxfer_test;
  36. typedef llxfer_test::object llxfer_object;
  37. tut::llxfer_test llxfer("LLXferFile");
  38. template<> template<>
  39. void llxfer_object::test<1>()
  40. {
  41. // test that we handle an oversized filename correctly.
  42. std::string oversized_filename;
  43. U32 i;
  44. for (i=0; i<LL_MAX_PATH*2; ++i) // create oversized filename
  45. {
  46. oversized_filename += 'X';
  47. }
  48. LLXfer_File xff(oversized_filename, FALSE, 1);
  49. ensure("oversized local_filename nul-terminated",
  50. xff.getFileName().length() < LL_MAX_PATH);
  51. }
  52. }