summaryrefslogtreecommitdiff
path: root/src/tests/tng_io_testing.c
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2014-09-26 11:13:01 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2014-09-26 11:16:32 (GMT)
commitecd5608f938835effe1c6058ab100d61219180f0 (patch)
tree41fb7b3e4f460bb521eea7e9176eb81e3423807c /src/tests/tng_io_testing.c
parentf007cd2af2835106bfe4ee5baff8f6962dd3f73c (diff)
Added tng_util_num_frames_with_data_of_block_id_get()
The function already existed in the tng_io.c, but has now been exposed through the API. Basic code for testing it was added as well. Version bumped to 1.7.0 Change-Id: Ia276ce3c7c9225f5d0d07eb6e3cd4cea6b882d24
Diffstat (limited to 'src/tests/tng_io_testing.c')
-rw-r--r--src/tests/tng_io_testing.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tests/tng_io_testing.c b/src/tests/tng_io_testing.c
index 7f778c0..c606217 100644
--- a/src/tests/tng_io_testing.c
+++ b/src/tests/tng_io_testing.c
@@ -1035,7 +1035,7 @@ tng_function_status tng_test_get_positions_data(tng_trajectory_t traj,
tng_function_status tng_test_utility_functions(tng_trajectory_t traj, const char hash_mode)
{
tng_function_status stat;
- int64_t n_particles, i, j, k, codec_id;
+ int64_t n_particles, i, j, k, codec_id, n_frames, n_frames_per_frame_set;
int64_t n_frames_to_read=30, stride_len, next_frame, n_blocks, *block_ids = 0;
double time, multiplier;
float *positions = 0;
@@ -1057,6 +1057,14 @@ tng_function_status tng_test_utility_functions(tng_trajectory_t traj, const char
return(stat);
}
+ tng_num_frames_per_frame_set_get(traj, &n_frames_per_frame_set);
+
+ stat = tng_util_num_frames_with_data_of_block_id_get(traj, TNG_TRAJ_POSITIONS, &n_frames);
+ if(stat != TNG_SUCCESS || n_frames != n_frames_per_frame_set * N_FRAME_SETS)
+ {
+ return(stat);
+ }
+
tng_num_particles_get(traj, &n_particles);
stat = tng_util_pos_read_range(traj, 1, n_frames_to_read, &positions, &stride_len);
contact: Jan Huwald // Impressum