void StdStringTestCase::StdConversion() { std::string strStd("std::string value"); wxStdWideString strStdWide(L"std::wstring value"); wxString s1(strStd); CPPUNIT_ASSERT_EQUAL( "std::string value", s1 ); wxString s2(strStdWide); CPPUNIT_ASSERT_EQUAL( "std::wstring value", s2 ); wxString s3; s3 = strStd; CPPUNIT_ASSERT_EQUAL( "std::string value", s3 ); s3 = strStdWide; CPPUNIT_ASSERT_EQUAL( "std::wstring value", s3 ); wxString s4("hello"); // wxString -> std::string conversion is only available in wxUSE_STL case, // because it conflicts with conversion to const char*/wchar_t*: #if wxUSE_STL std::string s5 = s4; CPPUNIT_ASSERT_EQUAL( "hello", s5 ); wxStdWideString s6 = s4; CPPUNIT_ASSERT_EQUAL( "hello", s6 ); #endif std::string s7(s4); CPPUNIT_ASSERT( s7 == "hello" ); wxStdWideString s8(s4); CPPUNIT_ASSERT( s8 == "hello" ); }
void StdStringTestCase::StdConstructors() { wxString s1(wxT("abcdefgh")), s2(wxT("abcdefghijklm"), 8), s3(wxT("abcdefghijklm")), s4(8, wxT('a')); wxString s5(s1), s6(s3, 0, 8), s7(s3.begin(), s3.begin() + 8); wxString s8(s1, 4, 8); CPPUNIT_ASSERT_EQUAL( wxT("abcdefgh"), s1 ); CPPUNIT_ASSERT_EQUAL( s1, s2 ); CPPUNIT_ASSERT_EQUAL( wxT("aaaaaaaa"), s4 ); CPPUNIT_ASSERT_EQUAL( wxT("abcdefgh"), s5 ); CPPUNIT_ASSERT_EQUAL( s1, s6 ); CPPUNIT_ASSERT_EQUAL( s1, s7 ); CPPUNIT_ASSERT_EQUAL( wxT("efgh"), s8 ); const char *pc = s1.c_str(); CPPUNIT_ASSERT_EQUAL( "bcd", wxString(pc + 1, pc + 4) ); const wchar_t *pw = s2.c_str(); CPPUNIT_ASSERT_EQUAL( "a", wxString(pw, pw + 1) ); }
bool assign_test( ) { bool rc = true; std::string s1( 5, 'x' ); const char *shrt_string = "Shorty"; const char *long_string = "This string is longer than 8 characters"; const std::string s2( shrt_string ); const std::string s3( long_string ); std::string s4( 5, 'x' ); std::string s5( 5, 'x' ); std::string s6( 5, 'x' ); std::string s7( 5, 'x' ); std::string s8( 5, 'x' ); std::string s9( 5, 'x' ); const char *raw = "This is a very, very long string"; s1 = s2; if( s1.size( ) != 6 || s1 != shrt_string || INSANE( s1 ) ) FAIL s1 = s3; if( s1.size( ) != 39 || s1 != long_string || INSANE( s1 ) ) FAIL s4 = shrt_string; if( s4.size( ) != 6 || s4 != shrt_string || INSANE( s4 ) ) FAIL s4 = long_string; if( s4.size( ) != 39 || s4 != long_string || INSANE( s4 ) ) FAIL s5 = 'y'; if( s5.size( ) != 1 || s5 != "y" || INSANE( s5 ) ) FAIL s6.assign( s3, 35, 5 ); if( s6.size( ) != 4 || s6 != "ters" || INSANE( s6 ) ) FAIL s6.assign( s3, 5, 16 ); if( s6.size( ) != 16 || s6 != "string is longer" || INSANE( s6 ) ) FAIL s7.assign( raw, 4 ); if( s7.size( ) != 4 || s7 != "This" || INSANE( s7 ) ) FAIL s7.assign( raw, 10 ); if( s7.size( ) != 10 || s7 != "This is a " || INSANE( s7 ) ) FAIL s8.assign( "Shorty" ); if( s8.size( ) != 6 || s8 != "Shorty" || INSANE( s8 ) ) FAIL s8.assign( long_string ); if( s8.size( ) != 39 || s8 != long_string || INSANE( s8 ) ) FAIL s9.assign( 7, 'x' ); if( s9.size( ) != 7 || s9 != "xxxxxxx" || INSANE( s9 ) ) FAIL s9.assign( 8, 'y' ); if( s9.size( ) != 8 || s9 != "yyyyyyyy" || INSANE( s9 ) ) FAIL return( rc ); }
int main() { // Step(a) - construct a triangular face. Arrangement_2 arr; Segment_2 s1(Point_2(667, 1000), Point_2(4000, 5000)); Segment_2 s2(Point_2(4000, 0), Point_2(4000, 5000)); Segment_2 s3(Point_2(667, 1000), Point_2(4000, 0)); Halfedge_handle e1 = arr.insert_in_face_interior(s1, arr.unbounded_face()); Vertex_handle v1 = e1->source(); Vertex_handle v2 = e1->target(); Halfedge_handle e2 = arr.insert_from_right_vertex(s2, v2); Vertex_handle v3 = e2->target(); arr.insert_at_vertices(s3, v3, v1); // Step (b) - create additional two faces inside the triangle. Point_2 p1(4000, 3666), p2(4000, 1000); Segment_2 s4(Point_2(4000, 5000), p1); Segment_2 s5(p1, p2); Segment_2 s6(Point_2(4000, 0), p2); Halfedge_handle e4 = arr.split_edge(e2, s4, Segment_2(Point_2(4000, 0), p1)); Vertex_handle w1 = e4->target(); Halfedge_handle e5 = arr.split_edge(e4->next(), s5, s6); Vertex_handle w2 = e5->target(); Halfedge_handle e6 = e5->next(); Segment_2 s7(p1, Point_2(3000, 2666)); Segment_2 s8(p2, Point_2(3000, 1333)); Segment_2 s9(Point_2(3000, 2666), Point_2(2000, 1666)); Segment_2 s10(Point_2(3000, 1333), Point_2(2000, 1666)); Segment_2 s11(Point_2(3000, 1333), Point_2(3000, 2666)); Halfedge_handle e7 = arr.insert_from_right_vertex(s7, w1); Vertex_handle v4 = e7->target(); Halfedge_handle e8 = arr.insert_from_right_vertex(s8, w2); Vertex_handle v5 = e8->target(); Vertex_handle v6 = arr.insert_in_face_interior(Point_2(2000, 1666), e8->face()); arr.insert_at_vertices(s9, v4, v6); arr.insert_at_vertices(s10, v5, v6); arr.insert_at_vertices(s11, v4, v5); // Step(c) - remove and merge faces to form a single hole in the traingle. arr.remove_edge(e7); arr.remove_edge(e8); e5 = arr.merge_edge(e5, e6, Segment_2(e5->source()->point(), e6->target()->point())); e2 = arr.merge_edge(e4, e5, s2); print_arrangement(arr); return 0; }
void Engine::LoadScores() { iHiScore[0]= 10000; iHiScore[1]= 9000; iHiScore[2]= 8000; iHiScore[3]= 7000; iHiScore[4]= 6000; iHiScore[5]= 5000; iHiScore[6]= 4000; iHiScore[7]= 3000; iHiScore[8]= 2000; iHiScore[9]= 1000; string s1("HOLD"); string s2("DOWN"); string s3("KEYS"); string s4("MARY"); string s5("ON"); string s6("MAIN"); string s7("PAGE"); string s8("FOR"); string s9("CHEAT"); string s10("*****"); gSerializer.ReadVariable("score.dat","1a",iHiScore[0]); gSerializer.ReadVariable("score.dat","1b",s1); gSerializer.ReadVariable("score.dat","2a",iHiScore[1]); gSerializer.ReadVariable("score.dat","2b",s2); gSerializer.ReadVariable("score.dat","3a",iHiScore[2]); gSerializer.ReadVariable("score.dat","3b",s3); gSerializer.ReadVariable("score.dat","4a",iHiScore[3]); gSerializer.ReadVariable("score.dat","4b",s4); gSerializer.ReadVariable("score.dat","5a",iHiScore[4]); gSerializer.ReadVariable("score.dat","5b",s5); gSerializer.ReadVariable("score.dat","6a",iHiScore[5]); gSerializer.ReadVariable("score.dat","6b",s6); gSerializer.ReadVariable("score.dat","7a",iHiScore[6]); gSerializer.ReadVariable("score.dat","7b",s7); gSerializer.ReadVariable("score.dat","8a",iHiScore[7]); gSerializer.ReadVariable("score.dat","8b",s8); gSerializer.ReadVariable("score.dat","9a",iHiScore[8]); gSerializer.ReadVariable("score.dat","9b",s9); gSerializer.ReadVariable("score.dat","10a",iHiScore[9]); gSerializer.ReadVariable("score.dat","10b",s10); strcpy(szHiScore[0],s1.c_str()); strcpy(szHiScore[1],s2.c_str()); strcpy(szHiScore[2],s3.c_str()); strcpy(szHiScore[3],s4.c_str()); strcpy(szHiScore[4],s5.c_str()); strcpy(szHiScore[5],s6.c_str()); strcpy(szHiScore[6],s7.c_str()); strcpy(szHiScore[7],s8.c_str()); strcpy(szHiScore[8],s9.c_str()); strcpy(szHiScore[9],s10.c_str()); }
void LDOMNameIdMap::dumpUnknownItems( FILE * f, int start_id ) { for (int i=start_id; i<m_size; i++) { if (m_by_id[i] != NULL) { lString8 s8( m_by_id[i]->value.c_str() ); fprintf( f, "%d %s\n", m_by_id[i]->id, s8.c_str() ); } } }
void StdStringTestCase::StdConversion() { std::string strStd("std::string value"); wxStdWideString strStdWide(L"std::wstring value"); wxString s1(strStd); CPPUNIT_ASSERT_EQUAL( "std::string value", s1 ); wxString s2(strStdWide); CPPUNIT_ASSERT_EQUAL( "std::wstring value", s2 ); wxString s3; s3 = strStd; CPPUNIT_ASSERT_EQUAL( "std::string value", s3 ); s3 = strStdWide; CPPUNIT_ASSERT_EQUAL( "std::wstring value", s3 ); wxString s4("hello"); // notice that implicit wxString -> std::string conversion is only // available in wxUSE_STL case, because it conflicts with conversion to // const char*/wchar_t* #if wxUSE_STL && wxUSE_UNSAFE_WXSTRING_CONV std::string s5 = s4; #else std::string s5 = s4.ToStdString(); #endif CPPUNIT_ASSERT_EQUAL( "hello", s5 ); #if wxUSE_STL wxStdWideString s6 = s4; #else wxStdWideString s6 = s4.ToStdWstring(); #endif CPPUNIT_ASSERT_EQUAL( "hello", s6 ); #if wxUSE_UNSAFE_WXSTRING_CONV std::string s7(s4); CPPUNIT_ASSERT( s7 == "hello" ); #endif wxStdWideString s8(s4); CPPUNIT_ASSERT( s8 == "hello" ); std::string s9("\xF0\x9F\x90\xB1\0\xE7\x8C\xAB", 9); /* U+1F431 U+0000 U+732B */ wxString s10 = wxString::FromUTF8(s9); CPPUNIT_ASSERT_EQUAL( s9, s10.ToStdString(wxConvUTF8) ); std::string s11("xyz\0\xFF", 5); /* an invalid UTF-8 sequence */ CPPUNIT_ASSERT_EQUAL( wxString::FromUTF8(s11), "" ); }
bool construct_test( ) { bool rc = true; std::string s1; std::string s2( "Hello, World" ); std::string s3( "Hello, World", 3 ); std::string s4( s2 ); std::string s5( s2, 7, 2 ); std::string s6( s2, 7, 1024 ); std::string s7( s2, 1 ); std::string s8( 16, 'x' ); if( s1.size( ) != 0 || s1 != "" || INSANE( s1 ) ) FAIL if( s2.size( ) != 12 || s2 != "Hello, World" || INSANE( s2 ) ) FAIL if( s3.size( ) != 3 || s3 != "Hel" || INSANE( s3 ) ) FAIL if( s4.size( ) != 12 || s4 != "Hello, World" || INSANE( s4 ) ) FAIL if( s5.size( ) != 2 || s5 != "Wo" || INSANE( s5 ) ) FAIL if( s6.size( ) != 5 || s6 != "World" || INSANE( s6 ) ) FAIL if( s7.size( ) != 11 || s7 != "ello, World" || INSANE( s7 ) ) FAIL if( s8.size( ) != 16 || s8 != "xxxxxxxxxxxxxxxx" || INSANE( s8 ) ) FAIL return( rc ); }
int test_serial() { tbb::flow::graph g; T bogus_value(-1); tbb::flow::sequencer_node<T> s(g, seq_inspector<T>()); tbb::flow::sequencer_node<T> s2(g, seq_inspector<T>()); T j = bogus_value; // // Rejects attempts to add / remove predecessor // Rejects request from empty Q // ASSERT( s.register_predecessor( s2 ) == false, NULL ); ASSERT( s.remove_predecessor( s2 ) == false, NULL ); ASSERT( s.try_get( j ) == false, NULL ); ASSERT( j == bogus_value, NULL ); // // In-order simple puts and gets // for (int i = 0; i < N; ++i) { bool msg = s.try_put( T(i) ); ASSERT( msg == true, NULL ); } for (int i = 0; i < N; ++i) { j = bogus_value; ASSERT(wait_try_get( g, s, j ) == true, NULL); ASSERT( i == j, NULL ); } j = bogus_value; g.wait_for_all(); ASSERT( s.try_get( j ) == false, NULL ); ASSERT( j == bogus_value, NULL ); // // Reverse-order simple puts and gets // for (int i = N-1; i >= 0; --i) { bool msg = s2.try_put( T(i) ); ASSERT( msg == true, NULL ); } for (int i = 0; i < N; ++i) { j = bogus_value; ASSERT(wait_try_get( g, s2, j ) == true, NULL); ASSERT( i == j, NULL ); } j = bogus_value; g.wait_for_all(); ASSERT( s2.try_get( j ) == false, NULL ); ASSERT( j == bogus_value, NULL ); // // Chained in-order simple puts and gets // tbb::flow::sequencer_node<T> s3(g, seq_inspector<T>()); tbb::flow::sequencer_node<T> s4(g, seq_inspector<T>()); tbb::flow::sequencer_node<T> s5(g, seq_inspector<T>()); tbb::flow::make_edge( s3, s4 ); tbb::flow::make_edge( s4, s5 ); for (int i = 0; i < N; ++i) { bool msg = s3.try_put( T(i) ); ASSERT( msg == true, NULL ); } for (int i = 0; i < N; ++i) { j = bogus_value; ASSERT(wait_try_get( g, s5, j ) == true, NULL); ASSERT( i == j, NULL ); } j = bogus_value; ASSERT( wait_try_get( g, s3, j ) == false, NULL ); ASSERT( wait_try_get( g, s4, j ) == false, NULL ); ASSERT( wait_try_get( g, s5, j ) == false, NULL ); ASSERT( j == bogus_value, NULL ); g.wait_for_all(); tbb::flow::remove_edge( s3, s4 ); ASSERT( s3.try_put( N ) == true, NULL ); ASSERT( wait_try_get( g, s4, j ) == false, NULL ); ASSERT( j == bogus_value, NULL ); ASSERT( wait_try_get( g, s5, j ) == false, NULL ); ASSERT( j == bogus_value, NULL ); ASSERT( wait_try_get( g, s3, j ) == true, NULL ); ASSERT( j == N, NULL ); // // Chained reverse-order simple puts and gets // tbb::flow::sequencer_node<T> s6(g, seq_inspector<T>()); tbb::flow::sequencer_node<T> s7(g, seq_inspector<T>()); tbb::flow::sequencer_node<T> s8(g, seq_inspector<T>()); tbb::flow::make_edge( s6, s7 ); tbb::flow::make_edge( s7, s8 ); for (int i = N-1; i >= 0; --i) { bool msg = s6.try_put( T(i) ); ASSERT( msg == true, NULL ); } for (int i = 0; i < N; ++i) { j = bogus_value; ASSERT( wait_try_get( g, s8, j ) == true, NULL ); ASSERT( i == j, NULL ); } j = bogus_value; ASSERT( wait_try_get( g, s6, j ) == false, NULL ); ASSERT( wait_try_get( g, s7, j ) == false, NULL ); ASSERT( wait_try_get( g, s8, j ) == false, NULL ); ASSERT( j == bogus_value, NULL ); g.wait_for_all(); tbb::flow::remove_edge( s6, s7 ); ASSERT( s6.try_put( N ) == true, NULL ); ASSERT( wait_try_get( g, s7, j ) == false, NULL ); ASSERT( j == bogus_value, NULL ); ASSERT( wait_try_get( g, s8, j ) == false, NULL ); ASSERT( j == bogus_value, NULL ); ASSERT( wait_try_get( g, s6, j ) == true, NULL ); ASSERT( j == N, NULL ); return 0; }
s8 f8() { return s8(); }
s8 CInifile::r_s8(LPCSTR S, LPCSTR L) { LPCSTR C = r_string(S,L); return s8(atoi(C)); }
String AirDC::OutputSerial(int mode) { String StreamOut; switch(mode) { case 1: //Measurements output { //_p,_T,_RH,_qc,AOA,AOS String s1(_p, 6); String s2(_T, 6); String s3(_RH, 6); String s4(_qc, 6); String s5(_AOA, 6); String s6(_AOS, 6); StreamOut="$TMO,"+s1+','+s2+','+s3+','+s4+','+s5+','+s6; //To read string on the other side /* if (Serial.find("$TMO,")) { _p = Serial.parseFloat(); // _T = Serial.parseFloat();// _RH = Serial.parseFloat();// _qc = Serial.parseFloat();// */ break; } case 2: //Air data output //_Rho,_IAS,_CAS,_TAS,_TASPCorrected,_M,_TAT,_h,_mu,_Re { String s1(_Rho, 6); String s2(_IAS, 6); String s3(_CAS, 6); String s4(_TAS, 6); String s5(_TASPCorrected, 6); String s6(_M, 6); String s7(_TAT, 6); String s8(_h, 6); String s9(_mu, 8); String s10(_Re, 6); StreamOut="$TAD,"+s1+','+s2+','+s3+','+s4+','+s5+','+s6+','+s7+','+s8+','+s9+','+s10; break; } case 3: //Measurements uncertainty output //_up,_uT,_uRH,_uqc { String s1(_up, 6); String s2(_uT, 6); String s3(_uRH, 6); String s4(_uqc, 6); StreamOut="$TMU,"+s1+','+s2+','+s3+','+s4; break; } case 4: //Air data uncertainty output //_uRho,_uIAS,_uCAS,_uTAS,_uTAT,_uh; { String s1(_uRho, 6); String s2(_uIAS, 6); String s3(_uCAS, 6); String s4(_uTAS, 6); String s5(_uTAT, 6); String s6(_uh, 6); StreamOut="$TAU,"+s1+','+s2+','+s3+','+s4+','+s5+','+s6; break; } case 51: //Output for Temperature Logger Example { String s1(_Rho, 6); String s2(_TAT, 2); String s3(_TAT-273.15, 2); String s4(_uTAT, 2); String s5(_p, 2); String s6(_mu, 6); String s7(hour()); String s8(minute()); String s9(second()); String s10(month()); String s11(day()); String s12(year()); String s13(millis()); StreamOut="$TEX,"+s1+','+s2+','+s3+','+s4+','+s5+','+s6+','+s7+','+s8+','+s9+','+s10+','+s11+','+s12+','+s13; break; } return StreamOut; } }
KTYPE deseval ( const KTYPE *p, const KTYPE *c, const KTYPE *k ) { aligned register KTYPE result = KCONST_1; aligned register KTYPE l0 = p[6]; aligned register KTYPE l1 = p[14]; aligned register KTYPE l2 = p[22]; aligned register KTYPE l3 = p[30]; aligned register KTYPE l4 = p[38]; aligned register KTYPE l5 = p[46]; aligned register KTYPE l6 = p[54]; aligned register KTYPE l7 = p[62]; aligned register KTYPE l8 = p[4]; aligned register KTYPE l9 = p[12]; aligned register KTYPE l10 = p[20]; aligned register KTYPE l11 = p[28]; aligned register KTYPE l12 = p[36]; aligned register KTYPE l13 = p[44]; aligned register KTYPE l14 = p[52]; aligned register KTYPE l15 = p[60]; aligned register KTYPE l16 = p[2]; aligned register KTYPE l17 = p[10]; aligned register KTYPE l18 = p[18]; aligned register KTYPE l19 = p[26]; aligned register KTYPE l20 = p[34]; aligned register KTYPE l21 = p[42]; aligned register KTYPE l22 = p[50]; aligned register KTYPE l23 = p[58]; aligned register KTYPE l24 = p[0]; aligned register KTYPE l25 = p[8]; aligned register KTYPE l26 = p[16]; aligned register KTYPE l27 = p[24]; aligned register KTYPE l28 = p[32]; aligned register KTYPE l29 = p[40]; aligned register KTYPE l30 = p[48]; aligned register KTYPE l31 = p[56]; aligned register KTYPE r0 = p[7]; aligned register KTYPE r1 = p[15]; aligned register KTYPE r2 = p[23]; aligned register KTYPE r3 = p[31]; aligned register KTYPE r4 = p[39]; aligned register KTYPE r5 = p[47]; aligned register KTYPE r6 = p[55]; aligned register KTYPE r7 = p[63]; aligned register KTYPE r8 = p[5]; aligned register KTYPE r9 = p[13]; aligned register KTYPE r10 = p[21]; aligned register KTYPE r11 = p[29]; aligned register KTYPE r12 = p[37]; aligned register KTYPE r13 = p[45]; aligned register KTYPE r14 = p[53]; aligned register KTYPE r15 = p[61]; aligned register KTYPE r16 = p[3]; aligned register KTYPE r17 = p[11]; aligned register KTYPE r18 = p[19]; aligned register KTYPE r19 = p[27]; aligned register KTYPE r20 = p[35]; aligned register KTYPE r21 = p[43]; aligned register KTYPE r22 = p[51]; aligned register KTYPE r23 = p[59]; aligned register KTYPE r24 = p[1]; aligned register KTYPE r25 = p[9]; aligned register KTYPE r26 = p[17]; aligned register KTYPE r27 = p[25]; aligned register KTYPE r28 = p[33]; aligned register KTYPE r29 = p[41]; aligned register KTYPE r30 = p[49]; aligned register KTYPE r31 = p[57]; s1 (r31 ^ k[47], r0 ^ k[11], r1 ^ k[26], r2 ^ k[3], r3 ^ k[13], r4 ^ k[41], &l8, &l16, &l22, &l30); s2 (r3 ^ k[27], r4 ^ k[6], r5 ^ k[54], r6 ^ k[48], r7 ^ k[39], r8 ^ k[19], &l12, &l27, &l1, &l17); s3 (r7 ^ k[53], r8 ^ k[25], r9 ^ k[33], r10 ^ k[34], r11 ^ k[17], r12 ^ k[5], &l23, &l15, &l29, &l5); s4 (r11 ^ k[4], r12 ^ k[55], r13 ^ k[24], r14 ^ k[32], r15 ^ k[40], r16 ^ k[20], &l25, &l19, &l9, &l0); s5 (r15 ^ k[36], r16 ^ k[31], r17 ^ k[21], r18 ^ k[8], r19 ^ k[23], r20 ^ k[52], &l7, &l13, &l24, &l2); s6 (r19 ^ k[14], r20 ^ k[29], r21 ^ k[51], r22 ^ k[9], r23 ^ k[35], r24 ^ k[30], &l3, &l28, &l10, &l18); s7 (r23 ^ k[2], r24 ^ k[37], r25 ^ k[22], r26 ^ k[0], r27 ^ k[42], r28 ^ k[38], &l31, &l11, &l21, &l6); s8 (r27 ^ k[16], r28 ^ k[43], r29 ^ k[44], r30 ^ k[1], r31 ^ k[7], r0 ^ k[28], &l4, &l26, &l14, &l20); s1 (l31 ^ k[54], l0 ^ k[18], l1 ^ k[33], l2 ^ k[10], l3 ^ k[20], l4 ^ k[48], &r8, &r16, &r22, &r30); s2 (l3 ^ k[34], l4 ^ k[13], l5 ^ k[4], l6 ^ k[55], l7 ^ k[46], l8 ^ k[26], &r12, &r27, &r1, &r17); s3 (l7 ^ k[3], l8 ^ k[32], l9 ^ k[40], l10 ^ k[41], l11 ^ k[24], l12 ^ k[12], &r23, &r15, &r29, &r5); s4 (l11 ^ k[11], l12 ^ k[5], l13 ^ k[6], l14 ^ k[39], l15 ^ k[47], l16 ^ k[27], &r25, &r19, &r9, &r0); s5 (l15 ^ k[43], l16 ^ k[38], l17 ^ k[28], l18 ^ k[15], l19 ^ k[30], l20 ^ k[0], &r7, &r13, &r24, &r2); s6 (l19 ^ k[21], l20 ^ k[36], l21 ^ k[31], l22 ^ k[16], l23 ^ k[42], l24 ^ k[37], &r3, &r28, &r10, &r18); s7 (l23 ^ k[9], l24 ^ k[44], l25 ^ k[29], l26 ^ k[7], l27 ^ k[49], l28 ^ k[45], &r31, &r11, &r21, &r6); s8 (l27 ^ k[23], l28 ^ k[50], l29 ^ k[51], l30 ^ k[8], l31 ^ k[14], l0 ^ k[35], &r4, &r26, &r14, &r20); s1 (r31 ^ k[11], r0 ^ k[32], r1 ^ k[47], r2 ^ k[24], r3 ^ k[34], r4 ^ k[5], &l8, &l16, &l22, &l30); s2 (r3 ^ k[48], r4 ^ k[27], r5 ^ k[18], r6 ^ k[12], r7 ^ k[3], r8 ^ k[40], &l12, &l27, &l1, &l17); s3 (r7 ^ k[17], r8 ^ k[46], r9 ^ k[54], r10 ^ k[55], r11 ^ k[13], r12 ^ k[26], &l23, &l15, &l29, &l5); s4 (r11 ^ k[25], r12 ^ k[19], r13 ^ k[20], r14 ^ k[53], r15 ^ k[4], r16 ^ k[41], &l25, &l19, &l9, &l0); s5 (r15 ^ k[2], r16 ^ k[52], r17 ^ k[42], r18 ^ k[29], r19 ^ k[44], r20 ^ k[14], &l7, &l13, &l24, &l2); s6 (r19 ^ k[35], r20 ^ k[50], r21 ^ k[45], r22 ^ k[30], r23 ^ k[1], r24 ^ k[51], &l3, &l28, &l10, &l18); s7 (r23 ^ k[23], r24 ^ k[31], r25 ^ k[43], r26 ^ k[21], r27 ^ k[8], r28 ^ k[0], &l31, &l11, &l21, &l6); s8 (r27 ^ k[37], r28 ^ k[9], r29 ^ k[38], r30 ^ k[22], r31 ^ k[28], r0 ^ k[49], &l4, &l26, &l14, &l20); s1 (l31 ^ k[25], l0 ^ k[46], l1 ^ k[4], l2 ^ k[13], l3 ^ k[48], l4 ^ k[19], &r8, &r16, &r22, &r30); s2 (l3 ^ k[5], l4 ^ k[41], l5 ^ k[32], l6 ^ k[26], l7 ^ k[17], l8 ^ k[54], &r12, &r27, &r1, &r17); s3 (l7 ^ k[6], l8 ^ k[3], l9 ^ k[11], l10 ^ k[12], l11 ^ k[27], l12 ^ k[40], &r23, &r15, &r29, &r5); s4 (l11 ^ k[39], l12 ^ k[33], l13 ^ k[34], l14 ^ k[10], l15 ^ k[18], l16 ^ k[55], &r25, &r19, &r9, &r0); s5 (l15 ^ k[16], l16 ^ k[7], l17 ^ k[1], l18 ^ k[43], l19 ^ k[31], l20 ^ k[28], &r7, &r13, &r24, &r2); s6 (l19 ^ k[49], l20 ^ k[9], l21 ^ k[0], l22 ^ k[44], l23 ^ k[15], l24 ^ k[38], &r3, &r28, &r10, &r18); s7 (l23 ^ k[37], l24 ^ k[45], l25 ^ k[2], l26 ^ k[35], l27 ^ k[22], l28 ^ k[14], &r31, &r11, &r21, &r6); s8 (l27 ^ k[51], l28 ^ k[23], l29 ^ k[52], l30 ^ k[36], l31 ^ k[42], l0 ^ k[8], &r4, &r26, &r14, &r20); s1 (r31 ^ k[39], r0 ^ k[3], r1 ^ k[18], r2 ^ k[27], r3 ^ k[5], r4 ^ k[33], &l8, &l16, &l22, &l30); s2 (r3 ^ k[19], r4 ^ k[55], r5 ^ k[46], r6 ^ k[40], r7 ^ k[6], r8 ^ k[11], &l12, &l27, &l1, &l17); s3 (r7 ^ k[20], r8 ^ k[17], r9 ^ k[25], r10 ^ k[26], r11 ^ k[41], r12 ^ k[54], &l23, &l15, &l29, &l5); s4 (r11 ^ k[53], r12 ^ k[47], r13 ^ k[48], r14 ^ k[24], r15 ^ k[32], r16 ^ k[12], &l25, &l19, &l9, &l0); s5 (r15 ^ k[30], r16 ^ k[21], r17 ^ k[15], r18 ^ k[2], r19 ^ k[45], r20 ^ k[42], &l7, &l13, &l24, &l2); s6 (r19 ^ k[8], r20 ^ k[23], r21 ^ k[14], r22 ^ k[31], r23 ^ k[29], r24 ^ k[52], &l3, &l28, &l10, &l18); s7 (r23 ^ k[51], r24 ^ k[0], r25 ^ k[16], r26 ^ k[49], r27 ^ k[36], r28 ^ k[28], &l31, &l11, &l21, &l6); s8 (r27 ^ k[38], r28 ^ k[37], r29 ^ k[7], r30 ^ k[50], r31 ^ k[1], r0 ^ k[22], &l4, &l26, &l14, &l20); s1 (l31 ^ k[53], l0 ^ k[17], l1 ^ k[32], l2 ^ k[41], l3 ^ k[19], l4 ^ k[47], &r8, &r16, &r22, &r30); s2 (l3 ^ k[33], l4 ^ k[12], l5 ^ k[3], l6 ^ k[54], l7 ^ k[20], l8 ^ k[25], &r12, &r27, &r1, &r17); s3 (l7 ^ k[34], l8 ^ k[6], l9 ^ k[39], l10 ^ k[40], l11 ^ k[55], l12 ^ k[11], &r23, &r15, &r29, &r5); s4 (l11 ^ k[10], l12 ^ k[4], l13 ^ k[5], l14 ^ k[13], l15 ^ k[46], l16 ^ k[26], &r25, &r19, &r9, &r0); s5 (l15 ^ k[44], l16 ^ k[35], l17 ^ k[29], l18 ^ k[16], l19 ^ k[0], l20 ^ k[1], &r7, &r13, &r24, &r2); s6 (l19 ^ k[22], l20 ^ k[37], l21 ^ k[28], l22 ^ k[45], l23 ^ k[43], l24 ^ k[7], &r3, &r28, &r10, &r18); s7 (l23 ^ k[38], l24 ^ k[14], l25 ^ k[30], l26 ^ k[8], l27 ^ k[50], l28 ^ k[42], &r31, &r11, &r21, &r6); s8 (l27 ^ k[52], l28 ^ k[51], l29 ^ k[21], l30 ^ k[9], l31 ^ k[15], l0 ^ k[36], &r4, &r26, &r14, &r20); s1 (r31 ^ k[10], r0 ^ k[6], r1 ^ k[46], r2 ^ k[55], r3 ^ k[33], r4 ^ k[4], &l8, &l16, &l22, &l30); s2 (r3 ^ k[47], r4 ^ k[26], r5 ^ k[17], r6 ^ k[11], r7 ^ k[34], r8 ^ k[39], &l12, &l27, &l1, &l17); s3 (r7 ^ k[48], r8 ^ k[20], r9 ^ k[53], r10 ^ k[54], r11 ^ k[12], r12 ^ k[25], &l23, &l15, &l29, &l5); s4 (r11 ^ k[24], r12 ^ k[18], r13 ^ k[19], r14 ^ k[27], r15 ^ k[3], r16 ^ k[40], &l25, &l19, &l9, &l0); s5 (r15 ^ k[31], r16 ^ k[49], r17 ^ k[43], r18 ^ k[30], r19 ^ k[14], r20 ^ k[15], &l7, &l13, &l24, &l2); s6 (r19 ^ k[36], r20 ^ k[51], r21 ^ k[42], r22 ^ k[0], r23 ^ k[2], r24 ^ k[21], &l3, &l28, &l10, &l18); s7 (r23 ^ k[52], r24 ^ k[28], r25 ^ k[44], r26 ^ k[22], r27 ^ k[9], r28 ^ k[1], &l31, &l11, &l21, &l6); s8 (r27 ^ k[7], r28 ^ k[38], r29 ^ k[35], r30 ^ k[23], r31 ^ k[29], r0 ^ k[50], &l4, &l26, &l14, &l20); s1 (l31 ^ k[24], l0 ^ k[20], l1 ^ k[3], l2 ^ k[12], l3 ^ k[47], l4 ^ k[18], &r8, &r16, &r22, &r30); s2 (l3 ^ k[4], l4 ^ k[40], l5 ^ k[6], l6 ^ k[25], l7 ^ k[48], l8 ^ k[53], &r12, &r27, &r1, &r17); s3 (l7 ^ k[5], l8 ^ k[34], l9 ^ k[10], l10 ^ k[11], l11 ^ k[26], l12 ^ k[39], &r23, &r15, &r29, &r5); s4 (l11 ^ k[13], l12 ^ k[32], l13 ^ k[33], l14 ^ k[41], l15 ^ k[17], l16 ^ k[54], &r25, &r19, &r9, &r0); s5 (l15 ^ k[45], l16 ^ k[8], l17 ^ k[2], l18 ^ k[44], l19 ^ k[28], l20 ^ k[29], &r7, &r13, &r24, &r2); s6 (l19 ^ k[50], l20 ^ k[38], l21 ^ k[1], l22 ^ k[14], l23 ^ k[16], l24 ^ k[35], &r3, &r28, &r10, &r18); s7 (l23 ^ k[7], l24 ^ k[42], l25 ^ k[31], l26 ^ k[36], l27 ^ k[23], l28 ^ k[15], &r31, &r11, &r21, &r6); s8 (l27 ^ k[21], l28 ^ k[52], l29 ^ k[49], l30 ^ k[37], l31 ^ k[43], l0 ^ k[9], &r4, &r26, &r14, &r20); s1 (r31 ^ k[6], r0 ^ k[27], r1 ^ k[10], r2 ^ k[19], r3 ^ k[54], r4 ^ k[25], &l8, &l16, &l22, &l30); s2 (r3 ^ k[11], r4 ^ k[47], r5 ^ k[13], r6 ^ k[32], r7 ^ k[55], r8 ^ k[3], &l12, &l27, &l1, &l17); s3 (r7 ^ k[12], r8 ^ k[41], r9 ^ k[17], r10 ^ k[18], r11 ^ k[33], r12 ^ k[46], &l23, &l15, &l29, &l5); s4 (r11 ^ k[20], r12 ^ k[39], r13 ^ k[40], r14 ^ k[48], r15 ^ k[24], r16 ^ k[4], &l25, &l19, &l9, &l0); s5 (r15 ^ k[52], r16 ^ k[15], r17 ^ k[9], r18 ^ k[51], r19 ^ k[35], r20 ^ k[36], &l7, &l13, &l24, &l2); s6 (r19 ^ k[2], r20 ^ k[45], r21 ^ k[8], r22 ^ k[21], r23 ^ k[23], r24 ^ k[42], &l3, &l28, &l10, &l18); s7 (r23 ^ k[14], r24 ^ k[49], r25 ^ k[38], r26 ^ k[43], r27 ^ k[30], r28 ^ k[22], &l31, &l11, &l21, &l6); s8 (r27 ^ k[28], r28 ^ k[0], r29 ^ k[1], r30 ^ k[44], r31 ^ k[50], r0 ^ k[16], &l4, &l26, &l14, &l20); s1 (l31 ^ k[20], l0 ^ k[41], l1 ^ k[24], l2 ^ k[33], l3 ^ k[11], l4 ^ k[39], &r8, &r16, &r22, &r30); s2 (l3 ^ k[25], l4 ^ k[4], l5 ^ k[27], l6 ^ k[46], l7 ^ k[12], l8 ^ k[17], &r12, &r27, &r1, &r17); s3 (l7 ^ k[26], l8 ^ k[55], l9 ^ k[6], l10 ^ k[32], l11 ^ k[47], l12 ^ k[3], &r23, &r15, &r29, &r5); s4 (l11 ^ k[34], l12 ^ k[53], l13 ^ k[54], l14 ^ k[5], l15 ^ k[13], l16 ^ k[18], &r25, &r19, &r9, &r0); s5 (l15 ^ k[7], l16 ^ k[29], l17 ^ k[23], l18 ^ k[38], l19 ^ k[49], l20 ^ k[50], &r7, &r13, &r24, &r2); s6 (l19 ^ k[16], l20 ^ k[0], l21 ^ k[22], l22 ^ k[35], l23 ^ k[37], l24 ^ k[1], &r3, &r28, &r10, &r18); s7 (l23 ^ k[28], l24 ^ k[8], l25 ^ k[52], l26 ^ k[2], l27 ^ k[44], l28 ^ k[36], &r31, &r11, &r21, &r6); s8 (l27 ^ k[42], l28 ^ k[14], l29 ^ k[15], l30 ^ k[31], l31 ^ k[9], l0 ^ k[30], &r4, &r26, &r14, &r20); s1 (r31 ^ k[34], r0 ^ k[55], r1 ^ k[13], r2 ^ k[47], r3 ^ k[25], r4 ^ k[53], &l8, &l16, &l22, &l30); s2 (r3 ^ k[39], r4 ^ k[18], r5 ^ k[41], r6 ^ k[3], r7 ^ k[26], r8 ^ k[6], &l12, &l27, &l1, &l17); s3 (r7 ^ k[40], r8 ^ k[12], r9 ^ k[20], r10 ^ k[46], r11 ^ k[4], r12 ^ k[17], &l23, &l15, &l29, &l5); s4 (r11 ^ k[48], r12 ^ k[10], r13 ^ k[11], r14 ^ k[19], r15 ^ k[27], r16 ^ k[32], &l25, &l19, &l9, &l0); s5 (r15 ^ k[21], r16 ^ k[43], r17 ^ k[37], r18 ^ k[52], r19 ^ k[8], r20 ^ k[9], &l7, &l13, &l24, &l2); s6 (r19 ^ k[30], r20 ^ k[14], r21 ^ k[36], r22 ^ k[49], r23 ^ k[51], r24 ^ k[15], &l3, &l28, &l10, &l18); s7 (r23 ^ k[42], r24 ^ k[22], r25 ^ k[7], r26 ^ k[16], r27 ^ k[31], r28 ^ k[50], &l31, &l11, &l21, &l6); s8 (r27 ^ k[1], r28 ^ k[28], r29 ^ k[29], r30 ^ k[45], r31 ^ k[23], r0 ^ k[44], &l4, &l26, &l14, &l20); s1 (l31 ^ k[48], l0 ^ k[12], l1 ^ k[27], l2 ^ k[4], l3 ^ k[39], l4 ^ k[10], &r8, &r16, &r22, &r30); s2 (l3 ^ k[53], l4 ^ k[32], l5 ^ k[55], l6 ^ k[17], l7 ^ k[40], l8 ^ k[20], &r12, &r27, &r1, &r17); s3 (l7 ^ k[54], l8 ^ k[26], l9 ^ k[34], l10 ^ k[3], l11 ^ k[18], l12 ^ k[6], &r23, &r15, &r29, &r5); s4 (l11 ^ k[5], l12 ^ k[24], l13 ^ k[25], l14 ^ k[33], l15 ^ k[41], l16 ^ k[46], &r25, &r19, &r9, &r0); s5 (l15 ^ k[35], l16 ^ k[2], l17 ^ k[51], l18 ^ k[7], l19 ^ k[22], l20 ^ k[23], &r7, &r13, &r24, &r2); s6 (l19 ^ k[44], l20 ^ k[28], l21 ^ k[50], l22 ^ k[8], l23 ^ k[38], l24 ^ k[29], &r3, &r28, &r10, &r18); s7 (l23 ^ k[1], l24 ^ k[36], l25 ^ k[21], l26 ^ k[30], l27 ^ k[45], l28 ^ k[9], &r31, &r11, &r21, &r6); s8 (l27 ^ k[15], l28 ^ k[42], l29 ^ k[43], l30 ^ k[0], l31 ^ k[37], l0 ^ k[31], &r4, &r26, &r14, &r20); s1 (r31 ^ k[5], r0 ^ k[26], r1 ^ k[41], r2 ^ k[18], r3 ^ k[53], r4 ^ k[24], &l8, &l16, &l22, &l30); s2 (r3 ^ k[10], r4 ^ k[46], r5 ^ k[12], r6 ^ k[6], r7 ^ k[54], r8 ^ k[34], &l12, &l27, &l1, &l17); s3 (r7 ^ k[11], r8 ^ k[40], r9 ^ k[48], r10 ^ k[17], r11 ^ k[32], r12 ^ k[20], &l23, &l15, &l29, &l5); s4 (r11 ^ k[19], r12 ^ k[13], r13 ^ k[39], r14 ^ k[47], r15 ^ k[55], r16 ^ k[3], &l25, &l19, &l9, &l0); s5 (r15 ^ k[49], r16 ^ k[16], r17 ^ k[38], r18 ^ k[21], r19 ^ k[36], r20 ^ k[37], &l7, &l13, &l24, &l2); s6 (r19 ^ k[31], r20 ^ k[42], r21 ^ k[9], r22 ^ k[22], r23 ^ k[52], r24 ^ k[43], &l3, &l28, &l10, &l18); s7 (r23 ^ k[15], r24 ^ k[50], r25 ^ k[35], r26 ^ k[44], r27 ^ k[0], r28 ^ k[23], &l31, &l11, &l21, &l6); s8 (r27 ^ k[29], r28 ^ k[1], r29 ^ k[2], r30 ^ k[14], r31 ^ k[51], r0 ^ k[45], &l4, &l26, &l14, &l20); s1 (l31 ^ k[19], l0 ^ k[40], l1 ^ k[55], l2 ^ k[32], l3 ^ k[10], l4 ^ k[13], &r8, &r16, &r22, &r30); s2 (l3 ^ k[24], l4 ^ k[3], l5 ^ k[26], l6 ^ k[20], l7 ^ k[11], l8 ^ k[48], &r12, &r27, &r1, &r17); s3 (l7 ^ k[25], l8 ^ k[54], l9 ^ k[5], l10 ^ k[6], l11 ^ k[46], l12 ^ k[34], &r23, &r15, &r29, &r5); s4 (l11 ^ k[33], l12 ^ k[27], l13 ^ k[53], l14 ^ k[4], l15 ^ k[12], l16 ^ k[17], &r25, &r19, &r9, &r0); s5 (l15 ^ k[8], l16 ^ k[30], l17 ^ k[52], l18 ^ k[35], l19 ^ k[50], l20 ^ k[51], &r7, &r13, &r24, &r2); s6 (l19 ^ k[45], l20 ^ k[1], l21 ^ k[23], l22 ^ k[36], l23 ^ k[7], l24 ^ k[2], &r3, &r28, &r10, &r18); s7 (l23 ^ k[29], l24 ^ k[9], l25 ^ k[49], l26 ^ k[31], l27 ^ k[14], l28 ^ k[37], &r31, &r11, &r21, &r6); s8 (l27 ^ k[43], l28 ^ k[15], l29 ^ k[16], l30 ^ k[28], l31 ^ k[38], l0 ^ k[0], &r4, &r26, &r14, &r20); s1 (r31 ^ k[33], r0 ^ k[54], r1 ^ k[12], r2 ^ k[46], r3 ^ k[24], r4 ^ k[27], &l8, &l16, &l22, &l30); result &= _mm_andnot_si128((l8 ^ c[5]), KCONST_1); result &= _mm_andnot_si128((l16 ^ c[3]), KCONST_1); result &= _mm_andnot_si128((l22 ^ c[51]), KCONST_1); result &= _mm_andnot_si128((l30 ^ c[49]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s2 (r3 ^ k[13], r4 ^ k[17], r5 ^ k[40], r6 ^ k[34], r7 ^ k[25], r8 ^ k[5], &l12, &l27, &l1, &l17); result &= _mm_andnot_si128((l12 ^ c[37]), KCONST_1); result &= _mm_andnot_si128((l27 ^ c[25]), KCONST_1); result &= _mm_andnot_si128((l1 ^ c[15]), KCONST_1); result &= _mm_andnot_si128((l17 ^ c[11]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s3 (r7 ^ k[39], r8 ^ k[11], r9 ^ k[19], r10 ^ k[20], r11 ^ k[3], r12 ^ k[48], &l23, &l15, &l29, &l5); result &= _mm_andnot_si128((l23 ^ c[59]), KCONST_1); result &= _mm_andnot_si128((l15 ^ c[61]), KCONST_1); result &= _mm_andnot_si128((l29 ^ c[41]), KCONST_1); result &= _mm_andnot_si128((l5 ^ c[47]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s4 (r11 ^ k[47], r12 ^ k[41], r13 ^ k[10], r14 ^ k[18], r15 ^ k[26], r16 ^ k[6], &l25, &l19, &l9, &l0); result &= _mm_andnot_si128((l25 ^ c[9]), KCONST_1); result &= _mm_andnot_si128((l19 ^ c[27]), KCONST_1); result &= _mm_andnot_si128((l9 ^ c[13]), KCONST_1); result &= _mm_andnot_si128((l0 ^ c[7]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s5 (r15 ^ k[22], r16 ^ k[44], r17 ^ k[7], r18 ^ k[49], r19 ^ k[9], r20 ^ k[38], &l7, &l13, &l24, &l2); result &= _mm_andnot_si128((l7 ^ c[63]), KCONST_1); result &= _mm_andnot_si128((l13 ^ c[45]), KCONST_1); result &= _mm_andnot_si128((l24 ^ c[1]), KCONST_1); result &= _mm_andnot_si128((l2 ^ c[23]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s6 (r19 ^ k[0], r20 ^ k[15], r21 ^ k[37], r22 ^ k[50], r23 ^ k[21], r24 ^ k[16], &l3, &l28, &l10, &l18); result &= _mm_andnot_si128((l3 ^ c[31]), KCONST_1); result &= _mm_andnot_si128((l28 ^ c[33]), KCONST_1); result &= _mm_andnot_si128((l10 ^ c[21]), KCONST_1); result &= _mm_andnot_si128((l18 ^ c[19]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s7 (r23 ^ k[43], r24 ^ k[23], r25 ^ k[8], r26 ^ k[45], r27 ^ k[28], r28 ^ k[51], &l31, &l11, &l21, &l6); result &= _mm_andnot_si128((l31 ^ c[57]), KCONST_1); result &= _mm_andnot_si128((l11 ^ c[29]), KCONST_1); result &= _mm_andnot_si128((l21 ^ c[43]), KCONST_1); result &= _mm_andnot_si128((l6 ^ c[55]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s8 (r27 ^ k[2], r28 ^ k[29], r29 ^ k[30], r30 ^ k[42], r31 ^ k[52], r0 ^ k[14], &l4, &l26, &l14, &l20); result &= _mm_andnot_si128((l4 ^ c[39]), KCONST_1); result &= _mm_andnot_si128((l26 ^ c[17]), KCONST_1); result &= _mm_andnot_si128((l14 ^ c[53]), KCONST_1); result &= _mm_andnot_si128((l20 ^ c[35]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s1 (l31 ^ k[40], l0 ^ k[4], l1 ^ k[19], l2 ^ k[53], l3 ^ k[6], l4 ^ k[34], &r8, &r16, &r22, &r30); result &= _mm_andnot_si128((r8 ^ c[4]), KCONST_1); result &= _mm_andnot_si128((r16 ^ c[2]), KCONST_1); result &= _mm_andnot_si128((r22 ^ c[50]), KCONST_1); result &= _mm_andnot_si128((r30 ^ c[48]), KCONST_1); ////if (eq(result, KCONST_0)) // //return (result); s2 (l3 ^ k[20], l4 ^ k[24], l5 ^ k[47], l6 ^ k[41], l7 ^ k[32], l8 ^ k[12], &r12, &r27, &r1, &r17); result &= _mm_andnot_si128((r12 ^ c[36]), KCONST_1); result &= _mm_andnot_si128((r27 ^ c[24]), KCONST_1); result &= _mm_andnot_si128((r1 ^ c[14]), KCONST_1); result &= _mm_andnot_si128((r17 ^ c[10]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s3 (l7 ^ k[46], l8 ^ k[18], l9 ^ k[26], l10 ^ k[27], l11 ^ k[10], l12 ^ k[55], &r23, &r15, &r29, &r5); result &= _mm_andnot_si128((r23 ^ c[58]), KCONST_1); result &= _mm_andnot_si128((r15 ^ c[60]), KCONST_1); result &= _mm_andnot_si128((r29 ^ c[40]), KCONST_1); result &= _mm_andnot_si128((r5 ^ c[46]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s4 (l11 ^ k[54], l12 ^ k[48], l13 ^ k[17], l14 ^ k[25], l15 ^ k[33], l16 ^ k[13], &r25, &r19, &r9, &r0); result &= _mm_andnot_si128((r25 ^ c[8]), KCONST_1); result &= _mm_andnot_si128((r19 ^ c[26]), KCONST_1); result &= _mm_andnot_si128((r9 ^ c[12]), KCONST_1); result &= _mm_andnot_si128((r0 ^ c[6]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s5 (l15 ^ k[29], l16 ^ k[51], l17 ^ k[14], l18 ^ k[1], l19 ^ k[16], l20 ^ k[45], &r7, &r13, &r24, &r2); result &= _mm_andnot_si128((r7 ^ c[62]), KCONST_1); result &= _mm_andnot_si128((r13 ^ c[44]), KCONST_1); result &= _mm_andnot_si128((r24 ^ c[0]), KCONST_1); result &= _mm_andnot_si128((r2 ^ c[22]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s6 (l19 ^ k[7], l20 ^ k[22], l21 ^ k[44], l22 ^ k[2], l23 ^ k[28], l24 ^ k[23], &r3, &r28, &r10, &r18); result &= _mm_andnot_si128((r3 ^ c[30]), KCONST_1); result &= _mm_andnot_si128((r28 ^ c[32]), KCONST_1); result &= _mm_andnot_si128((r10 ^ c[20]), KCONST_1); result &= _mm_andnot_si128((r18 ^ c[18]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s7 (l23 ^ k[50], l24 ^ k[30], l25 ^ k[15], l26 ^ k[52], l27 ^ k[35], l28 ^ k[31], &r31, &r11, &r21, &r6); result &= _mm_andnot_si128((r31 ^ c[56]), KCONST_1); result &= _mm_andnot_si128((r11 ^ c[28]), KCONST_1); result &= _mm_andnot_si128((r21 ^ c[42]), KCONST_1); result &= _mm_andnot_si128((r6 ^ c[54]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); s8 (l27 ^ k[9], l28 ^ k[36], l29 ^ k[37], l30 ^ k[49], l31 ^ k[0], l0 ^ k[21], &r4, &r26, &r14, &r20); result &= _mm_andnot_si128((r4 ^ c[38]), KCONST_1); result &= _mm_andnot_si128((r26 ^ c[16]), KCONST_1); result &= _mm_andnot_si128((r14 ^ c[52]), KCONST_1); result &= _mm_andnot_si128((r20 ^ c[34]), KCONST_1); //if (eq(result, KCONST_0)) //return (result); return (result); }
bool append_test( ) { bool rc = true; // The sizes of the test strings used here are intended to explore // both appending without reallocation and appending with re- // allocation. A string can not be reused between tests because // an enlarged capacity is never reduced. std::string s1( "123456" ); std::string s2( "x" ); s1 += s2; if( s1 != "123456x" || s1.size( ) != 7 || INSANE( s1 ) ) FAIL s1 += s2; if( s1 != "123456xx" || s1.size( ) != 8 || INSANE( s1 ) ) FAIL std::string s3( "123456" ); s3 += "x"; if( s3 != "123456x" || s3.size( ) != 7 || INSANE( s3 ) ) FAIL s3 += "y"; if( s3 != "123456xy" || s3.size( ) != 8 || INSANE( s3 ) ) FAIL std::string s4( "123456" ); s4 += 'x'; if( s4 != "123456x" || s4.size( ) != 7 || INSANE( s4 ) ) FAIL s4 += 'z'; if( s4 != "123456xz" || s4.size( ) != 8 || INSANE( s4 ) ) FAIL std::string s5( "123456" ); std::string s6( "Hello, World!" ); s5.append( s6, 12, 1 ); if( s5 != "123456!" || s5.size( ) != 7 || INSANE( s5 ) ) FAIL s5.append( s6, 0, 3 ); if( s5 != "123456!Hel" || s5.size( ) != 10 || INSANE( s5 ) ) FAIL std::string s7( "123456" ); s7.append( "fizzle", 1 ); if( s7 != "123456f" || s7.size( ) != 7 || INSANE( s7 ) ) FAIL s7.append( "fizzle", 3 ); if( s7 != "123456ffiz" || s7.size( ) != 10 || INSANE( s7 ) ) FAIL std::string s8( "123456" ); s8.append( "x" ); if( s8 != "123456x" || s8.size( ) != 7 || INSANE( s8 ) ) FAIL s8.append( "abc" ); if( s8 != "123456xabc" || s8.size( ) != 10 || INSANE( s8 ) ) FAIL std::string s9( "123456" ); s9.append( 1, 'x' ); if( s9 != "123456x" || s9.size( ) != 7 || INSANE( s9 ) ) FAIL s9.append( 3, 'y' ); if( s9 != "123456xyyy" || s9.size( ) != 10 || INSANE( s9 ) ) FAIL std::string s10( "123456" ); s10.push_back( 'z' ); if( s10 != "123456z" || s10.size( ) != 7 || INSANE( s10 ) ) FAIL s10.push_back( 'a' ); if( s10 != "123456za" || s10.size( ) != 8 || INSANE( s10 ) ) FAIL return( rc ); }
int run_main (int, ACE_TCHAR *[]) { ACE_START_TEST (ACE_TEXT ("SString_Test")); { /* Set #1 */ ACE_CString s0 ("hello"); ACE_CString s1 ("hello"); ACE_CString s2 ("world"); ACE_CString s3 ("ll"); ACE_CString s4 ("ello"); ACE_CString s5 = s1 + " " + s2; char single_character = 'z'; ACE_CString single_character_string (single_character); ACE_CString empty_string; ACE_CString zero_size_string (s1.c_str (), 0, 0, 1); if (ACE_CString::npos == 0) ACE_ERROR((LM_ERROR,"Set #1: npos is incorrect.\n")); // Not equal comparisons. Error if they are equal if (s1 == s2){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s1 == s5){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} // Equal comparisons. Error if they are not equal if (s1 != s1){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s1 != s0){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} // Substring match. Error if they are not equal if (s1.strstr (s2) != ACE_CString::npos){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s1.strstr (s3) != 2){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s3.strstr (s1) != ACE_CString::npos){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s1.strstr (s4) != 1){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} // Substring creation. Error if they are not equal if (s1.substring (0) != s1){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s1.substring (1) != s4){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s1.substring (2, 2) != s3){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s1.substring (0, 0) != empty_string){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s1.substring (4, 10).length () != 1){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} // Forward search. Error if they are not equal if (s1.find (s3) != 2){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s3.find (s1) != ACE_CString::npos){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s1.find (s3, 2) != 2){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s3.find (s1, 1) != ACE_CString::npos){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s1.find (s2) != ACE_CString::npos){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s1.find ('o') != 4){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} // Reverse search. Error if they are not equal if (s1.rfind ('l') != 3){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} if (s1.rfind ('l', 3) != 2){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} // Assignment. Error if they are not equal ACE_CString s6; s6 = s0; if (s6 != s0){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} s6 = s4; if (s4 != s6){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} s6 = s5; if (s6 != s5){ACE_ERROR((LM_ERROR,"Set #1:\n"));return 1;} } { /* Set #2 */ ACE_CString s0 = "hello"; ACE_CString s1 ("hello", 0, false); ACE_CString s2 ("world", 0, false); ACE_CString s3 ("ll", 0, false); ACE_CString s4 ("ello", 0, false); ACE_CString s5 = s1 + " " + s2; char single_character = 'z'; ACE_CString single_character_string (single_character); ACE_CString empty_string (0, 0, false); ACE_CString zero_size_string (s1.c_str (), 0, 0, false); // Not equal comparisons. Error if they are equal if (s1 == s2){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s1 == s5){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} // Equal comparisons. Error if they are not equal if (s1 != s1){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s1 != s0){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} // Substring match. Error if they are not equal if (s1.strstr (s2) != ACE_CString::npos){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s1.strstr (s3) != 2){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s3.strstr (s1) != ACE_CString::npos){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s1.strstr (s4) != 1){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} // Substring creation. Error if they are not equal if (s1.substring (0) != s1){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s1.substring (1) != s4){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s1.substring (2, 2) != s3){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s1.substring (0, 0) != empty_string){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} // Forward search. Error if they are not equal if (s1.find (s3) != 2){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s3.find (s1) != ACE_CString::npos){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s1.find (s3, 2) != 2){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s3.find (s1, 1) != ACE_CString::npos){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s1.find (s2) != ACE_CString::npos){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s1.find ('o') != 4){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} // Reverse search. Error if they are not equal if (s1.rfind ('l') != 3){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} if (s1.rfind ('l', 3) != 2){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} // Assignment. Error if they are not equal ACE_CString s6; s6 = s0; if (s6 != s0){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} s6 = s4; if (s4 != s6){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} s6 = s5; if (s6 != s5){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} // Clear. Error if they are not equal s0.clear(); if (s0.length() != 0){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} // Rep. Error if they are not equal ACE_Auto_Basic_Array_Ptr<char> s (s1.rep ()); if (ACE_OS::strlen (s.get ()) != s1.length ()) { ACE_ERROR((LM_ERROR,"Auto_ptr s:\n")); }; ACE_CString s7 (s.get ()); if (s1 != s7){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} } { /* Set #3 */ ACE_NS_WString s0 ("hello"); ACE_NS_WString s1 ("hello"); ACE_NS_WString s2 ("world"); ACE_NS_WString s3 ("ll"); ACE_NS_WString s4 ("ello"); ACE_NS_WString s5 = s1 + " " + s2; ACE_NS_WString s6 = ("hella"); // Same length as s1, off by one char. ACE_WCHAR_T single_character = 'z'; ACE_NS_WString single_character_string (single_character); ACE_NS_WString empty_string; ACE_NS_WString zero_size_string (s1.c_str (), 0, 0); // Not equal comparisons. Error if they are equal if (s1 == s2){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s1 == s5){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s1 == s6){ACE_ERROR((LM_ERROR,"Set #3: off-by-one failed\n"));return 1;} // Equal comparisons. Error if they are not equal if (s1 != s1){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s1 != s0){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} // Substring match. Error if they are not equal if (s1.strstr (s2) != ACE_NS_WString::npos){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s1.strstr (s3) != 2){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s3.strstr (s1) != ACE_NS_WString::npos){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s1.strstr (s4) != 1){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} // Substring creation. Error if they are not equal if (s1.substring (0) != s1){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s1.substring (1) != s4){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s1.substring (2, 2) != s3){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s1.substring (0, 0) != empty_string){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} // Forward search. Error if they are not equal if (s1.find (s3) != 2){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s3.find (s1) != ACE_NS_WString::npos){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s1.find (s3, 2) != 2){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s3.find (s1, 1) != ACE_NS_WString::npos){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s1.find (s2) != ACE_NS_WString::npos){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s1.find ('o') != 4){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} // Reverse search. Error if they are not equal if (s1.rfind ('l') != 3){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} if (s1.rfind ('l', 3) != 2){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} // Assignment. Error if they are not equal ACE_NS_WString s7; s7 = s0; if (s7 != s0){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} s7 = s4; if (s4 != s7){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} s7 = s5; if (s7 != s5){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} // Clear. Error if they are not equal s0.clear(); if (s0.length() != 0){ACE_ERROR((LM_ERROR,"Set #3:\n"));return 1;} } { /* Set #4 */ ACE_CString s1("dog"); ACE_CString s2("d"); if (s1 == s2){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} if (!(s1 > s2)){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} if (s1 < s2){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} ACE_CString s3 ("dog"); ACE_CString s4 ("dogbert"); if (s3 == s4){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} if (!(s3 < s4)){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} if (s3 > s4){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} ACE_CString s5 ("dogbert",3); ACE_CString s6 ("dogbert",5); if(s5 == s6){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} if(!(s5 < s6)){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} if(s5 > s6){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} ACE_CString s7 ("dogbert",4); ACE_CString s8 ("dogbert",2); if(s7 == s8){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} if(!(s7 > s8)){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} if(s7 < s8){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} ACE_CString s9 ("dogbert",3); ACE_CString s10 ("dogbert"); if(s9 == s10){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} if(!(s9 < s10)){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} if(s9 > s10){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} ACE_CString s11 ("dogbert",5); ACE_CString s12 ("dog"); if(s11 == s12){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} if(!(s11 > s12)){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} if(s11 < s12){ACE_ERROR((LM_ERROR,"Set #4:\n"));return 1;} s11.fast_clear (); if (s11.length () != 0) ACE_ERROR ((LM_ERROR, ACE_TEXT ("fast_clear didn't yield 0 length\n"))); } { // Set 1 for ACE_SString, which is not tested ACE_SString sstr; const char *old = sstr.rep (); const char *str = "What_a_day_it_has_been"; sstr.rep (const_cast<char *>(str)); ACE_SString tmp = sstr.substring (2, 300); if (tmp.length () == 300) ACE_ERROR ((LM_ERROR, "SString substring\n")); // Constring an ACE_SString without a character pointer or from an // existing ACE_SString causes memory to be allocated that will not // be delete (apparently by design). ACE_Allocator::instance ()->free (const_cast<char *> (old)); ACE_Allocator::instance ()->free (const_cast<char *> (tmp.rep ())); } int err = testConcatenation (); err += testIterator (); err += testConstIterator (); ACE_END_TEST; return err; }