Skip to content
Snippets Groups Projects
Commit 53347e2a authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

fix tests

parent de7dff8f
No related branches found
No related tags found
No related merge requests found
...@@ -119,7 +119,7 @@ extern "C" { ...@@ -119,7 +119,7 @@ extern "C" {
dataset_size, dataset_size,
auto_id != 0)); auto_id != 0));
} }
#define BUILD_WRAPPER asapo::RequestCallback wrapper = [ = ](asapo::RequestCallbackPayload payload, asapo::Error err) -> void { \ #define BUILD_WRAPPER asapo::RequestCallback wrapper = [ = ](asapo::RequestCallbackPayload payload, asapo::Error err) -> void { \
void* data = (void*) payload.data.release(); \ void* data = (void*) payload.data.release(); \
auto payLoadHandle = new AsapoHandlerHolder<asapo::RequestCallbackPayload>(&payload, false); \ auto payLoadHandle = new AsapoHandlerHolder<asapo::RequestCallbackPayload>(&payload, false); \
......
...@@ -56,6 +56,7 @@ void test_datasets(AsapoConsumerHandle consumer, AsapoStringHandle group_id) { ...@@ -56,6 +56,7 @@ void test_datasets(AsapoConsumerHandle consumer, AsapoStringHandle group_id) {
AsapoDataSetHandle ds = asapo_consumer_get_last_dataset(consumer, 0, "incomplete", &err); AsapoDataSetHandle ds = asapo_consumer_get_last_dataset(consumer, 0, "incomplete", &err);
ASSERT_TRUE(ds == NULL,"returns null in case of error"); ASSERT_TRUE(ds == NULL,"returns null in case of error");
ASSERT_TRUE(asapo_error_get_type(err) == kEndOfStream,"incomplete dataset end of stream error"); ASSERT_TRUE(asapo_error_get_type(err) == kEndOfStream,"incomplete dataset end of stream error");
asapo_free_handle(&ds);
// get dataset by id incomplete datasets without min_size // get dataset by id incomplete datasets without min_size
dataset = asapo_consumer_get_dataset_by_id(consumer,2, 0,"incomplete", &err); dataset = asapo_consumer_get_dataset_by_id(consumer,2, 0,"incomplete", &err);
......
...@@ -23,5 +23,4 @@ mkdir -p ${receiver_folder} ...@@ -23,5 +23,4 @@ mkdir -p ${receiver_folder}
echo test > file1 echo test > file1
#$@ 127.0.0.1:8400 $data_source $beamtime_id $@ 127.0.0.1:8400 $data_source $beamtime_id
/Users/yakubov/Projects/asapo/cmake-build-debug/tests/automatic/producer/c_api/producer_api_c 127.0.0.1:8400 c asapo_test
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
void callback(void* original_data, AsapoRequestCallbackPayloadHandle payload, AsapoErrorHandle error) { void callback(void* original_data, AsapoRequestCallbackPayloadHandle payload, AsapoErrorHandle error) {
EXIT_IF_ERROR("error after callback", error); EXIT_IF_ERROR("error after callback", error);
AsapoMessageDataHandle data_handle = asapo_request_callback_payload_get_data(payload);
AsapoStringHandle response = asapo_request_callback_payload_get_response(payload); AsapoStringHandle response = asapo_request_callback_payload_get_response(payload);
const struct AsapoGenericRequestHeader* header = asapo_request_callback_payload_get_original_header(payload); const struct AsapoGenericRequestHeader* header = asapo_request_callback_payload_get_original_header(payload);
ASSERT_EQ_INT(1,header->data_id,"data id"); ASSERT_EQ_INT(1,header->data_id,"data id");
ASSERT_EQ_STRING("hello",(const char*)original_data,"data in payload"); ASSERT_EQ_STRING("hello",(const char*)original_data,"data in payload");
asapo_free_handle(&data_handle); free(original_data);
asapo_free_handle(&response); asapo_free_handle(&response);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment