1 /* 2 * Copyright (C) 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 * use this file except in compliance with the License. You may obtain a copy of 6 * 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, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations under 14 * the License. 15 */ 16 17 #include <stdint.h> 18 #include <gtest/gtest.h> 19 20 #include "Log.h" 21 22 23 24 class LogTest : public testing::Test { 25 public: 26 27 }; 28 29 30 TEST_F(LogTest, logTest) { 31 Log::LogLevel level = Log::Instance()->getLogLevel(); 32 33 // following lines should match. no automatic test yet.. 34 // TODO make it automatic? 35 Log::Instance()->setLogLevel(Log::ELogV); 36 printf("printf %d %d %d %d %d %d\n", 0, 1, 2, 3, 4, 5); 37 LOGD( "logd %d %d %d %d %d %d", 0, 1, 2, 3, 4, 5); 38 LOGV( "logv %d %d %d %d %d %d", 0, 1, 2, 3, 4, 5); 39 LOGI( "logi %d %d %d %d %d %d", 0, 1, 2, 3, 4, 5); 40 LOGW( "logw %d %d %d %d %d %d", 0, 1, 2, 3, 4, 5); 41 LOGE( "loge %d %d %d %d %d %d", 0, 1, 2, 3, 4, 5); 42 43 int64_t a = 0; 44 int64_t b = 1; 45 int64_t c = 2; 46 int64_t d = 3; 47 int64_t e = 4; 48 int64_t f = 5; 49 printf("printf %lld %lld %lld %lld %lld %lld\n", a, b, c, d, e, f); 50 LOGD( "logd %lld %lld %lld %lld %lld %lld", a, b, c, d, e, f); 51 LOGV( "logv %lld %lld %lld %lld %lld %lld", a, b, c, d, e, f); 52 LOGI( "logi %lld %lld %lld %lld %lld %lld", a, b, c, d, e, f); 53 LOGW( "logw %lld %lld %lld %lld %lld %lld", a, b, c, d, e, f); 54 LOGE( "loge %lld %lld %lld %lld %lld %lld", a, b, c, d, e, f); 55 56 Log::Instance()->setLogLevel(level); 57 } 58 59 60 61