Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90c2e75d authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "logcat: apct test failures"

parents 979ce0e3 3842b1a5
Loading
Loading
Loading
Loading
+42 −73
Original line number Diff line number Diff line
@@ -155,6 +155,10 @@ TEST(logcat, tz) {
        return;
    }

    int tries = 3; // in case run too soon after system start or buffer clear
    int count;

    do {
        FILE *fp;

        ASSERT_TRUE(NULL != (fp = popen(
@@ -163,7 +167,7 @@ TEST(logcat, tz) {

        char buffer[5120];

    int count = 0;
        count = 0;

        while (fgetLongTime(buffer, sizeof(buffer), fp)) {
            if (strstr(buffer, " -0700") || strstr(buffer, " -0800")) {
@@ -173,6 +177,8 @@ TEST(logcat, tz) {

        pclose(fp);

    } while ((count < 3) && --tries && (sleep(1), true));

    ASSERT_EQ(3, count);
}

@@ -198,36 +204,21 @@ TEST(logcat, ntz) {
    ASSERT_EQ(0, count);
}

TEST(logcat, tail_3) {
    FILE *fp;

    ASSERT_TRUE(NULL != (fp = popen(
      "logcat -v long -b radio -b events -b system -b main -t 3 2>/dev/null",
      "r")));
void do_tail(int num) {
    int tries = 3; // in case run too soon after system start or buffer clear
    int count;

    do {
        char buffer[5120];

    int count = 0;

    while (fgetLongTime(buffer, sizeof(buffer), fp)) {
        ++count;
    }

    pclose(fp);

    ASSERT_EQ(3, count);
}
        snprintf(buffer, sizeof(buffer),
          "logcat -v long -b radio -b events -b system -b main -t %d 2>/dev/null",
          num);

TEST(logcat, tail_10) {
        FILE *fp;
        ASSERT_TRUE(NULL != (fp = popen(buffer, "r")));

    ASSERT_TRUE(NULL != (fp = popen(
      "logcat -v long -b radio -b events -b system -b main -t 10 2>/dev/null",
      "r")));

    char buffer[5120];

    int count = 0;
        count = 0;

        while (fgetLongTime(buffer, sizeof(buffer), fp)) {
            ++count;
@@ -235,47 +226,25 @@ TEST(logcat, tail_10) {

        pclose(fp);

    ASSERT_EQ(10, count);
}

TEST(logcat, tail_100) {
    FILE *fp;
    } while ((count < num) && --tries && (sleep(1), true));

    ASSERT_TRUE(NULL != (fp = popen(
      "logcat -v long -b radio -b events -b system -b main -t 100 2>/dev/null",
      "r")));

    char buffer[5120];

    int count = 0;

    while (fgetLongTime(buffer, sizeof(buffer), fp)) {
        ++count;
    ASSERT_EQ(num, count);
}

    pclose(fp);

    ASSERT_EQ(100, count);
TEST(logcat, tail_3) {
    do_tail(3);
}

TEST(logcat, tail_1000) {
    FILE *fp;

    ASSERT_TRUE(NULL != (fp = popen(
      "logcat -v long -b radio -b events -b system -b main -t 1000 2>/dev/null",
      "r")));

    char buffer[5120];

    int count = 0;

    while (fgetLongTime(buffer, sizeof(buffer), fp)) {
        ++count;
TEST(logcat, tail_10) {
    do_tail(10);
}

    pclose(fp);
TEST(logcat, tail_100) {
    do_tail(100);
}

    ASSERT_EQ(1000, count);
TEST(logcat, tail_1000) {
    do_tail(1000);
}

TEST(logcat, tail_time) {