xref: /libCEED/tests/t113-vector.c (revision 44554ea01e90fce366fc2a203c44be15754a38d6)
1 /// @file
2 /// Test CeedVector readers counter
3 /// \test Test CeedVector readers counter
4 #include <ceed.h>
5 
6 int main(int argc, char **argv) {
7   Ceed ceed;
8   CeedVector x;
9   CeedInt n;
10   const CeedScalar *a;
11   CeedScalar *b;
12 
13   CeedInit(argv[1], &ceed);
14 
15   n = 10;
16   CeedVectorCreate(ceed, n, &x);
17   CeedVectorGetArrayRead(x, CEED_MEM_HOST, &a);
18 
19   // Write access with read access generate an error
20   CeedVectorGetArray(x, CEED_MEM_HOST, &b);
21 
22   // LCOV_EXCL_START
23   CeedVectorRestoreArrayRead(x, &a);
24   CeedVectorRestoreArray(x, &b);
25 
26   CeedVectorDestroy(&x);
27   CeedDestroy(&ceed);
28   return 0;
29   // LCOV_EXCL_STOP
30 }
31