"Fossies" - the Fresh Open Source Software Archive

Member "fimex-1.4.1/test/testBinaryConstants.cc" (30 Oct 2019, 1394 Bytes) of package /linux/privat/fimex-1.4.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /*
    2  * Fimex, testBinaryConstants.cc
    3  *
    4  * (C) Copyright 2009, met.no
    5  *
    6  * Project Info:  https://wiki.met.no/fimex/start
    7  *
    8  * This library is free software; you can redistribute it and/or modify it
    9  * under the terms of the GNU Lesser General Public License as published by
   10  * the Free Software Foundation; either version 2.1 of the License, or
   11  * (at your option) any later version.
   12  *
   13  * This library is distributed in the hope that it will be useful, but
   14  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   15  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
   16  * License for more details.
   17  *
   18  * You should have received a copy of the GNU Lesser General Public
   19  * License along with this library; if not, write to the Free Software
   20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
   21  * USA.
   22  *
   23  *  Created on: Sep 10, 2009
   24  *      Author: Heiko Klein
   25  */
   26 
   27 #include "testinghelpers.h"
   28 #include "fimex/binaryConstants.h"
   29 
   30 TEST4FIMEX_TEST_CASE(test_binaryConstants)
   31 {
   32     TEST4FIMEX_CHECK_EQ(0, binary<0>::value);
   33     TEST4FIMEX_CHECK_EQ(1, binary<01>::value);
   34     TEST4FIMEX_CHECK_EQ(64, binary<01000000>::value);
   35     TEST4FIMEX_CHECK(64 != binary<1000000>::value);                          // remember to take octal values
   36     TEST4FIMEX_CHECK_EQ(2097152, binary<01000000000000000000000ULL>::value); // large value
   37 }