xref: /libCEED/tests/t116-vector.c (revision 11b88dda510d0aa70e79dc59ad165e2a5539c3c3)
1 /// @file
2 /// Test CeedVectorDestroy state counter
3 /// \test Test CeedVectorDestroy state counter
4 #include <ceed.h>
5 
6 int main(int argc, char **argv) {
7   Ceed        ceed;
8   CeedVector  x;
9   CeedInt     len = 10;
10   CeedScalar *a;
11 
12   CeedInit(argv[1], &ceed);
13 
14   CeedVectorCreate(ceed, len, &x);
15   CeedVectorSetValue(x, 0.0);
16   CeedVectorGetArray(x, CEED_MEM_HOST, &a);
17 
18   // Write access not restored should generate an error
19   CeedVectorDestroy(&x);
20 
21   // LCOV_EXCL_START
22   CeedDestroy(&ceed);
23   return 0;
24   // LCOV_EXCL_STOP
25 }
26