1570af302Sopenharmony_ci#include <limits.h> 2570af302Sopenharmony_ci#include <stdio.h> 3570af302Sopenharmony_ci#include "test.h" 4570af302Sopenharmony_ci 5570af302Sopenharmony_ci#define TEST(c, ...) \ 6570af302Sopenharmony_ci ( (c) || (t_error(#c " failed: " __VA_ARGS__),0) ) 7570af302Sopenharmony_ci 8570af302Sopenharmony_ciint main(int argc, char **argv) 9570af302Sopenharmony_ci{ 10570af302Sopenharmony_ci char buf[PATH_MAX]; 11570af302Sopenharmony_ci TEST(argc == 1, "argc should be 1\n"); 12570af302Sopenharmony_ci TEST(argv[0] != 0, "argv[0] should not be NULL\n"); 13570af302Sopenharmony_ci TEST(argv[1] == 0, "argv[1] should be NULL\n"); 14570af302Sopenharmony_ci TEST(argv[0][0] != 0, "argv[0] should not be empty\n"); 15570af302Sopenharmony_ci TEST(snprintf(buf, sizeof buf, "%s", argv[0]) < sizeof buf, "argv[0] is not a valid path\n"); 16570af302Sopenharmony_ci return t_status; 17570af302Sopenharmony_ci} 18