1 /*
2  * Copyright (c) 2021 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 
16 #ifndef ACELITE_JSI_INTERFACE_TDD_TEST_H
17 #define ACELITE_JSI_INTERFACE_TDD_TEST_H
18 
19 #ifdef TDD_ASSERTIONS
20 #include <climits>
21 #include <gtest/gtest.h>
22 #endif
23 
24 #include "acelite_config.h"
25 #include "jerryscript.h"
26 #include "js_config.h"
27 #include "jsi.h"
28 #include "test_common.h"
29 
30 namespace OHOS {
31 namespace ACELite {
32 #ifdef TDD_ASSERTIONS
33 using namespace std;
34 using namespace testing::ext;
35 class JsiInterfaceTddTest : public testing::Test {
36 #else
37 class JsiInterfaceTddTest {
38 #endif
39 public:
40     JsiInterfaceTddTest();
~JsiInterfaceTddTest()41     ~JsiInterfaceTddTest() {}
42     void SetUp();
43     void TearDown();
44     static void OnDestroy(int8_t statusCode);
45     static void OnTerminate(int8_t statusCode);
46     static JSIValue Setter(const JSIValue thisVal, const JSIValue args[], uint8_t argsNum);
47     static JSIValue Getter(const JSIValue thisVal, const JSIValue args[], uint8_t argsNum);
48     static JSIValue Function(const JSIValue thisVal, const JSIValue args[], uint8_t argsNum);
49     void JSIInterfaceTest001();
50     void JSIInterfaceTest002();
51     void JSIInterfaceTest003();
52     void JSIInterfaceTest004();
53     void JSIInterfaceTest005();
54     void JSIInterfaceTest006();
55     void JSIInterfaceTest007();
56     void JSIInterfaceTest008();
57     void JSIInterfaceTest009();
58     void JSIInterfaceTest010();
59 #if IS_ENABLED(JS_FWK_SYMBOL)
60     void JSIInterfaceTest011();
61 #endif // ENABLED(JS_FWK_SYMBOL)
62     void JSIInterfaceTest012();
63     void JSIInterfaceTest013();
64     void JSIInterfaceTest014();
65     void JSIInterfaceTest015();
66     void JSIInterfaceTest016();
67     void JSIInterfaceTest017();
68 #if IS_ENABLED(JS_FWK_TYPEDARRAY)
69     void JSIInterfaceTest018();
70     void JSIInterfaceTest019();
71 #endif // ENABLED(JS_FWK_TYPEDARRAY)
72     void JSIInterfaceTest020();
73     void JSIInterfaceTest021();
74     void JSIInterfaceTest022();
75     void JSIInterfaceTest023();
76     void JSIInterfaceTest024();
77     void JSIInterfaceTest025();
78     void JSIInterfaceTest026();
79     void JSIInterfaceTest027();
80     void JSIInterfaceTest028();
81     void JSIInterfaceTest029();
82     void JSIInterfaceTest030();
83     void JSIInterfaceTest031();
84     void JSIInterfaceTest032();
85     void JSIInterfaceTest033();
86     void JSIInterfaceTest034();
87     void JSIInterfaceTest035();
88     void JSIInterfaceTest036();
89     void JSIInterfaceTest037();
90     void JSIInterfaceTest038();
91     void RunTests();
92 };
93 } // namespace ACELite
94 } // namespace OHOS
95 
96 #endif // ACELITE_JSI_INTERFACE_TDD_TEST_H
97