1# Copyright (C) 2022 The Android Open Source Project 2# 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"""Contains tables for unittesting.""" 15 16from python.generators.trace_processor_table.public import Column as C 17from python.generators.trace_processor_table.public import ColumnFlag 18from python.generators.trace_processor_table.public import Table 19from python.generators.trace_processor_table.public import CppOptional 20from python.generators.trace_processor_table.public import CppUint32 21 22ROOT_TABLE = Table( 23 python_module=__file__, 24 class_name="RootTestTable", 25 sql_name="root_table", 26 columns=[ 27 C("root_sorted", CppUint32(), flags=ColumnFlag.SORTED), 28 C("root_non_null", CppUint32()), 29 C("root_non_null_2", CppUint32()), 30 C("root_nullable", CppOptional(CppUint32())), 31 ]) 32 33CHILD_TABLE = Table( 34 python_module=__file__, 35 class_name="ChildTestTable", 36 sql_name="child_table", 37 parent=ROOT_TABLE, 38 columns=[ 39 C("child_sorted", CppUint32(), flags=ColumnFlag.SORTED), 40 C("child_non_null", CppUint32()), 41 C("child_nullable", CppOptional(CppUint32())), 42 ]) 43 44# Keep this list sorted. 45ALL_TABLES = [ 46 ROOT_TABLE, 47 CHILD_TABLE, 48] 49