MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / ACE_TMAIN

Function ACE_TMAIN

tests/DCPS/Serializer/SerializerTest.cpp:864–973  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

862}
863
864int
865ACE_TMAIN(int, ACE_TCHAR*[])
866{
867 const char string[] = "This is a test of the string serialization.";
868#ifdef DDS_HAS_WCHAR
869 const ACE_CDR::WChar wstring[] = L"This is a test of the wstring serialization.";
870#endif
871#ifndef OPENDDS_SAFETY_PROFILE
872 std::string stdstring = "This is a test of the std string serialization.";
873#ifdef DDS_HAS_WCHAR
874 std::wstring stdwstring = L"This is a test of the std wstring serialization.";
875#endif
876#endif
877
878 Values expected = {
879 0x01,
880#if OPENDDS_HAS_EXPLICIT_INTS
881 0x11,
882#endif
883 0x2345,
884 0x67abcdef,
885 ACE_INT64_LITERAL(0x0123456789abcdef),
886#if OPENDDS_HAS_EXPLICIT_INTS
887 0x22,
888#endif
889 0x0123,
890 0x456789ab,
891 ACE_UINT64_LITERAL(0xcdef0123456789ab),
892 0.1f,
893 0.2,
894#if ACE_SIZEOF_LONG_DOUBLE == 16
895 0x89abcdef01234567LL,
896#else
897 {{0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77}},
898#endif
899 0x1a,
900 0xb2,
901 const_cast<ACE_CDR::Char*>(string)
902#ifndef OPENDDS_SAFETY_PROFILE
903 , stdstring
904#endif
905#ifdef DDS_HAS_WCHAR
906 , const_cast<ACE_CDR::WChar*>(wstring)
907#ifndef OPENDDS_SAFETY_PROFILE
908 , stdwstring
909#endif
910#endif
911 };
912
913 ArrayValues expectedArray;
914
915 // Initialize the array
916 for (size_t i = 0; i < ARRAYSIZE; ++i) {
917 expectedArray.octetValue[i] = (0xff&i);
918#if OPENDDS_HAS_EXPLICIT_INTS
919 expectedArray.int8Value[i] = static_cast<ACE_CDR::Int8>(0xdd & i);
920#endif
921 expectedArray.shortValue[i] = (0xffff&i);

Callers

nothing calls this directly

Calls 7

runTestFunction · 0.85
runOverrunTestFunction · 0.85
runAlignmentTestFunction · 0.85
runAlignmentResetTestFunction · 0.85
runAlignmentOverrunTestFunction · 0.85
to_stringMethod · 0.45

Tested by

no test coverage detected