Permalink
Browse files

Rearrange parameter unit tests so they are in alphabetical order.

  • Loading branch information...
1 parent 67a484a commit e57f6221b206baced87c9b6f52731fb1441f22e6 @stephanbro stephanbro committed with bkueng Jan 5, 2017
Showing with 23 additions and 23 deletions.
  1. +1 −1 src/systemcmds/param/param.c
  2. +22 −22 unittests/param_test.cpp
@@ -351,7 +351,7 @@ do_find(const char *name)
return 1;
}
- printf("Found param %s at index %"PRIxPTR"\n", name, ret);
+ printf("Found param %s at index %" PRIxPTR "\n", name, ret);
return 0;
}
@@ -39,10 +39,10 @@ void _add_parameters()
};
rc2_x.val.i = 16;
- param_array[0] = test_1;
- param_array[1] = test_2;
- param_array[2] = rc_x;
- param_array[3] = rc2_x;
+ param_array[0] = rc_x;
+ param_array[1] = rc2_x;
+ param_array[2] = test_1;
+ param_array[3] = test_2;
param_info_base = (struct param_info_s *) &param_array[0];
// needs to point at the end of the data,
// therefore number of params + 1
@@ -91,10 +91,10 @@ TEST(ParamTest, ResetAll)
param_reset_all();
- _assert_parameter_int_value((param_t)0, 2);
- _assert_parameter_int_value((param_t)1, 4);
- _assert_parameter_int_value((param_t)2, 8);
- _assert_parameter_int_value((param_t)3, 16);
+ _assert_parameter_int_value((param_t)0, 8);
+ _assert_parameter_int_value((param_t)1, 16);
+ _assert_parameter_int_value((param_t)2, 2);
+ _assert_parameter_int_value((param_t)3, 4);
}
TEST(ParamTest, ResetAllExcludesOne)
@@ -105,10 +105,10 @@ TEST(ParamTest, ResetAllExcludesOne)
const char *excludes[] = {"RC_X"};
param_reset_excludes(excludes, 1);
- _assert_parameter_int_value((param_t)0, 2);
- _assert_parameter_int_value((param_t)1, 4);
- _assert_parameter_int_value((param_t)2, 50);
- _assert_parameter_int_value((param_t)3, 16);
+ _assert_parameter_int_value((param_t)0, 50);
+ _assert_parameter_int_value((param_t)1, 16);
+ _assert_parameter_int_value((param_t)2, 2);
+ _assert_parameter_int_value((param_t)3, 4);
}
TEST(ParamTest, ResetAllExcludesTwo)
@@ -120,9 +120,9 @@ TEST(ParamTest, ResetAllExcludesTwo)
param_reset_excludes(excludes, 2);
_assert_parameter_int_value((param_t)0, 50);
- _assert_parameter_int_value((param_t)1, 4);
+ _assert_parameter_int_value((param_t)1, 16);
_assert_parameter_int_value((param_t)2, 50);
- _assert_parameter_int_value((param_t)3, 16);
+ _assert_parameter_int_value((param_t)3, 4);
}
TEST(ParamTest, ResetAllExcludesBoundaryCheck)
@@ -133,10 +133,10 @@ TEST(ParamTest, ResetAllExcludesBoundaryCheck)
const char *excludes[] = {"RC_X", "TEST_1"};
param_reset_excludes(excludes, 1);
- _assert_parameter_int_value((param_t)0, 2);
- _assert_parameter_int_value((param_t)1, 4);
- _assert_parameter_int_value((param_t)2, 50);
- _assert_parameter_int_value((param_t)3, 16);
+ _assert_parameter_int_value((param_t)0, 50);
+ _assert_parameter_int_value((param_t)1, 16);
+ _assert_parameter_int_value((param_t)2, 2);
+ _assert_parameter_int_value((param_t)3, 4);
}
TEST(ParamTest, ResetAllExcludesWildcard)
@@ -147,8 +147,8 @@ TEST(ParamTest, ResetAllExcludesWildcard)
const char *excludes[] = {"RC*"};
param_reset_excludes(excludes, 1);
- _assert_parameter_int_value((param_t)0, 2);
- _assert_parameter_int_value((param_t)1, 4);
- _assert_parameter_int_value((param_t)2, 50);
- _assert_parameter_int_value((param_t)3, 50);
+ _assert_parameter_int_value((param_t)0, 50);
+ _assert_parameter_int_value((param_t)1, 50);
+ _assert_parameter_int_value((param_t)2, 2);
+ _assert_parameter_int_value((param_t)3, 4);
}

0 comments on commit e57f622

Please sign in to comment.