mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +02:00

Signed-off-by: Nikolai Artemiev <nartemiev@google.com> Change-Id: Ia964279ace569b4b93f4e2919c1c228a9b621745 Reviewed-on: https://review.coreboot.org/c/flashrom/+/45438 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
52 lines
1.4 KiB
C
52 lines
1.4 KiB
C
/*
|
|
* This file is part of the flashrom project.
|
|
*
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; version 2 of the License.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#include <include/test.h>
|
|
|
|
#include "programmer.h"
|
|
|
|
void flashbuses_to_text_test_success(void **state)
|
|
{
|
|
(void) state; /* unused */
|
|
|
|
enum chipbustype bustype;
|
|
|
|
bustype = BUS_NONSPI;
|
|
assert_string_equal(flashbuses_to_text(bustype), "Non-SPI");
|
|
|
|
bustype |= BUS_PARALLEL;
|
|
assert_string_not_equal(flashbuses_to_text(bustype), "Non-SPI, Parallel");
|
|
|
|
bustype = BUS_PARALLEL;
|
|
bustype |= BUS_LPC;
|
|
assert_string_equal(flashbuses_to_text(bustype), "Parallel, LPC");
|
|
|
|
bustype |= BUS_FWH;
|
|
//BUS_NONSPI = BUS_PARALLEL | BUS_LPC | BUS_FWH,
|
|
assert_string_equal(flashbuses_to_text(bustype), "Non-SPI");
|
|
|
|
bustype |= BUS_SPI;
|
|
assert_string_equal(flashbuses_to_text(bustype), "Parallel, LPC, FWH, SPI");
|
|
|
|
bustype |= BUS_PROG;
|
|
assert_string_equal(
|
|
flashbuses_to_text(bustype),
|
|
"Parallel, LPC, FWH, SPI, Programmer-specific"
|
|
);
|
|
|
|
bustype = BUS_NONE;
|
|
assert_string_equal(flashbuses_to_text(bustype), "None");
|
|
}
|