[ismrmrd] 138/177: Removed obsolete tests directory.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:02:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag v1.1.0.beta.1
in repository ismrmrd.

commit bc0e6e88736cf2829b5da787d5f4f353326d89a8
Author: Souheil Inati <souheil.inati at nih.gov>
Date:   Tue Oct 14 14:42:08 2014 -0400

    Removed obsolete tests directory.
---
 tests/CMakeLists.txt             |   6 --
 tests/c++/CMakeLists.txt         |  22 ------
 tests/c++/t_image.cpp            |  30 --------
 tests/c++/t_ndarraycontainer.cpp | 145 ---------------------------------------
 tests/c++/t_template.cpp         |  20 ------
 tests/c/CMakeLists.txt           |  13 ----
 tests/c/t_cquaternions.cpp       |  45 ------------
 tests/c/t_cstructs.cpp           | 137 ------------------------------------
 tests/xml/CMakeLists.txt         |  16 -----
 tests/xml/test_meta.cpp          |  33 ---------
 tests/xml/test_xml.cpp           |  52 --------------
 11 files changed, 519 deletions(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
deleted file mode 100644
index 8af4d25..0000000
--- a/tests/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# enable ctest
-enable_testing()
-
-add_subdirectory(c)
-add_subdirectory(c++)
-add_subdirectory(xml)
diff --git a/tests/c++/CMakeLists.txt b/tests/c++/CMakeLists.txt
deleted file mode 100644
index d20b9be..0000000
--- a/tests/c++/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-enable_testing()
-
-include_directories(${ISMRMRD_SOURCE_DIR} ${ISMRMRD_SCHEMA_SOURCE_DIR})
-
-if(WIN32)
-    # building with xsd sources on Windows
-    set_source_files_properties(${XSDS_SOURCES} PROPERTIES GENERATED TRUE)
-    add_executable(t_ndarraycontainer t_ndarraycontainer.cpp ${XSDS_SOURCES})
-    target_link_libraries(t_ndarraycontainer ${XERCESC_LIBRARIES} ismrmrd)
-    add_test(t_ndarraycontainer ${CMAKE_CURRENT_BINARY_DIR}/t_ndarraycontainer)
-    add_executable(t_image t_image.cpp ${XSDS_SOURCES})
-    target_link_libraries(t_image ${XERCESC_LIBRARIES} ismrmrd)
-    add_test(t_image ${CMAKE_CURRENT_BINARY_DIR}/t_image)
-else(WIN32)
-    # linking with ismrmrd_xsd on Linux / OSX
-    add_executable(t_ndarraycontainer t_ndarraycontainer.cpp)
-    target_link_libraries(t_ndarraycontainer ismrmrd ismrmrd_xsd)
-    add_test(t_ndarraycontainer ${CMAKE_CURRENT_BINARY_DIR}/t_ndarraycontainer)
-    add_executable(t_image t_image.cpp)
-    target_link_libraries(t_image ismrmrd ismrmrd_xsd)
-    add_test(t_image ${CMAKE_CURRENT_BINARY_DIR}/t_image)
-endif(WIN32)
diff --git a/tests/c++/t_image.cpp b/tests/c++/t_image.cpp
deleted file mode 100644
index 528c47b..0000000
--- a/tests/c++/t_image.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <iostream>
-#include "ismrmrd_hdf5.h"
-#include "ismrmrd.hxx"
-
-int main (int args, char** argv) {
-
-    using namespace ISMRMRD;
-    
-    std::vector <unsigned> dims;
-    dims.push_back (32); 
-    dims.push_back (64);
-    dims.push_back (1);
-    dims.push_back (16); // channels
-    
-    Image<std::complex<float> > img_s (dims[0], dims[1], dims[2], dims[3]);
-
-    if (img_s.getNumberOfElements() != img_s.getData().size()) // dimensions and data size match?
-        return 1;
-    
-    /* This test should no longer be needed.
-    size_t img_s_gne = img_s.getNumberOfElements();
-    size_t img_s_e   = img_s.elements();
-
-    if (img_s_gne != img_s_e) // header and data match?
-        return 1;
-    */
-    
-    return 0;
-    
-}
diff --git a/tests/c++/t_ndarraycontainer.cpp b/tests/c++/t_ndarraycontainer.cpp
deleted file mode 100644
index 5feed2b..0000000
--- a/tests/c++/t_ndarraycontainer.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-#include <iostream>
-#include "ismrmrd_hdf5.h"
-#include "ismrmrd.hxx"
-#include <time.h>
-#include <stdlib.h>
-#include <limits>
-
-using namespace ISMRMRD;
-
-template<class T>
-struct populate;
-
-template<> struct populate <float> {
-
-    typedef float type;
-    
-    static void random (NDArrayContainer<type>& ndac) {
-        type mi = (type) std::numeric_limits<int>::max();
-        assert (ndac.is_consistent());
-        size_t j = ndac.elements();
-        for (size_t i=0; i<j; i++)
-            ndac[i] = 1.0 - 2.0 * (type)rand() / mi;
-    }
-
-};
-
-template<> struct populate <double> {
-    
-    typedef double type;
-    
-    static void random (NDArrayContainer<type>& ndac) {
-        type mi = (type) std::numeric_limits<int>::max();
-        assert (ndac.is_consistent());
-        size_t j = ndac.elements();
-        for (size_t i=0; i<j; i++)
-            ndac[i] = 1.0 - 2.0 * (type)rand() / mi;
-    }
-
-};
-
-template<> struct populate <std::complex<float> > {
-    
-    typedef float               rtype;
-    typedef std::complex<rtype> type;
-    
-    static void random (NDArrayContainer<type>& ndac) {
-        rtype mi = std::numeric_limits<int>::max();
-        assert (ndac.is_consistent());
-        size_t j = ndac.elements();
-        for (size_t i=0; i<j; i++)
-            ndac[i] = type(1.0, 1.0) - type(2.0 * (rtype)rand() / mi, 2.0 * (rtype)rand() / mi);
-    }
-    
-};
-
-template<> struct populate <std::complex<double> > {
-    
-    typedef double               rtype;
-    typedef std::complex<rtype> type;
-    
-    static void random (NDArrayContainer<type>& ndac) {
-        rtype mi = std::numeric_limits<int>::max();
-        assert (ndac.is_consistent());
-        size_t j = ndac.elements();
-        for (size_t i=0; i<j; i++)
-            ndac[i] = type(1.0, 1.0) - type(2.0 * (rtype)rand() / mi, 2.0 * (rtype)rand() / mi);
-    }
-    
-};
-
-template<> struct populate <int> {
-    
-    typedef int type;
-    
-    static void random (NDArrayContainer<type>& ndac) {
-        type mi = (type) std::numeric_limits<type>::max();
-        assert (ndac.is_consistent());
-        size_t j = ndac.elements();
-        for (size_t i=0; i<j; i++)
-            ndac[i] = rand();
-    }
-    
-};
-
-template<> struct populate <short> {
-    
-    typedef short type;
-    
-    static void random (NDArrayContainer<type>& ndac) {
-        type mi = (type) std::numeric_limits<type>::max();
-        assert (ndac.is_consistent());
-        size_t j = ndac.elements();
-        for (size_t i=0; i<j; i++)
-            ndac[i] = rand();
-    }
-    
-};
-
-template<> struct populate <long> {
-    
-    typedef long type;
-    
-    static void random (NDArrayContainer<type>& ndac) {
-        type mi = (type) std::numeric_limits<type>::max();
-        assert (ndac.is_consistent());
-        size_t j = ndac.elements();
-        for (size_t i=0; i<j; i++)
-            ndac[i] = rand();
-    }
-    
-};
-
-int main (int args, char** argv) {
-
-    srand(time(NULL));
-
-    std::vector <unsigned> dims;
-    dims.push_back (10);
-    dims.push_back (8);
-    dims.push_back (7);
-    
-    NDArrayContainer<float> ndac_s (dims);
-    populate<float>::random (ndac_s);
-    
-    NDArrayContainer<double> ndac_d (dims);
-    populate<double>::random (ndac_d);
-    
-    NDArrayContainer<std::complex<float> > ndac_c (dims);
-    populate<std::complex<float> >::random (ndac_c);
-    
-    NDArrayContainer<std::complex<double> > ndac_z (dims);
-    populate<std::complex<double> >::random (ndac_z);
-
-    NDArrayContainer<int> ndac_i (dims);
-    populate<int>::random (ndac_i);
-
-    NDArrayContainer<short> ndac_si (dims);
-    populate<short>::random (ndac_si);
-
-    NDArrayContainer<long> ndac_li (dims);
-    populate<long>::random (ndac_li);
-
-    return 0;
-    
-}
diff --git a/tests/c++/t_template.cpp b/tests/c++/t_template.cpp
deleted file mode 100644
index 444bc49..0000000
--- a/tests/c++/t_template.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <iostream>
-#include "ismrmrd_hdf5.h"
-#include "ismrmrd.hxx"
-
-template <T> random_fill () {
-}
-
-int main (int args, char** argv) {
-
-    std::vector <unsigned> dims;
-    dims.push_back (10);
-    dims.push_back (8);
-    dims.push_back (7);
-    
-    NDArrayContainer<float> ndcs (dims);
-
-    return 0;
-
-    
-}
diff --git a/tests/c/CMakeLists.txt b/tests/c/CMakeLists.txt
deleted file mode 100644
index 8fdcc1b..0000000
--- a/tests/c/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-enable_testing()
-include_directories(${ISMRMRD_SOURCE_DIR})
-
-add_executable(t_cstructs t_cstructs.cpp)
-add_test(t_cstructs ${CMAKE_CURRENT_BINARY_DIR}/t_cstructs)
-
-#add_executable(t_cquaternions ../../ismrmrd.h t_cquaternions.cpp)
-add_executable(t_cquaternions t_cquaternions.cpp)
-add_test(t_cquaternions ${CMAKE_CURRENT_BINARY_DIR}/t_cquaternions)
-
-if (NOT WIN32)
-    target_link_libraries(t_cquaternions m)
-endif (NOT WIN32)
diff --git a/tests/c/t_cquaternions.cpp b/tests/c/t_cquaternions.cpp
deleted file mode 100644
index c7894ba..0000000
--- a/tests/c/t_cquaternions.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "ismrmrd.h"
-
-
-int main(void)
-{
-    float read_dir[3] = {1.0, 0, 0};
-    float phase_dir[3] = {0, 1.0, 0};
-    float slice_dir[3] = {0, 0, 1.0};
-    float quaternion[4];
-
-    /* convert the direction vectors to a quaternion and verify */
-    ISMRMRD::directions_to_quaternion(read_dir, phase_dir, slice_dir, quaternion);
-
-    if (!((quaternion[0] == 0.0) && (quaternion[1] == 0.0) && (quaternion[2] == 0.0) && (quaternion[3] == 1.0))) {
-        return EXIT_FAILURE;
-    }
-
-    /* convert the quaternion back to direction cosines and verify */
-    ISMRMRD::quaternion_to_directions(quaternion, read_dir, phase_dir, slice_dir);
-    int rd = ((read_dir[0] == 1.0) && (read_dir[1] == 0.0) && (read_dir[2] == 0.0));
-    int pd = ((phase_dir[0] == 0.0) && (phase_dir[1] == 1.0) && (phase_dir[2] == 0.0));
-    int sd = ((slice_dir[0] == 0.0) && (slice_dir[1] == 0.0) && (slice_dir[2] == 1.0));
-
-    if (!(rd && pd && sd)) {
-        return EXIT_FAILURE;
-    }
-
-    /* check that determinant is > 0 */
-    if (ISMRMRD::sign_of_directions(read_dir, phase_dir, slice_dir) < 0) {
-        return EXIT_FAILURE;
-    }
-
-    /* flip sign of third column and check that determinant is < 0 */
-    slice_dir[0] = -slice_dir[0];
-    slice_dir[1] = -slice_dir[1];
-    slice_dir[2] = -slice_dir[2];
-    if (ISMRMRD::sign_of_directions(read_dir, phase_dir, slice_dir) > 0) {
-        return EXIT_FAILURE;
-    }
-
-    return EXIT_SUCCESS;
-}
diff --git a/tests/c/t_cstructs.cpp b/tests/c/t_cstructs.cpp
deleted file mode 100644
index 6f53a39..0000000
--- a/tests/c/t_cstructs.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-#include "ismrmrd.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-
-int main(void)
-{
-    int i;
-
-    ISMRMRD::EncodingCounters idx;
-
-    idx.kspace_encode_step_1 = 1;
-    idx.kspace_encode_step_2 = 2;
-    idx.average = 50;
-    idx.slice = 14;
-    idx.contrast = 5000;
-    idx.phase = 42;
-    idx.repetition = 2;
-    idx.set = 1;
-    idx.segment = 1;
-    for (i = 0; i < ISMRMRD_USER_INTS; i++) {
-        idx.user[i] = i * 42;
-    }
-
-    ISMRMRD::AcquisitionHeader acq_head;
-    acq_head.version = 1;
-    acq_head.flags = -1;
-    acq_head.measurement_uid = 12345;
-    acq_head.scan_counter = 512;
-    acq_head.acquisition_time_stamp = 1363104441;
-    for (i = 0; i < ISMRMRD_PHYS_STAMPS; i++) {
-        acq_head.physiology_time_stamp[i] = 1363106388;
-    }
-    acq_head.number_of_samples = 24;
-    acq_head.available_channels = 32;
-    acq_head.active_channels = 32;
-    for (i = 0; i < ISMRMRD_CHANNEL_MASKS; i++) {
-        acq_head.channel_mask[i] = -1;
-    }
-    acq_head.discard_pre = 2;
-    acq_head.discard_post = 2;
-    acq_head.center_sample = 12;
-    acq_head.encoding_space_ref = 1;
-    acq_head.trajectory_dimensions = 2;
-    acq_head.sample_time_us = 123.321;
-
-    acq_head.position[0] = -12.80f;
-    acq_head.position[1] = 0.23f;
-    acq_head.position[2] = 12.45f;
-
-    acq_head.read_dir[0] = 1;
-    acq_head.read_dir[1] = 0;
-    acq_head.read_dir[2] = 0;
-
-    acq_head.phase_dir[0] = 0;
-    acq_head.phase_dir[1] = 1;
-    acq_head.phase_dir[2] = 0;
-
-    acq_head.slice_dir[0] = 0;
-    acq_head.slice_dir[1] = 0;
-    acq_head.slice_dir[2] = 1;
-
-    acq_head.patient_table_position[0] = 0.0;
-    acq_head.patient_table_position[1] = 0.0;
-    acq_head.patient_table_position[2] = 2.13;
-
-    acq_head.idx = idx;
-    for (i = 0; i < ISMRMRD_USER_INTS; i++) {
-        acq_head.user_int[i] = i;
-    }
-    for (i = 0; i < ISMRMRD_USER_FLOATS; i++) {
-        acq_head.user_float[i] = (float)i;
-    }
-
-
-    ISMRMRD::ImageHeader img_head;
-    img_head.version = 1;
-    img_head.flags = -1;
-    img_head.measurement_uid = 12345;
-
-    img_head.matrix_size[0] = 128;
-    img_head.matrix_size[1] = 128;
-    img_head.matrix_size[2] = 0;
-
-    img_head.field_of_view[0] = 256.0;
-    img_head.field_of_view[1] = 256.0;
-    img_head.field_of_view[2] = 12.0;
-
-    img_head.channels = 32;
-
-    img_head.position[0] = -12.80f;
-    img_head.position[1] = 0.23f;
-    img_head.position[2] = 12.45f;
-
-    img_head.read_dir[0] = 1;
-    img_head.read_dir[1] = 0;
-    img_head.read_dir[2] = 0;
-
-    img_head.phase_dir[0] = 0;
-    img_head.phase_dir[1] = 1;
-    img_head.phase_dir[2] = 0;
-
-    img_head.slice_dir[0] = 0;
-    img_head.slice_dir[1] = 0;
-    img_head.slice_dir[2] = 1;
-
-    img_head.patient_table_position[0] = 0.0;
-    img_head.patient_table_position[1] = 0.0;
-    img_head.patient_table_position[2] = 2.13f;
-
-    img_head.average = 50;
-    img_head.slice = 14;
-    img_head.contrast = 5000;
-    img_head.phase = 42;
-    img_head.repetition = 2;
-    img_head.set = 1;
-
-    img_head.acquisition_time_stamp = 1363104441;
-
-    for (i = 0; i < ISMRMRD_PHYS_STAMPS; i++) {
-        img_head.physiology_time_stamp[i] = 1363106388;
-    }
-
-    img_head.image_data_type = ISMRMRD::DATA_FLOAT;
-    img_head.image_type = ISMRMRD::TYPE_MAGNITUDE;
-    img_head.image_index = 42;
-    img_head.image_series_index = 3;
-
-    for (i = 0; i < ISMRMRD_USER_INTS; i++) {
-        img_head.user_int[i] = i;
-    }
-    for (i = 0; i < ISMRMRD_USER_FLOATS; i++) {
-        img_head.user_float[i] = (float)i;
-    }
-
-    return EXIT_SUCCESS;
-}
diff --git a/tests/xml/CMakeLists.txt b/tests/xml/CMakeLists.txt
deleted file mode 100644
index 6329526..0000000
--- a/tests/xml/CMakeLists.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-add_executable(ismrmrd_test_xml
-  test_xml.cpp
-  pugixml.cpp
-)
-
-target_link_libraries(ismrmrd_test_xml ismrmrd)
-
-add_executable(ismrmrd_test_meta 
-  test_meta.cpp
-  pugixml.cpp
-)
-
-target_link_libraries(ismrmrd_test_meta ismrmrd)
-
-install (TARGETS ismrmrd_test_xml ismrmrd_test_meta DESTINATION bin)
-
diff --git a/tests/xml/test_meta.cpp b/tests/xml/test_meta.cpp
deleted file mode 100644
index 59bacdd..0000000
--- a/tests/xml/test_meta.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <iostream>
-#include <sstream>
-#include "ismrmrd_meta.h"
-
-
-int main(int argc, char** argv)
-{
-  std::cout << "Test routine for ISMRMRD meta data structures" << std::endl << std::endl;
-
-  ISMRMRD::MetaContainer h;
-
-  h.set("my_para","this is one value");
-  h.append("my_para",77887L);
-  h.append("my_para",1.66754);
-  h.append("my_para","Blah Blah");  
-  h.set("my_para_2",4L);
-  h.set("my_para_3",4.778);
-
-  std::stringstream str;
-  ISMRMRD::serialize(h,str);
-
-  std::cout << "Serialized version of header: " << std::endl;
-  std::cout << str.str() << std::endl;
-
-  ISMRMRD::MetaContainer h2;
-  std::string xml = str.str();
-  deserialize(xml.c_str(),h2);
-
-  std::cout << "Header after deserialization and serialization" << std::endl;
-  serialize(h2, std::cout);
-
-  return 0;
-}
diff --git a/tests/xml/test_xml.cpp b/tests/xml/test_xml.cpp
deleted file mode 100644
index db9abfe..0000000
--- a/tests/xml/test_xml.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-#include <iostream>
-#include <fstream>
-#include <streambuf>
-#include "ismrmrd_xml.h"
-#include "pugixml.hpp"
-
-int main(int argc, char** argv)
-{
-
-  if (argc < 2) {
-    std::cout << "Usage:\n\ttest_ismrmrd_xml <ismrmrd_xml_header.xml>\n" << std::endl;
-    return -1;
-  }
-
-  std::string filename(argv[1]);
-
-  std::cout << "ISMRMRD Header: " << filename << std::endl;
-
-  std::ifstream t(filename.c_str());
-  std::string xml((std::istreambuf_iterator<char>(t)),
-		  std::istreambuf_iterator<char>());
-
-  ISMRMRD::IsmrmrdHeader h;
-  deserialize(xml.c_str(),h);
-
-  pugi::xml_document doc;
-  pugi::xml_parse_result result = doc.load(xml.c_str());
-
-  std::ofstream raw("raw.xml");
-  std::ofstream proc("processed.xml");
-  
-
-  doc.save(raw);
-  serialize(h,proc);
-
-  /*
-  deserialize(xml->c_str(),h);
-
-  std::cout << "Resonance frequency: " << h.experimentalConditions.H1resonanceFrequency_Hz << std::endl;
-  std::cout << "TR: " << h.sequenceParameters.get().TR[0] << std::endl;
-  if (h.userParameters) {
-    std::cout << "User parameters found" << std::endl;
-    for (size_t i = 0; i < h.userParameters->userParameterLong.size(); i++) {
-      std::cout << "UserLong: " << h.userParameters->userParameterLong[i].name.c_str() << ", " 
-		<< h.userParameters->userParameterLong[i].value << std::endl;
-    }
-  }
-
-  serialize(h,std::cout);
-  */
-  return 0;
-}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ismrmrd.git



More information about the debian-science-commits mailing list