-
Notifications
You must be signed in to change notification settings - Fork 1
/
test-serialization.cpp
39 lines (34 loc) · 1.55 KB
/
test-serialization.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* Copyright (C) 2019 Greenweaves Software Limited
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>
*
* This file exercises serialization.
*/
#include "catch.hpp"
#include "utils.h"
TEST_CASE( "Serialization Tests", "[serialization]" ) {
SECTION("Parse float") { // generated by configure.py --generate
REQUIRE(decode("4616224246936215212")==4.030756625208294);
REQUIRE(decode("-4612475610731443660")==-1.8246752887940945);
REQUIRE(decode("4613833480086692584")==2.9536645514639197);
REQUIRE(decode("-4607160261839865872")==-4.01967933385275);
REQUIRE(decode("4605089757188186448")==0.7676678895796076);
REQUIRE(decode("4616437541902921276")==4.220200611667277);
REQUIRE(decode("-4614149659537680952")==-1.4529617829879147);
REQUIRE(decode("4604075462835591144")==0.6550585951797503);
REQUIRE(decode("4612541954388984972")==2.3801119248678955);
REQUIRE(decode("-4611206721578964612")==-2.212850558699925);
}
}