Beispiel #1
0
  void test_a_is_third(void)
  {
    char vek[] = {'b','b','a','b','b'};
    int result = must_follow_a(vek,3,'a','b');
    TS_ASSERT_EQUALS( result , 0);

  }
 void test_d_( void )
 {
     char vek[] = {};
     int result = must_follow_a(vek, 0, 'a', 'b');
     TS_ASSERT_EQUALS(result, 0);
 }
 void test_c_length_off_by_one( void )
 {
     char vek[] = {'b', 'b', 'a', 'b', 'b'};
     int result = must_follow_a(vek, 3, 'a', 'b');
     TS_ASSERT_EQUALS(result, 0);
 }
 void test_b_repeated_twice( void )
 {
     char vek[] = {'a', 'b', 'a', 'b', 'x'};
     int result = must_follow_a(vek, 4, 'a', 'b');
     TS_ASSERT_EQUALS(result, 2);
 }
 void test_a_is_second_to_last( void )
 {
     char vek[] = {'x', 'x', 'a', 'b', 'x'};
     int result = must_follow_a(vek, 4, 'a', 'b');
     TS_ASSERT_EQUALS( result, 1);
 }
 void test_3( void ){
     char vek2[] = {'c', 'a', 'a', 'a', 'a'};
     int res = must_follow_a(vek2, 3, 'a', 'b');
     TS_ASSERT_EQUALS( res, 0);
 }
 void test_1( void )
 {
     char vek[] = {'x', 'a', 'b', 'x', 'a', 'b', 'x'};
     int result = must_follow_a(vek, 7, 'a', 'b');
     TS_ASSERT_EQUALS( result, 2);        
 }
Beispiel #8
0
 void test_is_failing (void) 
 {
   char vek[] = { 'a','b','a','b','a','b'};
   int result = must_follow_a(vek,5,'a','b');
   TS_ASSERT_EQUALS( result, 2);
 }
Beispiel #9
0
 // additional test of my own
 void test_a_is_second_and_fourth(void) 
 {
   char vek[] = { 'a','b','x','a','b'};
   int result = must_follow_a(vek,5,'a','b');
   TS_ASSERT_EQUALS( result, 2);
 }