xref: /libCEED/tests/t117-vector.c (revision cdf95791513f7c35170bef3ba2e19f272fe04533)
1 /// @file
2 /// Test CeedVector restore before get
3 /// \test Test CeedVector restore before get
4 #include <ceed.h>
5 
6 int main(int argc, char **argv) {
7   Ceed ceed;
8   CeedVector x;
9   CeedInt n = 10;
10   CeedScalar *a;
11 
12   CeedInit(argv[1], &ceed);
13 
14   CeedVectorCreate(ceed, n, &x);
15   CeedVectorSetValue(x, 0.0);
16 
17   // Should error because no GetArray was not called
18   CeedVectorRestoreArray(x, &a);
19 
20   // LCOV_EXCL_START
21   CeedVectorDestroy(&x);
22   CeedDestroy(&ceed);
23   return 0;
24   // LCOV_EXCL_STOP
25 }
26