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 <UniquePtr.h>
21
22 #include "Log.h"
23
24
25
26 class LogTest : public testing::Test {
27 public:
28
29 };
30
31
TEST_F(LogTest,logTest)32 TEST_F(LogTest, logTest) {
33 Log::LogLevel level = Log::Instance()->getLogLevel();
34
35 // following lines should match. no automatic test yet..
36 // TODO make it automatic?
37 Log::Instance()->setLogLevel(Log::ELogV);
38 printf("printf %d %d %d %d %d %d\n", 0, 1, 2, 3, 4, 5);
39 LOGD( "logd %d %d %d %d %d %d", 0, 1, 2, 3, 4, 5);
40 LOGV( "logv %d %d %d %d %d %d", 0, 1, 2, 3, 4, 5);
41 LOGI( "logi %d %d %d %d %d %d", 0, 1, 2, 3, 4, 5);
42 LOGW( "logw %d %d %d %d %d %d", 0, 1, 2, 3, 4, 5);
43 LOGE( "loge %d %d %d %d %d %d", 0, 1, 2, 3, 4, 5);
44
45 int64_t a = 0;
46 int64_t b = 1;
47 int64_t c = 2;
48 int64_t d = 3;
49 int64_t e = 4;
50 int64_t f = 5;
51 printf("printf %lld %lld %lld %lld %lld %lld\n", a, b, c, d, e, f);
52 LOGD( "logd %lld %lld %lld %lld %lld %lld", a, b, c, d, e, f);
53 LOGV( "logv %lld %lld %lld %lld %lld %lld", a, b, c, d, e, f);
54 LOGI( "logi %lld %lld %lld %lld %lld %lld", a, b, c, d, e, f);
55 LOGW( "logw %lld %lld %lld %lld %lld %lld", a, b, c, d, e, f);
56 LOGE( "loge %lld %lld %lld %lld %lld %lld", a, b, c, d, e, f);
57
58 Log::Instance()->setLogLevel(level);
59 }
60
61
62
63