Skip to content

Commit

Permalink
#245 Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
minh1302 committed Oct 14, 2017
1 parent 11505f9 commit 729bb1b
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions kernel/Test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,29 +241,20 @@ void assertArrayAllType(ArrayList<Type> &expected,

for (index = 0; index < expectedSize; index++) {
if (expected.get(index) != actual.get(index)) {

String expectedString = expected.get(index).toString();
String actualString = actual.get(index).toString();

CTEST_ERR("%s:%d expected 0x%02x at offset %" PRIuMAX " got 0x%02x",
file, line, expected.get(index), (uintmax_t) index, actual.get(index));
file,
line,
expectedString.toString(),
(uintmax_t) index,
actualString.toString());
}
}
}

/**
* Get length of pointer
*
* @tparam Type
* @param target
* @return
*/
template<typename Type>
int lengthPointer(Type *target) {
if (target == nullptr) return 0;

Type *pointer;
for (pointer = target; *pointer; ++pointer);

return pointer - target;
}

#if !defined(ARRAY_SIZE)
#define ARRAY_SIZE(x) (sizeof((x)) / sizeof((x)[0]))
#endif
Expand Down

0 comments on commit 729bb1b

Please sign in to comment.