2 * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include "../../../../inc/test.h"
19 #if (TEST_MODE == TEST_UNIT)
21 #include "unit_test_function.h"
23 extern char * __t__get_unit_log_buf(void);
25 static Eina_Bool __unit_test_write_log(void);
26 static Eina_Bool __unit_test_clear_log(void);
28 void unit_test_log_buf_function(void)
30 __unit_test_run_function( __unit_test_write_log() == EINA_TRUE);
31 __unit_test_run_function(__unit_test_clear_log() == EINA_TRUE);
34 static Eina_Bool __unit_test_write_log(void)
36 char * buf = __t__get_unit_log_buf();
38 TEST_ASSERT_EQUAL_STRING(buf, "");
40 unit_write_log("write");
41 unit_write_log("log");
43 TEST_ASSERT_EQUAL_STRING(buf, "write\nlog\n");
48 static Eina_Bool __unit_test_clear_log(void)
50 char * buf = __t__get_unit_log_buf();
52 TEST_ASSERT_EQUAL_STRING(buf, "clear");
56 TEST_ASSERT_EQUAL_STRING(buf, "");