Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
TestValueConvert.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7
8#include <gtest/gtest.h>
9
10#include "arcane/utils/ValueConvert.h"
11
12/*---------------------------------------------------------------------------*/
13/*---------------------------------------------------------------------------*/
14
15using namespace Arcane;
16
18{
19 std::cout << "TEST_ValueConvert Basic\n";
20
21 {
22 // TODO: tester les autres conversions
23 String s = "25e3";
24 Int32 x = 0;
25 bool is_bad = builtInGetValue(x,s);
26 std::cout << "S=" << s << " X=" << x << " is_bad?=" << is_bad << "\n";
28 }
29
30 {
31 String s2;
33 ASSERT_FALSE(v.has_value());
34 }
35
36 {
37 String s2;
39 ASSERT_TRUE(v.has_value());
40 ASSERT_EQ(v,4);
41 }
42
43 {
44 String s2("2.3");
46 ASSERT_EQ(v,2.3);
47 }
48
49 {
50 String s2("2.3w");
52 ASSERT_FALSE(v.has_value());
53 }
54}
55
56/*---------------------------------------------------------------------------*/
57/*---------------------------------------------------------------------------*/
#define ASSERT_FALSE(condition)
Vérifie que condition est faux.
Definition Assertion.h:138
#define ASSERT_TRUE(condition)
Vérifie que condition est vrai.
Definition Assertion.h:126
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Chaîne de caractères unicode.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-