]> rtime.felk.cvut.cz Git - frescor/frsh.git/blob - frsh_api/tests/trans_nego2.c
fcb: Do not allow multiple allocations of the same VRES (within a transaction)
[frescor/frsh.git] / frsh_api / tests / trans_nego2.c
1 #include <frsh.h>
2 #include <wvtest.h>
3 #include <res_dummy.h>
4 #include "trans_nego.h"
5
6 WVTEST_MAIN("transaction negotiation - remote part")
7 {
8         frsh_transaction_t t;
9         frsh_vres_id_t vres1, vres2;
10         
11         WVFRSH(frsh_init());
12         WVFRSH(fra_dummy_init_and_activate_id(1));
13         WVFRSH(fra_dummy_init_and_activate_id(2));
14 #if 0
15         WVFRSH(frsh_transaction_wait_for_name(&t, "test"));
16 #else
17         WVFRSH(frsh_transaction_init(&t, "test"));
18 #endif  
19         WVPASS(frsh_transaction_alloc_vres(&t, TEST_CONTRACT_1, &vres1) ==
20                FRES_ERR_VRES_ALREADY_ALLOCATED);
21         WVFRSH(frsh_transaction_alloc_vres(&t, TEST_CONTRACT_2, &vres2));
22         frsh_destroy();
23 }