2 * Copyright (c) 2016 Intel Corporation.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #include "test_tle_dring.h"
18 TEST_F(dring, test_dring_st)
20 printf("%s started;\n", __func__);
23 r = init_drb_ring(OBJ_NUM);
25 ASSERT_NE(r, (void *) NULL) << "Out of memory";
27 tle_dring_dump(stdout, 1, &dr);
29 memset(&arg, 0, sizeof(arg));
32 arg[0].iter = ITER_NUM;
33 arg[0].enq_type = SINGLE;
34 arg[0].deq_type = SINGLE;
35 rc = test_dring_enq_deq(&arg[0]);
37 rc = (rc != 0) ? rc : (arg[0].enq != arg[0].deq);
38 printf("%s finished with status: %s(%d);\n",
39 __func__, strerror(-rc), rc);
41 tle_dring_dump(stdout, rc != 0, &dr);
47 TEST_F(dring ,test_dring_mp_mc)
49 rc = test_dring_mt(MULTI, MULTI, MULTI, MULTI);
53 TEST_F(dring, test_dring_mp_sc)
55 rc = test_dring_mt(MULTI, SINGLE, MULTI, NONE);
59 TEST_F(dring, test_dring_sp_mc)
61 rc = test_dring_mt(SINGLE, MULTI, NONE, MULTI);