Exemplo n.º 1
0
bool _test_assert_sequence(unsigned point, char *expected) {
  char *cp = tokens_buffer;
  while (cp < tokp) {
    if (*cp++ != *expected++)
     return _test_fail(point);
  }
  if (*expected)
    return _test_fail(point);
  clear_tokens();
  return FALSE;
}
Exemplo n.º 2
0
static void execute_test(const testcase_t *tcp) {

  /* Initialization */
  clear_tokens();
  test_local_fail = FALSE;

  if (tcp->setup != NULL)
    tcp->setup();
  tcp->execute();
  if (tcp->teardown != NULL)
    tcp->teardown();
}
Exemplo n.º 3
0
int main(void){
  char hoge[256] = "ps -xj | cat|cat2> test.txt&";
  hoge[0] = 'a';
  struct lexed_cmd lc;
  lc.isbg=0;
  lc.first = NULL;
  lc.last = NULL;
  lex_cmd(hoge, &lc);
  print_lexed_cmd(&lc);
  clear_tokens(&lc);
  return 0;
}
Exemplo n.º 4
0
bool _test_assert_sequence(char *expected, const char *msg) {
  char *cp = test_tokens_buffer;

  while (cp < test_tokp) {
    if (*cp++ != *expected++)
     return _test_fail(msg);
  }

  if (*expected)
    return _test_fail(msg);

  clear_tokens();

  return FALSE;
}
Exemplo n.º 5
0
/*
 * Test suite execution.
 */
static void execute_test(const struct testcase *tcp) {
  int i;

  /* Initialization */
  clear_tokens();
  local_fail = FALSE;
  for (i = 0; i < MAX_THREADS; i++)
    threads[i] = NULL;

  if (tcp->setup != NULL)
    tcp->setup();
  tcp->execute();
  if (tcp->teardown != NULL)
    tcp->teardown();

  test_wait_threads();
}