33 static bool check_bios_data_linux_test(
const char*
data) {
42 reinterpret_cast<const char*
>(
filename));
49 static void test_gcp_environment_check_success() {
51 GPR_ASSERT(check_bios_data_linux_test(
"Google"));
52 GPR_ASSERT(check_bios_data_linux_test(
"Google Compute Engine"));
54 GPR_ASSERT(check_bios_data_linux_test(
" Google "));
55 GPR_ASSERT(check_bios_data_linux_test(
"Google "));
56 GPR_ASSERT(check_bios_data_linux_test(
" Google"));
57 GPR_ASSERT(check_bios_data_linux_test(
" Google Compute Engine "));
58 GPR_ASSERT(check_bios_data_linux_test(
"Google Compute Engine "));
59 GPR_ASSERT(check_bios_data_linux_test(
" Google Compute Engine"));
61 GPR_ASSERT(check_bios_data_linux_test(
"\t\tGoogle Compute Engine\t"));
62 GPR_ASSERT(check_bios_data_linux_test(
"Google Compute Engine\n"));
63 GPR_ASSERT(check_bios_data_linux_test(
"\n\n\tGoogle Compute Engine \n\t\t"));
66 static void test_gcp_environment_check_failure() {
67 GPR_ASSERT(!check_bios_data_linux_test(
"non_existing-file"));
68 GPR_ASSERT(!check_bios_data_linux_test(
"Google-Chrome"));
69 GPR_ASSERT(!check_bios_data_linux_test(
"Amazon"));
70 GPR_ASSERT(!check_bios_data_linux_test(
"Google-Chrome\t\t"));
71 GPR_ASSERT(!check_bios_data_linux_test(
"Amazon"));
75 int main(
int ,
char** ) {
77 test_gcp_environment_check_success();
78 test_gcp_environment_check_failure();
84 int main(
int ,
char** ) {
return 0; }