13 #include <gtest/gtest.h> 14 #include "../../include/ecl/converters_lite/byte_array.hpp" 26 TEST(ConverterTests,byteArrays) {
29 char three_six_three[4] = { 0x6b, 0x01, 0x00, 0x00 };
30 unsigned char u_three_six_three[4] = { 0x6b, 0x01, 0x00, 0x00 };
31 char minus_two[4] = { 0xfe, 0xff, 0xff, 0xff };
32 unsigned char u_minus_two[4] = { 0xfe, 0xff, 0xff, 0xff };
34 if (
debug_output ) { std::cout <<
"value: " << value << std::endl; }
37 if (
debug_output ) { std::cout <<
"value: " << u_value << std::endl; }
38 EXPECT_EQ(363,u_value);
40 if (
debug_output ) { std::cout <<
"value: " << value << std::endl; }
43 if (
debug_output ) { std::cout <<
"value: " << value << std::endl; }
51 int main(
int argc,
char **argv) {
53 testing::InitGoogleTest(&argc,argv);
54 return RUN_ALL_TESTS();
int main(int argc, char **argv)
void from_byte_array(int32 &value, const char *byte_array)
Converts an array of four char into a 32 bit integer.
TEST(ConverterTests, byteArrays)