[med-svn] [odil] 01/03: Imported Upstream version 0.4.1

Julien Lamy lamy-guest at moszumanska.debian.org
Sun Feb 28 16:50:11 UTC 2016


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

lamy-guest pushed a commit to branch master
in repository odil.

commit 58ab0ebb808c388756756c7c2c22f77165c29482
Author: Julien Lamy <lamy at unistra.fr>
Date:   Sun Feb 28 16:08:48 2016 +0100

    Imported Upstream version 0.4.1
---
 .travis.yml           | 23 +++++++++++++++++------
 CMakeLists.txt        |  2 +-
 src/odil/base64.cpp   |  2 +-
 tests/code/base64.cpp | 25 +++++++++++++++++++++++++
 4 files changed, 44 insertions(+), 8 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 41f89da..ea77fb1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,12 @@
-sudo: required
-dist: trusty
 language: cpp
-compiler:
-  - gcc
+matrix:
+  include:
+    - os: linux
+      sudo: required
+      dist: trusty
+      compiler: gcc
+    - os: osx
+      compiler: clang
 addons:
   apt:
     packages:
@@ -16,15 +20,22 @@ addons:
     - libboost-test-dev
     - dcmtk
 before_install:
+  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
+  # JSONCpp conflicts with json-c
+  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew uninstall json-c; fi
+  # Boost is already installed with another version
+  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew unlink boost; brew install boost; fi
+  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install dcmtk icu4c jsoncpp; fi
   - pip install --user cpp-coveralls
 before_script:
   - export SRC_DIR=$PWD
   - mkdir build
   - cd build
   - export BIN_DIR=$PWD
-  - CMAKE_CXX_FLAGS="-std=c++0x"
+  - CMAKE_CXX_FLAGS="-std=c++11"
   - if [ "${CC}" = "gcc" ]; then CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} --coverage"; fi
-  - cmake -D CMAKE_CXX_FLAGS:STRING="${CMAKE_CXX_FLAGS}" -D CMAKE_BUILD_TYPE:STRING=Debug ../
+  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then CMAKE_ARGUMENTS="-D ICU_INCLUDE_DIR=/usr/local/opt/icu4c/include/ -D ICU_LIBRARY=/usr/local/opt/icu4c/lib/libicuuc.dylib"; fi
+  - cmake -D CMAKE_CXX_FLAGS:STRING="${CMAKE_CXX_FLAGS}" -D CMAKE_BUILD_TYPE:STRING=Debug ${CMAKE_ARGUMENTS} ../
 script:
   - make -j $(nproc)
   - export PATH=$PWD/tests/tools:$PATH
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1fe85f3..745308e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8)
 project("odil")
 set(odil_MAJOR_VERSION 0)
 set(odil_MINOR_VERSION 4)
-set(odil_PATCH_VERSION 0)
+set(odil_PATCH_VERSION 1)
 set(odil_VERSION 
     ${odil_MAJOR_VERSION}.${odil_MINOR_VERSION}.${odil_PATCH_VERSION})
 
diff --git a/src/odil/base64.cpp b/src/odil/base64.cpp
index f431e45..a26156c 100644
--- a/src/odil/base64.cpp
+++ b/src/odil/base64.cpp
@@ -23,7 +23,7 @@ std::string const symbols =
 std::string const reversed_symbols(
     "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" // Not used: 00-0F
     "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" // Not used: 10-1F
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" // Not used: 20-2F
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3e\x00\x00\x00\x3f" // Not used: 20-2A, 2C-2E
     "\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x00\x00\x00\x00\x00\x00" // 0-9
     "\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e" // A-O
     "\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x00\x00\x00\x00\x00" // P-Z
diff --git a/tests/code/base64.cpp b/tests/code/base64.cpp
index 96830f2..06a8fff 100644
--- a/tests/code/base64.cpp
+++ b/tests/code/base64.cpp
@@ -73,3 +73,28 @@ BOOST_AUTO_TEST_CASE(Decode3)
     test_decode(
         "TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZQ==", "Lorem ipsum dolor sit ame");
 }
+
+BOOST_AUTO_TEST_CASE(AllStates)
+{
+    uint8_t data[3];
+    uint8_t encoded[4];
+    uint8_t decoded[3];
+
+    for(int z=0; z<256; ++z)
+    {
+        for(int y=0; y<256; ++y)
+        {
+            for(int x=0; x<256; ++x)
+            {
+                data[0] = x;
+                data[1] = y;
+                data[2] = z;
+
+                odil::base64::encode(data, data+3, encoded);
+                odil::base64::decode(encoded, encoded+4, decoded);
+
+                BOOST_REQUIRE(std::equal(data, data+3, decoded));
+            }
+        }
+    }
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/odil.git



More information about the debian-med-commit mailing list