// FikoPost portu testleri. Gomulu SQLite verileri gercek Python sqlite3 // ciktisidir (OrnekFikoNCDB / tezgahlar1.fikoDB semalariyla uretildi) — // geriye uyumlu okuma dogrudan bu baytlara karsi dogrulanir. #include "fiko_test.hpp" #include "post/fiko_post.hpp" #include #include #include using namespace fikatia::post; namespace { // ORNEK_NCDB: 3072 bayt (POSTLAR + sqlite_sequence, 512B sayfa, tasma zincirli blob) static const unsigned char ORNEK_NCDB[] = { 83,81,76,105,116,101,32,102,111,114,109,97,116,32,51,0, 2,0,1,1,0,64,32,32,0,0,0,2,0,0,0,6, 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4, 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 0,46,118,137,5,0,0,0,1,1,251,0,0,0,0,5, 1,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,6,1,6,0,0,0,3,1, 13,0,0,0,2,0,119,0,1,186,0,119,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,134,56,2,9,0,23,23,140,12, 49,0,51,65,68,69,95,50,70,105,110,105,115,0,1,2, 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34, 35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50, 51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66, 67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82, 83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98, 99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114, 115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130, 131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146, 147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162, 163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178, 179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194, 195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210, 211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226, 227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242, 243,244,245,246,247,248,249,250,251,252,253,254,255,0,1,2, 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34, 35,36,37,38,39,40,0,0,0,6,68,1,8,0,23,35, 48,0,0,65,65,68,69,95,49,75,97,98,97,32,105,115, 108,101,109,101,37,13,10,78,49,32,71,57,48,32,71,49, 55,13,10,37,13,10,50,48,49,54,45,48,50,45,50,50, 32,49,48,58,51,48,58,48,48,46,53,48,48,48,48,48, 13,0,0,0,1,0,75,0,0,75,0,67,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,6,2,6,0,0,0,0,0,131,50,1,7,23, 27,27,1,134,59,116,97,98,108,101,80,79,83,84,76,65, 82,80,79,83,84,76,65,82,2,67,82,69,65,84,69,32, 84,65,66,76,69,32,80,79,83,84,76,65,82,10,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,40,10,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,95,105,100,32,73,78,84,69, 71,69,82,32,80,82,73,77,65,82,89,32,75,69,89,32, 65,85,84,79,73,78,67,82,69,77,69,78,84,44,10,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,73,83,77, 73,32,84,69,88,84,44,10,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,65,67,73,75,76,65,77,65,32,84, 69,88,84,44,10,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,75,79,68,32,66,76,79,66,44,10,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,69,75,95,66,73, 76,71,73,76,69,82,32,66,76,79,66,44,10,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,82,69,83,73,77, 32,66,76,79,66,44,10,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,115,97,97,116,32,68,65,84,69,84,73, 77,69,10,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,41, 13,0,0,0,1,1,243,0,1,243,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,11,1,3,27,1,80,79,83,84,76,65,82,2, 13,0,0,0,1,1,174,0,1,174,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,2, 6,23,43,43,1,89,116,97,98,108,101,115,113,108,105,116, 101,95,115,101,113,117,101,110,99,101,115,113,108,105,116,101, 95,115,101,113,117,101,110,99,101,4,67,82,69,65,84,69, 32,84,65,66,76,69,32,115,113,108,105,116,101,95,115,101, 113,117,101,110,99,101,40,110,97,109,101,44,115,101,113,41, 0,0,0,0,41,42,43,44,45,46,47,48,49,50,51,52, 53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68, 69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84, 85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100, 101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116, 117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132, 133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148, 149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164, 165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180, 181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196, 197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212, 213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228, 229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244, 245,246,247,248,249,250,251,252,253,254,255,0,1,2,3,4, 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20, 21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36, 37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52, 53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68, 69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84, 85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100, 101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116, 117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132, 133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148, 149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164, 165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180, 181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196, 197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212, 213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228, 229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244, 245,246,247,248,249,250,251,252,253,254,255,123,107,117,114,101, 77,101,114,107,101,122,105,58,84,114,117,101,125,50,48,49, 54,45,48,50,45,50,50,32,49,49,58,48,48,58,48,48 }; // ORNEK_TEZGAHLAR: 2048 bayt (tezgahlar1.fikoDB semasi, 3 profil) static const unsigned char ORNEK_TEZGAHLAR[] = { 83,81,76,105,116,101,32,102,111,114,109,97,116,32,51,0, 2,0,1,1,0,64,32,32,0,0,0,2,0,0,0,4, 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4, 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 0,46,118,137,13,0,0,0,2,1,106,0,1,188,1,106, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,80,2,6,23,43,43, 1,89,116,97,98,108,101,115,113,108,105,116,101,95,115,101, 113,117,101,110,99,101,115,113,108,105,116,101,95,115,101,113, 117,101,110,99,101,4,67,82,69,65,84,69,32,84,65,66, 76,69,32,115,113,108,105,116,101,95,115,101,113,117,101,110, 99,101,40,110,97,109,101,44,115,101,113,41,132,57,1,7, 23,31,31,1,136,65,116,97,98,108,101,116,101,122,103,97, 104,108,97,114,116,101,122,103,97,104,108,97,114,2,67,82, 69,65,84,69,32,84,65,66,76,69,32,116,101,122,103,97, 104,108,97,114,10,40,10,32,32,32,32,105,0,0,0,3, 13,0,0,0,3,1,27,0,1,189,1,84,1,27,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,55,3,19,0,33, 53,8,17,0,9,19,8,0,0,0,8,0,0,0,0,1, 70,105,107,111,109,101,114,111,32,49,70,105,107,111,109,101, 114,111,95,49,32,95,46,70,105,107,117,114,97,108,78,67, 68,58,92,251,103,2,19,0,47,39,9,15,69,8,0,8, 0,0,0,9,37,17,25,23,9,70,105,116,101,99,32,84, 111,111,108,32,67,101,110,116,101,114,70,105,100,105,97,46, 70,105,107,117,114,97,108,72,80,114,103,92,80,121,83,99, 114,105,112,116,92,70,105,100,105,97,84,101,109,105,122,108, 101,46,112,121,49,57,50,46,49,54,56,46,48,46,51,50, 56,48,74,85,76,73,69,78,49,50,51,52,53,65,1,19, 0,23,41,8,17,0,8,13,8,0,0,0,8,37,17,25, 23,8,70,105,116,101,99,70,105,84,101,99,104,46,70,105, 107,117,114,97,108,78,67,49,57,50,46,49,54,56,46,48, 46,51,50,56,48,74,85,76,73,69,78,49,50,51,52,53, 0,0,0,0,100,32,73,78,84,69,71,69,82,32,80,82, 73,77,65,82,89,32,75,69,89,32,65,85,84,79,73,78, 67,82,69,77,69,78,84,44,10,32,32,32,32,105,115,109, 105,32,84,69,88,84,32,78,79,84,32,78,85,76,76,44, 10,32,32,32,32,107,117,114,97,108,68,111,115,121,97,115, 105,32,84,69,88,84,44,10,32,32,32,32,107,117,114,101, 77,101,114,107,101,122,105,32,73,78,84,32,68,69,70,65, 85,76,84,32,48,44,10,32,32,32,32,112,111,115,116,85, 122,97,110,116,105,115,105,32,84,69,88,84,32,68,69,70, 65,85,76,84,32,34,72,34,44,10,32,32,32,32,112,111, 115,116,68,117,122,101,110,108,101,109,101,80,114,111,103,114, 97,109,105,32,84,69,88,84,44,10,32,32,32,32,116,101, 122,103,97,104,75,108,97,115,111,114,117,65,107,116,105,102, 32,73,78,84,32,68,69,70,65,85,76,84,32,48,44,10, 32,32,32,32,116,101,122,103,97,104,75,108,97,115,111,114, 117,32,84,69,88,84,44,10,32,32,32,32,116,101,122,103, 97,104,80,114,111,103,114,97,109,105,65,107,116,105,102,32, 73,78,84,32,68,69,70,65,85,76,84,32,48,44,10,32, 32,32,32,116,101,122,103,97,104,80,114,111,103,114,97,109, 105,32,84,69,88,84,44,10,32,32,32,32,110,99,71,111, 110,100,101,114,109,101,80,114,111,103,114,97,109,105,32,84, 69,88,84,44,10,32,32,32,32,116,101,122,103,97,104,84, 101,109,105,122,108,101,80,114,111,103,114,97,109,105,32,84, 69,88,84,44,10,32,32,32,32,116,101,122,103,97,104,70, 116,112,65,107,116,105,102,32,73,78,84,32,68,69,70,65, 85,76,84,32,48,44,10,32,32,32,32,102,116,112,83,117, 110,117,99,117,65,100,114,101,115,105,32,84,69,88,84,44, 10,32,32,32,32,102,116,112,80,111,114,116,78,111,32,84, 69,88,84,44,10,32,32,32,32,102,116,112,75,117,108,108, 97,110,105,99,105,65,100,105,32,84,69,88,84,44,10,32, 32,32,32,102,116,112,83,105,102,114,101,115,105,32,84,69, 88,84,10,44,32,115,105,114,97,78,111,32,73,78,84,41, 13,0,0,0,1,1,241,0,1,241,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,13,1,3,31,1,116,101,122,103,97,104,108,97,114,3 }; std::filesystem::path testKlasoru(const char* alt) { const auto yol = std::filesystem::temp_directory_path() / "fikatia_post_test" / alt; std::filesystem::remove_all(yol); std::filesystem::create_directories(yol); return yol; } } // namespace FIKO_TEST(apt_satir_ayristirma) { AptKomut k = aptSatirAyristir("GOTO / 12.5, 0.0, 3.25"); FIKO_KONTROL(k.tip == AptTip::Goto); FIKO_KONTROL(k.kelime == "GOTO"); FIKO_KONTROL(k.sayilar.size() == 3); FIKO_YAKIN(k.sayilar[0], 12.5, 1e-12); FIKO_YAKIN(k.sayilar[2], 3.25, 1e-12); k = aptSatirAyristir("SPINDL/ RPM,12000,CLW"); FIKO_KONTROL(k.tip == AptTip::Spindl); FIKO_KONTROL(k.sayilar.size() == 1 && k.sayilar[0] == 12000.0); FIKO_KONTROL(k.secenekler.size() == 2 && k.secenekler[0] == "RPM" && k.secenekler[1] == "CLW"); k = aptSatirAyristir("PPRINT OPERASYON : KABA"); FIKO_KONTROL(k.tip == AptTip::Pprint && k.metin == "OPERASYON : KABA"); k = aptSatirAyristir("PARTNO KALIP_A"); FIKO_KONTROL(k.tip == AptTip::Partno && k.metin == "KALIP_A"); k = aptSatirAyristir("$$ ISLEM BASI"); FIKO_KONTROL(k.tip == AptTip::Yorum && k.metin == "ISLEM BASI"); k = aptSatirAyristir("rapid"); FIKO_KONTROL(k.tip == AptTip::Rapid); k = aptSatirAyristir("FEDRAT/ MMPM,800"); FIKO_KONTROL(k.tip == AptTip::Fedrat && k.sayilar.size() == 1 && k.sayilar[0] == 800.0); } FIKO_TEST(apt_devam_ve_yorum) { const char* icerik = "PARTNO PARCA\n" "$$ aciklama\n" "GOTO/ 15.5, 25.0, -2.$\n" "5\n" "FINI\n"; const std::vector komutlar = aptAyristir(icerik); FIKO_KONTROL(komutlar.size() == 4); FIKO_KONTROL(komutlar[0].tip == AptTip::Partno); FIKO_KONTROL(komutlar[1].tip == AptTip::Yorum); FIKO_KONTROL(komutlar[2].tip == AptTip::Goto); FIKO_KONTROL(komutlar[2].sayilar.size() == 3); FIKO_YAKIN(komutlar[2].sayilar[2], -2.5, 1e-12); FIKO_KONTROL(komutlar[3].tip == AptTip::Fini); FIKO_KONTROL(aptAyristir("").empty()); FIKO_KONTROL(aptSatirAyristir("").tip == AptTip::Diger); } FIKO_TEST(nc_uretimi_bicim) { const char* apt = "PARTNO KALIP_A\n" "$$ yorum satiri\n" "LOADTL/3\n" "SPINDL/ RPM,12000,CLW\n" "RAPID\n" "GOTO/ 10.0, 20.0, 5.0\n" "FEDRAT/ MMPM,800\n" "GOTO/ 10.0, 20.0, -2.5\n" "GOTO/ 15.5, 20.0, -2.5\n" "COOLNT/ON\n" "GOTO/ 15.5, 25.0, -2.5\n" "RAPID\n" "GOTO/ 15.5, 25.0, 50.0\n" "COOLNT/OFF\n" "END\n" "FINI\n"; NcUretici uretici; const std::string nc = uretici.uret(aptAyristir(apt)); const std::string beklenen = "%\r\n" "N1 G90 G17 G80 G94 G54 G49 G40 G98\r\n" "N2 (FIKO SYNTEC PROCESSOR)\r\n" "N3 (KALIP_A)\r\n" "N4 T3 M06\r\n" "N5 S12000 M03\r\n" "N6 G00 X10.000 Y20.000 Z5.000\r\n" "N7 G01 Z-2.500 F800\r\n" "N8 X15.500\r\n" "N9 M08\r\n" "N10 Y25.000\r\n" "N11 G00 Z50.000\r\n" "N12 M09\r\n" "N13 M05\r\n" "N14 M30\r\n" "%\r\n"; FIKO_KONTROL(nc == beklenen); } FIKO_TEST(tezgah_profilleri) { const Tezgahlar tz = Tezgahlar::veriden(ORNEK_TEZGAHLAR, sizeof(ORNEK_TEZGAHLAR)); FIKO_KONTROL(tz.sayisi() == 3); // ORDER BY siraNo: -5, 0, 1 FIKO_KONTROL(tz.tezgahlarTumu()[0].ismi == "Fikomero 1"); FIKO_KONTROL(tz.tezgahlarTumu()[1].ismi == "Fitec"); FIKO_KONTROL(tz.tezgahlarTumu()[2].ismi == "Fitec Tool Center"); FIKO_KONTROL(tz.metin() == "['Fikomero 1', 'Fitec', 'Fitec Tool Center']"); const auto ftc = tz.item("Fitec Tool Center"); FIKO_KONTROL(ftc.has_value()); FIKO_KONTROL(ftc->id == 2); FIKO_KONTROL(ftc->kureMerkezi == 1); FIKO_KONTROL(ftc->postUzantisi == "H"); FIKO_KONTROL(ftc->kuralDosyasi == "Fidia.Fikural"); FIKO_KONTROL(ftc->postDuzenlemeProgrami.has_value() && *ftc->postDuzenlemeProgrami == "Prg\\PyScript\\FidiaTemizle.py"); FIKO_KONTROL(ftc->tezgahFtpAktif == 1); FIKO_KONTROL(ftc->ftpSifresi.has_value() && *ftc->ftpSifresi == "12345"); FIKO_KONTROL(ftc->siraNo.has_value() && *ftc->siraNo == 1); const auto fitec = tz.item("Fitec"); FIKO_KONTROL(fitec.has_value()); // bos metin ("") NULL degildir — Python sqlite3 ayrimi korunur FIKO_KONTROL(fitec->tezgahKlasoru.has_value() && fitec->tezgahKlasoru->empty()); FIKO_KONTROL(!fitec->postDuzenlemeProgrami.has_value()); const auto fikomero = tz.item("Fikomero 1"); FIKO_KONTROL(fikomero.has_value()); FIKO_KONTROL(fikomero->tezgahKlasoruAktif == 1); FIKO_KONTROL(fikomero->tezgahKlasoru.has_value() && *fikomero->tezgahKlasoru == "D:\\"); FIKO_KONTROL(!fikomero->ftpSunucuAdresi.has_value()); FIKO_KONTROL(fikomero->siraNo.has_value() && *fikomero->siraNo == -5); FIKO_KONTROL(!tz.item("Boyle Tezgah Yok").has_value()); } FIKO_TEST(tezgah_davranislari) { const Tezgahlar tz = Tezgahlar::veriden(ORNEK_TEZGAHLAR, sizeof(ORNEK_TEZGAHLAR)); const Tezgah fikomero = *tz.item("Fikomero 1"); const Tezgah ftc = *tz.item("Fitec Tool Center"); const auto plan1 = fikomero.gonderimPlani(); FIKO_KONTROL(plan1.size() == 1 && plan1[0] == GonderimYolu::KlasoreKopyala); const auto plan2 = ftc.gonderimPlani(); FIKO_KONTROL(plan2.size() == 1 && plan2[0] == GonderimYolu::FtpYukle); Tezgah pasif; // hicbir yontem aktif degil FIKO_KONTROL(pasif.acilisKontrol(true, true) == TezgahKlasorDurumu::aktifYontemYok); FIKO_KONTROL(fikomero.acilisKontrol(false, true) == TezgahKlasorDurumu::klasorYok); Tezgah programli; programli.tezgahProgramiAktif = 1; FIKO_KONTROL(programli.acilisKontrol(true, false) == TezgahKlasorDurumu::tezgahProgramiYok); FIKO_KONTROL(programli.acilisKontrol(true, true) == TezgahKlasorDurumu::tamam); Tezgah degisen = fikomero; FIKO_KONTROL(!degisen.guncellenmis(fikomero)); degisen.postUzantisi = "NC2"; FIKO_KONTROL(degisen.guncellenmis(fikomero)); } FIKO_TEST(ncdb_geriye_uyumlu_okuma) { const fikodb::VeriTabani vt = fikodb::coz(ORNEK_NCDB, sizeof(ORNEK_NCDB)); const fikodb::Tablo* t = vt.tablo("POSTLAR"); FIKO_KONTROL(t != nullptr); FIKO_KONTROL(t->satirlar.size() == 2); const fikodb::Satir& s1 = t->satirlar[0]; FIKO_KONTROL(t->deger(s1, "_id")->tamDeger() == 1); // rowid takma adi dolduruldu FIKO_KONTROL(t->deger(s1, "ISMI")->metinDeger() == "ADE_1"); FIKO_KONTROL(t->deger(s1, "ACIKLAMA")->metinDeger() == "Kaba isleme"); const fikodb::Deger* kod1 = t->deger(s1, "KOD"); const char* beklenenKod = "%\r\nN1 G90 G17\r\n%\r\n"; FIKO_KONTROL(kod1->tip == fikodb::Deger::Tip::Ikili && kod1->ikili.size() == 18); FIKO_KONTROL(std::memcmp(kod1->ikili.data(), beklenenKod, 18) == 0); FIKO_KONTROL(t->deger(s1, "EK_BILGILER")->bosMu()); FIKO_KONTROL(t->deger(s1, "saat")->metinDeger() == "2016-02-22 10:30:00.500000"); // 2. satirin 768B blob'u 512B sayfalarda tasma zinciri kullanir const fikodb::Satir& s2 = t->satirlar[1]; FIKO_KONTROL(t->deger(s2, "_id")->tamDeger() == 2); const fikodb::Deger* kod2 = t->deger(s2, "KOD"); FIKO_KONTROL(kod2->tip == fikodb::Deger::Tip::Ikili && kod2->ikili.size() == 768); bool blobDogru = true; for (std::size_t i = 0; i < 768; ++i) if (kod2->ikili[i] != static_cast(i % 256)) { blobDogru = false; break; } FIKO_KONTROL(blobDogru); FIKO_KONTROL(t->deger(s2, "EK_BILGILER")->metinDeger() == "{kureMerkezi:True}"); FIKO_KONTROL(t->deger(s2, "saat")->metinDeger() == "2016-02-22 11:00:00"); const fikodb::Tablo* sira = vt.tablo("sqlite_sequence"); FIKO_KONTROL(sira != nullptr && sira->satirlar.size() == 1); FIKO_KONTROL(sira->deger(sira->satirlar[0], "seq")->tamDeger() == 2); } FIKO_TEST(ncdb_yazma_ve_geri_okuma) { std::tm t{}; t.tm_year = 126; t.tm_mon = 6; t.tm_mday = 13; t.tm_hour = 4; t.tm_min = 5; t.tm_sec = 6; FIKO_KONTROL(FikoDBNC::dosyaIsmi("Kalip.CATProcess", t) == "Kalip[13.07.2026-04.05.06].fikoPostVT"); FIKO_KONTROL(zamanMetni(t, 0) == "2026-07-13 04:05:06"); FIKO_KONTROL(zamanMetni(t, 500000) == "2026-07-13 04:05:06.500000"); const auto klasor = testKlasoru("ncdb"); FikoDBNC db(klasor.string(), "Kalip.CATProcess"); db.veriTabaniYarat(); FIKO_KONTROL(db.dosyaYolu().find("Kalip[") != std::string::npos); FIKO_KONTROL(db.dosyaYolu().find(".fikoPostVT") != std::string::npos); db.veriEkle(std::string("P1"), std::string("kaba"), {1, 2, 3}, std::string("{kureMerkezi:True}")); std::vector buyukKod(10000); for (std::size_t i = 0; i < buyukKod.size(); ++i) buyukKod[i] = static_cast((i * 7) % 251); db.veriEkle(std::string("P2"), std::nullopt, buyukKod, std::nullopt); // programEkle: apt dosyasini okur, kureMerkezi=1 ek bilgisini yazar const auto aptYolu = klasor / "P3.aptsource"; { std::ofstream f(aptYolu, std::ios::binary); f << "GOTO/0,0,0"; } Tezgah tezgah; tezgah.kureMerkezi = 1; const NcProgram prg{"P3", "finis", aptYolu.string()}; FIKO_KONTROL(db.programEkle(prg, tezgah)); const fikodb::VeriTabani vt = fikodb::dosyadanCoz(db.dosyaYolu()); const fikodb::Tablo* p = vt.tablo("POSTLAR"); FIKO_KONTROL(p != nullptr && p->satirlar.size() == 3); FIKO_KONTROL(p->deger(p->satirlar[0], "_id")->tamDeger() == 1); FIKO_KONTROL(p->deger(p->satirlar[0], "EK_BILGILER")->metinDeger() == "{kureMerkezi:True}"); const fikodb::Deger* kod = p->deger(p->satirlar[1], "KOD"); FIKO_KONTROL(kod->tip == fikodb::Deger::Tip::Ikili && kod->ikili == buyukKod); // tasma zinciri FIKO_KONTROL(p->deger(p->satirlar[1], "EK_BILGILER")->bosMu()); FIKO_KONTROL(p->deger(p->satirlar[2], "ISMI")->metinDeger() == "P3"); FIKO_KONTROL(p->deger(p->satirlar[2], "KOD")->ikili.size() == 10); FIKO_KONTROL(!p->deger(p->satirlar[2], "saat")->metinDeger().empty()); const fikodb::Tablo* sira = vt.tablo("sqlite_sequence"); FIKO_KONTROL(sira != nullptr && sira->satirlar.size() == 1); FIKO_KONTROL(sira->deger(sira->satirlar[0], "seq")->tamDeger() == 3); const auto temizlik = FikoDBNC::programSonrasiTemizlik(); FIKO_KONTROL(temizlik.size() == 4 && temizlik[0] == "FikoApt" && temizlik[3] == "LOG"); } FIKO_TEST(komut_uretimi_python_birebir) { const Tezgahlar tz = Tezgahlar::veriden(ORNEK_TEZGAHLAR, sizeof(ORNEK_TEZGAHLAR)); FikoPost post(testKlasoru("komut").string(), "Kalip", tz); post.aptler = {"D:\\Isler\\ADE_1.aptsource"}; PostAyarlari a; a.scriptYolu = "C:\\Fikatia"; a.ncKuralDosyasiKlasoru = "Prg\\Post Yardimcilari\\Post Kurallari"; a.ncCeviriciProgram = "Prg\\Post Yardimcilari\\FikoPost\\FikoPostBatch.bat"; a.ncCeviriciParametreler = "/b"; a.aptUzantisi = "aptsource"; const Tezgah ftc = *tz.item("Fitec Tool Center"); auto komutlar = post.ncDonusumKomutlari(a, ftc); FIKO_KONTROL(komutlar.size() == 1); FIKO_KONTROL(komutlar[0].komut == "C:\\Fikatia\\Prg\\Post Yardimcilari\\FikoPost\\FikoPostBatch.bat " "\"C:\\Fikatia\\Prg\\Post Yardimcilari\\Post Kurallari\\Fidia.Fikural\" " "\"D:\\Isler\\ADE_1.aptsource\" \"D:\\Isler\\ADE_1.H\" /b"); FIKO_KONTROL(komutlar[0].ncDosyasi == "\"D:\\Isler\\ADE_1.H\""); // sabit cikti klasoru modu (ayar string ise) PostAyarlari a2 = a; a2.ncCiktiKlasoruVarsayilan = false; a2.ncCiktiKlasoru = "E:\\NC"; komutlar = post.ncDonusumKomutlari(a2, ftc); FIKO_KONTROL(komutlar[0].ncDosyasi == "\"E:\\NC\\Kalip.H\""); // replace tum gecisleri siler (Python str.replace birebir) const Tezgah fitec = *tz.item("Fitec"); // postUzantisi NC post.aptler = {"D:\\Isler\\a.aptsource.b.aptsource"}; komutlar = post.ncDonusumKomutlari(a, fitec); FIKO_KONTROL(komutlar[0].ncDosyasi == "\"D:\\Isler\\a.b.NC\""); const auto duzenleme = FikoPost::postDuzenlemeKomutu(a, ftc, "\"D:\\Isler\\ADE_1.H\""); FIKO_KONTROL(duzenleme.has_value()); FIKO_KONTROL(*duzenleme == "python \"C:\\Fikatia\\Prg\\PyScript\\FidiaTemizle.py\" \"D:\\Isler\\ADE_1.H\""); FIKO_KONTROL(!FikoPost::postDuzenlemeKomutu(a, fitec, "x").has_value()); const auto temizlik = FikoPost::donusumSonrasiTemizlik(); FIKO_KONTROL(temizlik.size() == 3 && temizlik[0] == "log" && temizlik[2] == "LOG"); } FIKO_TEST(tezgah_secim_kaliciligi) { const Tezgahlar tz = Tezgahlar::veriden(ORNEK_TEZGAHLAR, sizeof(ORNEK_TEZGAHLAR)); const auto klasor = testKlasoru("secim"); FikoPost post(klasor.string(), "Kalip", tz); const auto ilk = post.tezgah(); // dosya yok: yaratir + ilk tezgahi secer FIKO_KONTROL(ilk.has_value() && ilk->ismi == "Fikomero 1"); FIKO_KONTROL(std::filesystem::exists(klasor / "Fikomantasyon" / "Fikomantasyon.fikodb")); post.tezgahSec("Fitec"); const auto secili = post.tezgah(); FIKO_KONTROL(secili.has_value() && secili->ismi == "Fitec"); FikoPost post2(klasor.string(), "Kalip", tz); // yeni oturum ayni secimi okur const auto kalici = post2.tezgah(); FIKO_KONTROL(kalici.has_value() && kalici->ismi == "Fitec"); const fikodb::VeriTabani vt = fikodb::dosyadanCoz((klasor / "Fikomantasyon" / "Fikomantasyon.fikodb").string()); const fikodb::Tablo* h = vt.tablo("hareketler"); FIKO_KONTROL(h != nullptr && h->satirlar.size() == 2); FIKO_KONTROL(h->deger(h->satirlar[1], "veri")->metinDeger() == "Fitec"); FIKO_KONTROL(h->deger(h->satirlar[1], "olay")->metinDeger() == "tezgahSecildi"); } FIKO_TEST(kenar_durumlar) { // ntpath.join birebir FIKO_KONTROL(yolBirlestir("C:\\a", "D:\\b") == "D:\\b"); FIKO_KONTROL(yolBirlestir("C:\\a\\", "b") == "C:\\a\\b"); FIKO_KONTROL(yolBirlestir("C:", "b") == "C:b"); FIKO_KONTROL(yolBirlestir("C:\\a", "\\b") == "C:\\b"); FIKO_KONTROL(yolBirlestir("", "b") == "b"); FIKO_KONTROL(tumunuDegistir("a.x.b.x", ".x", "") == "a.b"); // bozuk imza -> hata bool yakalandi = false; try { const std::uint8_t bozuk[128] = {1, 2, 3}; (void)fikodb::coz(bozuk, sizeof(bozuk)); } catch (const std::exception&) { yakalandi = true; } FIKO_KONTROL(yakalandi); // cok sayfali yazma/okuma (ic b-agac sayfasi olusur) fikodb::VeriTabani vt; vt.tabloEkle("t", "CREATE TABLE t(_id INTEGER PRIMARY KEY AUTOINCREMENT, veri TEXT)"); for (int i = 0; i < 300; ++i) { std::string veri = "kayit-" + std::to_string(i) + "-"; veri.append(48, 'x'); vt.ekle(*vt.tablo("t"), {fikodb::Deger::bos(), fikodb::Deger::metinYap(veri)}); } const std::vector bayt = fikodb::yaz(vt); const fikodb::VeriTabani geri = fikodb::coz(bayt.data(), bayt.size()); const fikodb::Tablo* t2 = geri.tablo("t"); FIKO_KONTROL(t2 != nullptr && t2->satirlar.size() == 300); FIKO_KONTROL(t2->deger(t2->satirlar[0], "veri")->metinDeger().rfind("kayit-0-", 0) == 0); FIKO_KONTROL(t2->deger(t2->satirlar[299], "_id")->tamDeger() == 300); // 2 koordinatli GOTO yalniz X/Y yazar NcUretici uretici; const std::string nc = uretici.uret(aptAyristir("GOTO/1,2\n")); FIKO_KONTROL(nc.find("G01 X1.000 Y2.000") != std::string::npos); FIKO_KONTROL(nc.find('Z') == std::string::npos); }