1d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov/* 2d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * Copyright (C) 2015 The Android Open Source Project 3d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * 4d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * Licensed under the Apache License, Version 2.0 (the "License"); 5d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * you may not use this file except in compliance with the License. 6d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * You may obtain a copy of the License at 7d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * 8d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * http://www.apache.org/licenses/LICENSE-2.0 9d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * 10d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * Unless required by applicable law or agreed to in writing, software 11d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * distributed under the License is distributed on an "AS IS" BASIS, 12d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * See the License for the specific language governing permissions and 14d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov * limitations under the License. 15d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov */ 16d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov 17d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov#include <gtest/gtest.h> 18d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov 1979b3877a137510946ddd39ab71c0badf1a769c11Dmitriy Ivanov#include <android/api-level.h> 2079b3877a137510946ddd39ab71c0badf1a769c11Dmitriy Ivanov 21d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanovextern "C" uint32_t android_get_application_target_sdk_version(); 22d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanovextern "C" void android_set_application_target_sdk_version(uint32_t target); 23d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov 24d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy IvanovTEST(libdl, application_sdk_versions_smoke) { 25d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov // Check initial values 2679b3877a137510946ddd39ab71c0badf1a769c11Dmitriy Ivanov ASSERT_EQ(static_cast<uint32_t>(__ANDROID_API__), android_get_application_target_sdk_version()); 27d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov 28d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov android_set_application_target_sdk_version(20U); 29d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov ASSERT_EQ(20U, android_get_application_target_sdk_version()); 30d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov 31d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov android_set_application_target_sdk_version(22U); 32d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov ASSERT_EQ(22U, android_get_application_target_sdk_version()); 33d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov} 34d8ead18145cba98fdc7256f9a0e69b8c1c90cd1cDmitriy Ivanov 35