1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #define CSV_USE_CSV_ASSERTIONS
21 #include <cosv/csv_env.hxx>
23 #include <cosv/comfunc.hxx>
24 #include <cosv/string.hxx>
25 #include <cosv/streamstr.hxx>
26 #include <cosv/std_outp.hxx>
27 #include <cosv/tpl/dyn.hxx>
29 // NOT FULLY DECLARED SERVICES
32 using csv::SimpleString
;
36 UnitTests for class String.
40 check_value( const String
& a
, const char * b
)
42 return strcmp( a
.c_str(), b
) == 0;
47 classtest_String( csv::SimpleString
& rSimpleString
)
50 UT_CHECK( String(), check_value(x1
,"") )
52 const char * s2a
= "";
54 UT_CHECK( String(const char*), check_value(x2a
,s2a
) )
56 const char * s2b
= "_zluoadninger prrg chiäßi(/%$##@\\\"'''fh kl";
58 UT_CHECK( String(const char*), check_value(x2b
,s2b
) )
61 bool ret
= ftest_Read( rSimpleString
);
62 ret
&= ftest_Write( rSimpleString
) AND ret
;
63 ret
&= ftest_SeekBack( rSimpleString
) AND ret
;
64 ret
&= ftest_SeekRelative( rSimpleString
) AND ret
;
66 rSimpleString
.Close();
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */