Arcane  v4.1.0.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
TestValueFiller.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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#include <gtest/gtest.h>
8
9#include "arccore/base/ValueFiller.h"
10#include "arccore/base/CoreArray.h"
11#include "arccore/base/BuiltInDataTypeContainer.h"
12
13#include <iostream>
14
15/*---------------------------------------------------------------------------*/
16/*---------------------------------------------------------------------------*/
17
18using namespace Arccore;
19using namespace Arcane;
20using namespace Arcane::Impl;
21
22template <typename DataType>
24{
25 public:
26
27 using InstanceType = TestInstance<DataType>;
28
29 public:
30
31 void doTest(Int64 nb_value)
32 {
33 const Int64 rng_seed{ 512515 };
35 values.resize(nb_value);
36 ValueFiller::fillRandom(rng_seed, values.span());
37 if (nb_value < 5)
38 std::cout << "Values=" << values.view() << "\n";
39 }
40};
41
42/*---------------------------------------------------------------------------*/
43/*---------------------------------------------------------------------------*/
44
45TEST(ValueFiller, Misc)
46{
48
49 std::array<Int64, 2> sizes = { 4, 5640 };
50 for (Int64 n : sizes) {
51 test_container.apply([&](auto& x) { x.doTest(n); });
52 }
53}
54
55/*---------------------------------------------------------------------------*/
56/*---------------------------------------------------------------------------*/
Conteneur contenant une instance d'une classe par type de donnée.
ArrayView< DataType > view()
Vue modifiable.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int64_t Int64
Type entier signé sur 64 bits.
Espace de nom de Arccore.