1/* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 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 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 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. 14 */ 15 16import { PayloadHead } from '../../../src/hdc/message/PayloadHead'; 17 18describe('PayloadHead Test', () => { 19 let payloadHead = new PayloadHead(); 20 it('PayloadHeadTest01', function () { 21 expect(payloadHead).not.toBeUndefined(); 22 }); 23 24 it('PayloadHeadTest02', function () { 25 expect(payloadHead.flag).toBeUndefined(); 26 }); 27 28 it('PayloadHeadTest03', function () { 29 payloadHead.flag = true; 30 expect(payloadHead.flag).toBeTruthy(); 31 }); 32 33 it('PayloadHeadTest04', function () { 34 expect(payloadHead.reserve).toBeUndefined(); 35 }); 36 37 it('PayloadHeadTest05', function () { 38 payloadHead.reserve = true; 39 expect(payloadHead.reserve).toBeTruthy(); 40 }); 41 42 it('PayloadHeadTest06', function () { 43 expect(payloadHead.protocolVer).toBeUndefined(); 44 }); 45 46 it('PayloadHeadTest07', function () { 47 payloadHead.protocolVer = true; 48 expect(payloadHead.protocolVer).toBeTruthy(); 49 }); 50 51 it('PayloadHeadTest08', function () { 52 expect(payloadHead.headSize).toBeUndefined(); 53 }); 54 55 it('PayloadHeadTest9', function () { 56 payloadHead.headSize = true; 57 expect(payloadHead.headSize).toBeTruthy(); 58 }); 59 60 it('PayloadHeadTest10', function () { 61 expect(payloadHead.dataSize).toBeUndefined(); 62 }); 63 64 it('PayloadHeadTest11', function () { 65 payloadHead.dataSize = true; 66 expect(payloadHead.dataSize).toBeTruthy(); 67 }); 68 69 it('PayloadHeadTest12', function () { 70 expect(payloadHead.toString()).toBeTruthy(); 71 }); 72 73 it('PayloadHeadTest13', function () { 74 expect(payloadHead.getPayloadHeadLength).toBe(undefined); 75 }); 76}); 77