1 # Copyright (c) 2019. Vinci Consulting Corp. All Rights Reserved.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 import vpp_papi_provider
21 class TestEndian(framework.VppTestCase):
24 def test_f64_endian_value(self):
26 rv = self.vapi.get_f64_endian_value(f64_one=F64_ONE)
27 self.assertEqual(rv.f64_one_result, F64_ONE,
28 "client incorrectly deserializes f64 values. "
29 "Expected: %r. Received: %r." % (
30 F64_ONE, rv.f64_one_result))
31 except vpp_papi_provider.UnexpectedApiReturnValueError:
32 self.fail('client incorrectly serializes f64 values.')
34 def test_get_f64_increment_by_one(self):
36 rv = self.vapi.get_f64_increment_by_one(f64_value=42.0)
37 self.assertEqual(rv.f64_value, expected, 'Expected %r, received:%r.'
38 % (expected, rv.f64_value))