]> rtime.felk.cvut.cz Git - frescor/frsh.git/blobdiff - 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
index e89372707d1ae5a7fc9cea7f0285f77d945c13a1..53b852deb7da5fcadd50ca4f3155f07bc890225e 100644 (file)
@@ -6,15 +6,18 @@
 WVTEST_MAIN("transaction negotiation - remote part")
 {
        frsh_transaction_t t;
-       frsh_vres_id_t vres;
+       frsh_vres_id_t vres1, vres2;
        
        WVFRSH(frsh_init());
        WVFRSH(fra_dummy_init_and_activate_id(1));
+       WVFRSH(fra_dummy_init_and_activate_id(2));
 #if 0
        WVFRSH(frsh_transaction_wait_for_name(&t, "test"));
-       WVPASS(frsh_transaction_alloc_vres(&t, TEST_CONTRACT_2, &vres3) ==
-              FRES_ERR_VRES_ALREADY_ALLOCATED);
-       WVFRSH(frsh_transaction_alloc_vres(&t, TEST_CONTRACT_3, &vres3));
+#else
+       WVFRSH(frsh_transaction_init(&t, "test"));
 #endif 
+       WVPASS(frsh_transaction_alloc_vres(&t, TEST_CONTRACT_1, &vres1) ==
+              FRES_ERR_VRES_ALREADY_ALLOCATED);
+       WVFRSH(frsh_transaction_alloc_vres(&t, TEST_CONTRACT_2, &vres2));
        frsh_destroy();
 }