1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #include <android-base/properties.h> 18 #include <gtest/gtest.h> 19 20 namespace android { 21 namespace modules { 22 namespace sdklevel { 23 24 namespace nostl { 25 bool IsAtLeastR(); 26 bool IsAtLeastS(); 27 bool IsAtLeastT(); 28 } // namespace nostl 29 30 class SdkLevelTest : public ::testing::Test { 31 protected: SdkLevelTest()32 SdkLevelTest() { 33 device_codename_ = 34 android::base::GetProperty("ro.build.version.codename", ""); 35 } 36 std::string device_codename_; 37 }; 38 TEST_F(SdkLevelTest,NoStlTest)39TEST_F(SdkLevelTest, NoStlTest) { 40 if ("REL" == device_codename_) { 41 GTEST_SKIP(); 42 } 43 44 EXPECT_TRUE(nostl::IsAtLeastR()); 45 EXPECT_TRUE(nostl::IsAtLeastS()); 46 EXPECT_TRUE(nostl::IsAtLeastT()); 47 } 48 49 } // namespace sdklevel 50 } // namespace modules 51 } // namespace android 52