Main MRPT website > C++ reference for MRPT 1.5.9
format_unittest.cpp
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 #include <mrpt/utils/utils_defs.h>
11 #include <gtest/gtest.h>
12 
13 using namespace mrpt;
14 using namespace mrpt::utils;
15 using namespace mrpt::math;
16 using namespace std;
17 
18 
19 // Load data from constant file and check for exact match.
20 TEST(FormatTest, LargeStrings)
21 {
22  string test_str;
23  const size_t test_str_len = 30000;
24  test_str.assign(test_str_len,'A');
25 
26  std::string s = mrpt::format("%u %s",static_cast<unsigned int>(10), test_str.c_str() );
27 
28  const size_t out_str_len = s.size();
29 
30  // If it works, out len must be that of the string, plus 3 from "10 "
31  EXPECT_EQ(out_str_len, (test_str_len+3) );
32 }
33 
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
STL namespace.
GLdouble s
Definition: glext.h:3602
This base provides a set of functions for maths stuff.
Definition: CArrayNumeric.h:19
TEST(FormatTest, LargeStrings)
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
GLsizei const GLchar ** string
Definition: glext.h:3919
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020