DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
test_Array.cpp File Reference

Doctest-based unit tests for DNDS::Array across all five data layouts (TABLE_StaticFixed, TABLE_Fixed, TABLE_StaticMax, TABLE_Max, CSR). More...

#include "doctest.h"
#include "DNDS/Array.hpp"
#include <cstdint>
#include <cstdio>
#include <filesystem>
#include <string>
Include dependency graph for test_Array.cpp:

Go to the source code of this file.

Classes

struct  LayoutStaticFixed
 
struct  LayoutDynamic
 
struct  LayoutCSR
 
struct  ArrayTag< T, Layout, RS >
 

Macros

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
 
#define ARRAY_TAG_STR(T, L, RS)   TYPE_TO_STRING(ArrayTag<T, L, RS>)
 
#define ARRAY_ALL_TAGS
 

Functions

 TEST_CASE ("Array TABLE_StaticFixed layout")
 
 TEST_CASE ("Array TABLE_Fixed layout")
 
 TEST_CASE ("Array TABLE_StaticMax layout")
 
 TEST_CASE ("Array TABLE_Max layout")
 
 TEST_CASE ("Array CSR layout")
 
 TEST_CASE ("Array clone and copy")
 
 TEST_CASE ("Array edge cases")
 
 TEST_CASE ("Array serialization round-trip")
 
 TEST_CASE ("Array signature")
 
 TEST_CASE ("Array hash")
 
 ARRAY_TAG_STR (DNDS::real, LayoutStaticFixed, 1)
 
 ARRAY_TAG_STR (DNDS::real, LayoutStaticFixed, 3)
 
 ARRAY_TAG_STR (DNDS::real, LayoutStaticFixed, 7)
 
 ARRAY_TAG_STR (DNDS::real, LayoutDynamic, 1)
 
 ARRAY_TAG_STR (DNDS::real, LayoutDynamic, 3)
 
 ARRAY_TAG_STR (DNDS::real, LayoutDynamic, 7)
 
 ARRAY_TAG_STR (DNDS::real, LayoutCSR, 0)
 
 ARRAY_TAG_STR (DNDS::index, LayoutStaticFixed, 1)
 
 ARRAY_TAG_STR (DNDS::index, LayoutStaticFixed, 3)
 
 ARRAY_TAG_STR (DNDS::index, LayoutStaticFixed, 7)
 
 ARRAY_TAG_STR (DNDS::index, LayoutDynamic, 1)
 
 ARRAY_TAG_STR (DNDS::index, LayoutDynamic, 3)
 
 ARRAY_TAG_STR (DNDS::index, LayoutDynamic, 7)
 
 ARRAY_TAG_STR (DNDS::index, LayoutCSR, 0)
 
 ARRAY_TAG_STR (uint16_t, LayoutStaticFixed, 1)
 
 ARRAY_TAG_STR (uint16_t, LayoutStaticFixed, 3)
 
 ARRAY_TAG_STR (uint16_t, LayoutStaticFixed, 7)
 
 ARRAY_TAG_STR (uint16_t, LayoutDynamic, 1)
 
 ARRAY_TAG_STR (uint16_t, LayoutDynamic, 3)
 
 ARRAY_TAG_STR (uint16_t, LayoutDynamic, 7)
 
 ARRAY_TAG_STR (uint16_t, LayoutCSR, 0)
 
 ARRAY_TAG_STR (int32_t, LayoutStaticFixed, 1)
 
 ARRAY_TAG_STR (int32_t, LayoutStaticFixed, 3)
 
 ARRAY_TAG_STR (int32_t, LayoutStaticFixed, 7)
 
 ARRAY_TAG_STR (int32_t, LayoutDynamic, 1)
 
 ARRAY_TAG_STR (int32_t, LayoutDynamic, 3)
 
 ARRAY_TAG_STR (int32_t, LayoutDynamic, 7)
 
 ARRAY_TAG_STR (int32_t, LayoutCSR, 0)
 
 ARRAY_TAG_STR (uint8_t, LayoutStaticFixed, 1)
 
 ARRAY_TAG_STR (uint8_t, LayoutStaticFixed, 3)
 
 ARRAY_TAG_STR (uint8_t, LayoutStaticFixed, 7)
 
 ARRAY_TAG_STR (uint8_t, LayoutDynamic, 1)
 
 ARRAY_TAG_STR (uint8_t, LayoutDynamic, 3)
 
 ARRAY_TAG_STR (uint8_t, LayoutDynamic, 7)
 
 ARRAY_TAG_STR (uint8_t, LayoutCSR, 0)
 
 TEST_CASE_TEMPLATE ("Array resize-write-read", Tag, ARRAY_ALL_TAGS)
 

Detailed Description

Doctest-based unit tests for DNDS::Array across all five data layouts (TABLE_StaticFixed, TABLE_Fixed, TABLE_StaticMax, TABLE_Max, CSR).

This is a serial test (no MPI required). It also covers clone/copy semantics, edge cases, JSON serialization round-trips, array signature utilities, and hashing.

See also
DNDS Core Unit Tests for the full test-suite overview.
Test:
Array layout correctness, resize, compress/decompress, clone, copy, swap, serialization round-trip, signature, hash.

Definition in file test_Array.cpp.

Macro Definition Documentation

◆ ARRAY_ALL_TAGS

#define ARRAY_ALL_TAGS

Definition at line 630 of file test_Array.cpp.

◆ ARRAY_TAG_STR

#define ARRAY_TAG_STR (   T,
  L,
  RS 
)    TYPE_TO_STRING(ArrayTag<T, L, RS>)

Definition at line 584 of file test_Array.cpp.

◆ DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

Definition at line 16 of file test_Array.cpp.

Function Documentation

◆ ARRAY_TAG_STR() [1/35]

ARRAY_TAG_STR ( DNDS::index  ,
LayoutCSR  ,
 
)

◆ ARRAY_TAG_STR() [2/35]

ARRAY_TAG_STR ( DNDS::index  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [3/35]

ARRAY_TAG_STR ( DNDS::index  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [4/35]

ARRAY_TAG_STR ( DNDS::index  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [5/35]

ARRAY_TAG_STR ( DNDS::index  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [6/35]

ARRAY_TAG_STR ( DNDS::index  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [7/35]

ARRAY_TAG_STR ( DNDS::index  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [8/35]

ARRAY_TAG_STR ( DNDS::real  ,
LayoutCSR  ,
 
)

◆ ARRAY_TAG_STR() [9/35]

ARRAY_TAG_STR ( DNDS::real  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [10/35]

ARRAY_TAG_STR ( DNDS::real  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [11/35]

ARRAY_TAG_STR ( DNDS::real  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [12/35]

ARRAY_TAG_STR ( DNDS::real  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [13/35]

ARRAY_TAG_STR ( DNDS::real  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [14/35]

ARRAY_TAG_STR ( DNDS::real  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [15/35]

ARRAY_TAG_STR ( int32_t  ,
LayoutCSR  ,
 
)

◆ ARRAY_TAG_STR() [16/35]

ARRAY_TAG_STR ( int32_t  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [17/35]

ARRAY_TAG_STR ( int32_t  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [18/35]

ARRAY_TAG_STR ( int32_t  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [19/35]

ARRAY_TAG_STR ( int32_t  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [20/35]

ARRAY_TAG_STR ( int32_t  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [21/35]

ARRAY_TAG_STR ( int32_t  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [22/35]

ARRAY_TAG_STR ( uint16_t  ,
LayoutCSR  ,
 
)

◆ ARRAY_TAG_STR() [23/35]

ARRAY_TAG_STR ( uint16_t  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [24/35]

ARRAY_TAG_STR ( uint16_t  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [25/35]

ARRAY_TAG_STR ( uint16_t  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [26/35]

ARRAY_TAG_STR ( uint16_t  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [27/35]

ARRAY_TAG_STR ( uint16_t  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [28/35]

ARRAY_TAG_STR ( uint16_t  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [29/35]

ARRAY_TAG_STR ( uint8_t  ,
LayoutCSR  ,
 
)

◆ ARRAY_TAG_STR() [30/35]

ARRAY_TAG_STR ( uint8_t  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [31/35]

ARRAY_TAG_STR ( uint8_t  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [32/35]

ARRAY_TAG_STR ( uint8_t  ,
LayoutDynamic  ,
 
)

◆ ARRAY_TAG_STR() [33/35]

ARRAY_TAG_STR ( uint8_t  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [34/35]

ARRAY_TAG_STR ( uint8_t  ,
LayoutStaticFixed  ,
 
)

◆ ARRAY_TAG_STR() [35/35]

ARRAY_TAG_STR ( uint8_t  ,
LayoutStaticFixed  ,
 
)

◆ TEST_CASE() [1/10]

TEST_CASE ( "Array clone and copy"  )

Definition at line 231 of file test_Array.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [2/10]

TEST_CASE ( "Array CSR layout"  )

Definition at line 157 of file test_Array.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [3/10]

TEST_CASE ( "Array edge cases"  )

Definition at line 299 of file test_Array.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [4/10]

TEST_CASE ( "Array hash"  )

Definition at line 533 of file test_Array.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [5/10]

TEST_CASE ( "Array serialization round-trip"  )

Definition at line 357 of file test_Array.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [6/10]

TEST_CASE ( "Array signature"  )

Definition at line 483 of file test_Array.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [7/10]

TEST_CASE ( "Array TABLE_Fixed layout"  )

Definition at line 76 of file test_Array.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [8/10]

TEST_CASE ( "Array TABLE_Max layout"  )

Definition at line 130 of file test_Array.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [9/10]

TEST_CASE ( "Array TABLE_StaticFixed layout"  )

Definition at line 31 of file test_Array.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [10/10]

TEST_CASE ( "Array TABLE_StaticMax layout"  )

Definition at line 100 of file test_Array.cpp.

Here is the call graph for this function:

◆ TEST_CASE_TEMPLATE()

TEST_CASE_TEMPLATE ( "Array resize-write-read"  ,
Tag  ,
ARRAY_ALL_TAGS   
)

Definition at line 674 of file test_Array.cpp.

Here is the call graph for this function: