summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2017-06-20 14:30:48 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2017-07-13 18:34:55 -0300
commitb75d14e668b48970e6e51a9abca3a604310924ad (patch)
tree31e838ea6539e7537f6e0acde41cc2eb2be258ec
parent806b60056c3e3a2bf153999cad9fc6e0f102417f (diff)
eina_mono: Manually disposes Inarray at each test and check for size in ReplaceAt test
-rw-r--r--src/tests/efl_mono/Eina.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs
index a2d76810ad..e42494186c 100644
--- a/src/tests/efl_mono/Eina.cs
+++ b/src/tests/efl_mono/Eina.cs
@@ -1248,6 +1248,7 @@ class TestEinaInarray
1248 { 1248 {
1249 var a = new eina.Inarray<int>(); 1249 var a = new eina.Inarray<int>();
1250 Test.Assert(a.Handle != IntPtr.Zero); 1250 Test.Assert(a.Handle != IntPtr.Zero);
1251 a.Dispose();
1251 } 1252 }
1252 1253
1253 public static void push_int() 1254 public static void push_int()
@@ -1256,6 +1257,7 @@ class TestEinaInarray
1256 Test.Assert(a.Handle != IntPtr.Zero); 1257 Test.Assert(a.Handle != IntPtr.Zero);
1257 Test.Assert(a.Push(88) == 0); 1258 Test.Assert(a.Push(88) == 0);
1258 Test.Assert(a[0] == 88); 1259 Test.Assert(a[0] == 88);
1260 a.Dispose();
1259 } 1261 }
1260 1262
1261 public static void push_string() 1263 public static void push_string()
@@ -1264,6 +1266,7 @@ class TestEinaInarray
1264 Test.Assert(a.Handle != IntPtr.Zero); 1266 Test.Assert(a.Handle != IntPtr.Zero);
1265 Test.Assert(a.Push("test string") == 0); 1267 Test.Assert(a.Push("test string") == 0);
1266 Test.Assert(a[0] == "test string"); 1268 Test.Assert(a[0] == "test string");
1269 a.Dispose();
1267 } 1270 }
1268 1271
1269 public static void push_obj() 1272 public static void push_obj()
@@ -1275,6 +1278,7 @@ class TestEinaInarray
1275 Test.Assert(a.Push(o) == 0); 1278 Test.Assert(a.Push(o) == 0);
1276 Test.Assert(a[0].raw_handle == o.raw_handle); 1279 Test.Assert(a[0].raw_handle == o.raw_handle);
1277 Test.Assert(a[0].number_get() == 88); 1280 Test.Assert(a[0].number_get() == 88);
1281 a.Dispose();
1278 } 1282 }
1279 1283
1280 public static void pop_int() 1284 public static void pop_int()
@@ -1284,6 +1288,7 @@ class TestEinaInarray
1284 Test.Assert(a.Push(88) >= 0); 1288 Test.Assert(a.Push(88) >= 0);
1285 Test.Assert(a.Pop() == 88); 1289 Test.Assert(a.Pop() == 88);
1286 Test.Assert(a.Count() == 0); 1290 Test.Assert(a.Count() == 0);
1291 a.Dispose();
1287 } 1292 }
1288 1293
1289 public static void pop_string() 1294 public static void pop_string()
@@ -1293,6 +1298,7 @@ class TestEinaInarray
1293 Test.Assert(a.Push("test string") >= 0); 1298 Test.Assert(a.Push("test string") >= 0);
1294 Test.Assert(a.Pop() == "test string"); 1299 Test.Assert(a.Pop() == "test string");
1295 Test.Assert(a.Count() == 0); 1300 Test.Assert(a.Count() == 0);
1301 a.Dispose();
1296 } 1302 }
1297 1303
1298 public static void pop_obj() 1304 public static void pop_obj()
@@ -1306,6 +1312,7 @@ class TestEinaInarray
1306 Test.Assert(p.raw_handle == o.raw_handle); 1312 Test.Assert(p.raw_handle == o.raw_handle);
1307 Test.Assert(p.number_get() == 88); 1313 Test.Assert(p.number_get() == 88);
1308 Test.Assert(a.Count() == 0); 1314 Test.Assert(a.Count() == 0);
1315 a.Dispose();
1309 } 1316 }
1310 1317
1311 public static void replace_at_int() 1318 public static void replace_at_int()
@@ -1316,8 +1323,11 @@ class TestEinaInarray
1316 Test.Assert(a[0] == 88); 1323 Test.Assert(a[0] == 88);
1317 a.ReplaceAt(0, 44); 1324 a.ReplaceAt(0, 44);
1318 Test.Assert(a[0] == 44); 1325 Test.Assert(a[0] == 44);
1326 Test.Assert(a.Count() == 1);
1319 a[0] = 22; 1327 a[0] = 22;
1320 Test.Assert(a[0] == 22); 1328 Test.Assert(a[0] == 22);
1329 Test.Assert(a.Count() == 1);
1330 a.Dispose();
1321 } 1331 }
1322 1332
1323 public static void replace_at_string() 1333 public static void replace_at_string()
@@ -1328,8 +1338,11 @@ class TestEinaInarray
1328 Test.Assert(a[0] == "test string"); 1338 Test.Assert(a[0] == "test string");
1329 a.ReplaceAt(0, "other string"); 1339 a.ReplaceAt(0, "other string");
1330 Test.Assert(a[0] == "other string"); 1340 Test.Assert(a[0] == "other string");
1341 Test.Assert(a.Count() == 1);
1331 a[0] = "abc"; 1342 a[0] = "abc";
1332 Test.Assert(a[0] == "abc"); 1343 Test.Assert(a[0] == "abc");
1344 Test.Assert(a.Count() == 1);
1345 a.Dispose();
1333 } 1346 }
1334 1347
1335 public static void replace_at_obj() 1348 public static void replace_at_obj()
@@ -1350,6 +1363,7 @@ class TestEinaInarray
1350 a.ReplaceAt(0, o2); 1363 a.ReplaceAt(0, o2);
1351 Test.Assert(a[0].raw_handle == o2.raw_handle); 1364 Test.Assert(a[0].raw_handle == o2.raw_handle);
1352 Test.Assert(a[0].number_get() == 44); 1365 Test.Assert(a[0].number_get() == 44);
1366 Test.Assert(a.Count() == 1);
1353 1367
1354 var o3 = new test.NumberwrapperConcrete(); 1368 var o3 = new test.NumberwrapperConcrete();
1355 o3.number_set(22); 1369 o3.number_set(22);
@@ -1357,6 +1371,9 @@ class TestEinaInarray
1357 a[0] = o3; 1371 a[0] = o3;
1358 Test.Assert(a[0].raw_handle == o3.raw_handle); 1372 Test.Assert(a[0].raw_handle == o3.raw_handle);
1359 Test.Assert(a[0].number_get() == 22); 1373 Test.Assert(a[0].number_get() == 22);
1374 Test.Assert(a.Count() == 1);
1375
1376 a.Dispose();
1360 } 1377 }
1361 1378
1362 public static void count_int() 1379 public static void count_int()
@@ -1373,6 +1390,7 @@ class TestEinaInarray
1373 Test.Assert(a.Push(22) == 2); 1390 Test.Assert(a.Push(22) == 2);
1374 Test.Assert(a[2] == 22); 1391 Test.Assert(a[2] == 22);
1375 Test.Assert(a.Count() == 3); 1392 Test.Assert(a.Count() == 3);
1393 a.Dispose();
1376 } 1394 }
1377 1395
1378 public static void count_string() 1396 public static void count_string()
@@ -1389,6 +1407,7 @@ class TestEinaInarray
1389 Test.Assert(a.Push("c") == 2); 1407 Test.Assert(a.Push("c") == 2);
1390 Test.Assert(a[2] == "c"); 1408 Test.Assert(a[2] == "c");
1391 Test.Assert(a.Count() == 3); 1409 Test.Assert(a.Count() == 3);
1410 a.Dispose();
1392 } 1411 }
1393 1412
1394 public static void count_obj() 1413 public static void count_obj()
@@ -1418,6 +1437,8 @@ class TestEinaInarray
1418 Test.Assert(a[2].raw_handle == o3.raw_handle); 1437 Test.Assert(a[2].raw_handle == o3.raw_handle);
1419 Test.Assert(a[2].number_get() == 22); 1438 Test.Assert(a[2].number_get() == 22);
1420 Test.Assert(a.Count() == 3); 1439 Test.Assert(a.Count() == 3);
1440
1441 a.Dispose();
1421 } 1442 }
1422 1443
1423 public static void length_int() 1444 public static void length_int()
@@ -1434,6 +1455,7 @@ class TestEinaInarray
1434 Test.Assert(a.Push(22) >= 0); 1455 Test.Assert(a.Push(22) >= 0);
1435 Test.Assert(a[2] == 22); 1456 Test.Assert(a[2] == 22);
1436 Test.Assert(a.Length == 3); 1457 Test.Assert(a.Length == 3);
1458 a.Dispose();
1437 } 1459 }
1438 1460
1439 public static void length_string() 1461 public static void length_string()
@@ -1450,6 +1472,7 @@ class TestEinaInarray
1450 Test.Assert(a.Push("c") >= 0); 1472 Test.Assert(a.Push("c") >= 0);
1451 Test.Assert(a[2] == "c"); 1473 Test.Assert(a[2] == "c");
1452 Test.Assert(a.Length == 3); 1474 Test.Assert(a.Length == 3);
1475 a.Dispose();
1453 } 1476 }
1454 1477
1455 public static void eina_inarray_as_ienumerable_int() 1478 public static void eina_inarray_as_ienumerable_int()
@@ -1466,6 +1489,7 @@ class TestEinaInarray
1466 Test.AssertEquals(cmp, e); 1489 Test.AssertEquals(cmp, e);
1467 cmp /= 2; 1490 cmp /= 2;
1468 } 1491 }
1492 a.Dispose();
1469 } 1493 }
1470 1494
1471 public static void eina_inarray_as_ienumerable_string() 1495 public static void eina_inarray_as_ienumerable_string()
@@ -1482,6 +1506,7 @@ class TestEinaInarray
1482 Test.AssertEquals(cmp, e); 1506 Test.AssertEquals(cmp, e);
1483 cmp = cmp + "X"; 1507 cmp = cmp + "X";
1484 } 1508 }
1509 a.Dispose();
1485 } 1510 }
1486 1511
1487 public static void eina_inarray_as_ienumerable_obj() 1512 public static void eina_inarray_as_ienumerable_obj()
@@ -1507,6 +1532,7 @@ class TestEinaInarray
1507 Test.Assert(cmp[i].raw_handle == e.raw_handle); 1532 Test.Assert(cmp[i].raw_handle == e.raw_handle);
1508 ++i; 1533 ++i;
1509 } 1534 }
1535 arr.Dispose();
1510 } 1536 }
1511 1537
1512 // // 1538 // //
@@ -1752,6 +1778,7 @@ class TestEinaInarray
1752 Test.Assert(a[i].raw_handle == b[i].raw_handle); 1778 Test.Assert(a[i].raw_handle == b[i].raw_handle);
1753 Test.Assert(a[i].raw_handle == cmp[i].raw_handle); 1779 Test.Assert(a[i].raw_handle == cmp[i].raw_handle);
1754 } 1780 }
1781 a.Dispose();
1755 } 1782 }
1756} 1783}
1757 1784