blob: 3d58147541a97f9b74019d8b7c521863867cfd2d [file] [log] [blame]
Mark Salyzynd2e37472014-04-25 10:54:53 -07001/*
2 * Copyright (C) 2014 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
Mark Salyzynd2e37472014-04-25 10:54:53 -070017#include <gtest/gtest.h>
18
Elliott Hughes74c90522016-02-26 22:04:26 -080019#include <stdio.h>
Mark Salyzyndf0257d2015-01-14 09:40:54 -080020
21TEST(libc, __pstore_append) {
22 FILE *fp;
23 ASSERT_TRUE(NULL != (fp = fopen("/dev/pmsg0", "a")));
24 static const char message[] = "libc.__pstore_append\n";
25 ASSERT_EQ((size_t)1, fwrite(message, sizeof(message), 1, fp));
26 ASSERT_EQ(0, fclose(fp));
27 fprintf(stderr, "Reboot, ensure string libc.__pstore_append is in /sys/fs/pstore/pmsg-ramoops-0\n");
28}