Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
TestLinearOffsetMap.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 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/LinearOffsetMap.h"
11
12/*---------------------------------------------------------------------------*/
13/*---------------------------------------------------------------------------*/
14
15using namespace Arcane;
16
18{
19 {
21 ASSERT_TRUE(v1.getAndRemoveOffset(1) < 0);
22 ASSERT_EQ(v1.size(), 0);
23 }
24 {
26 v2.add(25, 4);
27 ASSERT_TRUE(v2.getAndRemoveOffset(32) < 0);
28 ASSERT_EQ(v2.getAndRemoveOffset(20), 4);
29 ASSERT_EQ(v2.getAndRemoveOffset(5), 24);
30 ASSERT_EQ(v2.size(), 0);
31 }
32
33 {
35 v3.add(25, 4);
36 v3.add(25, 30);
37 ASSERT_EQ(v3.getAndRemoveOffset(18), 4);
38 ASSERT_EQ(v3.getAndRemoveOffset(25), 30);
39 ASSERT_EQ(v3.size(), 1);
40 ASSERT_EQ(v3.getAndRemoveOffset(4), 22);
41 ASSERT_EQ(v3.size(), 1);
42 ASSERT_EQ(v3.getAndRemoveOffset(3), 26);
43 ASSERT_EQ(v3.size(), 0);
44 }
45}
46
47/*---------------------------------------------------------------------------*/
48/*---------------------------------------------------------------------------*/
#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
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-