After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794349 - GstSharp.Tests: Add unit test project
GstSharp.Tests: Add unit test project
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-sharp
git master
Other All
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-03-15 10:34 UTC by Justin Kim
Modified: 2018-03-21 12:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GstSharp.Tests: Add (18.75 KB, patch)
2018-03-15 10:34 UTC, Justin Kim
none Details | Review
GstSharp.Tests: Add (18.75 KB, patch)
2018-03-15 10:39 UTC, Justin Kim
none Details | Review
tests: Use meson as a build system for the tests (16.27 KB, patch)
2018-03-15 14:05 UTC, Thibault Saunier
none Details | Review
Add unit test (13.31 KB, patch)
2018-03-21 07:56 UTC, Justin Kim
none Details | Review
Add unit test (13.74 KB, patch)
2018-03-21 11:37 UTC, Justin Kim
committed Details | Review

Description Justin Kim 2018-03-15 10:34:35 UTC
Created attachment 369721 [details] [review]
GstSharp.Tests: Add

I propose this patch to get solution how to build on Windows or meson.
I, actually, failed to find a proper way this project because of dependencies.

To run this unit tests, the following steps are required.

1. update TargetFrameworkVersion to v4.6.1 (or, greater than 2.0)
2. correct the paths of gio-sharp.dll, and glib-sharp.dll
Comment 1 Justin Kim 2018-03-15 10:39:06 UTC
Created attachment 369722 [details] [review]
GstSharp.Tests: Add
Comment 2 Thibault Saunier 2018-03-15 14:05:12 UTC
Created attachment 369736 [details] [review]
tests: Use meson as a build system for the tests
Comment 3 Thibault Saunier 2018-03-15 14:07:53 UTC
OK, moved to meson but then I am getting the following errors:

1) GstSharp.Tests.PipelineTests.TestPipelineDispose :   Expected: False
  But was:  True

at GstSharp.Tests.PipelineTests.TestPipelineDispose () [0x000f3] in /home/thiblahute/devel/gstreamer/gst-build/subprojects/gstreamer-sharp/Tests/PipelineTests.cs:69
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /home/thiblahute/devel/misc/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305

2) GstSharp.Tests.PipelineTests.TestPipelineDisposeManually : Multiple failures or warnings in test:
  1)   Expected: False
  But was:  True

  2)   Expected: False
  But was:  True


at GstSharp.Tests.PipelineTests.TestPipelineDisposeManually () [0x00125] in /home/thiblahute/devel/gstreamer/gst-build/subprojects/gstreamer-sharp/Tests/PipelineTests.cs:208
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /home/thiblahute/devel/misc/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305

3) GstSharp.Tests.PipelineTests.TestPipelineParseAndDispose : Multiple failures or warnings in test:
  1)   Expected: False
  But was:  True

  2)   Expected: False
  But was:  True

  3)   Expected: False
  But was:  True


at GstSharp.Tests.PipelineTests.TestPipelineParseAndDispose () [0x000a0] in /home/thiblahute/devel/gstreamer/gst-build/subprojects/gstreamer-sharp/Tests/PipelineTests.cs:106
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /home/thiblahute/devel/misc/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305

4) GstSharp.Tests.PipelineTests.TestPipelineUriDecodeBinForcedlyDespose : Multiple failures or warnings in test:
  1)   Expected: False
  But was:  True

  2)   Expected: False
  But was:  True

  3)   Expected: False
  But was:  True

  4)   Expected: False
  But was:  True


at GstSharp.Tests.PipelineTests.TestPipelineUriDecodeBinForcedlyDespose () [0x000f3] in /home/thiblahute/devel/gstreamer/gst-build/subprojects/gstreamer-sharp/Tests/PipelineTests.cs:152
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /home/thiblahute/devel/misc/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305


-------


OK:         2
FAIL:       1
SKIP:       0
TIMEOUT:    0

Is that normal?
Comment 4 Justin Kim 2018-03-16 02:27:35 UTC
> Is that normal?

Sorry for submitting a mixed issue in this patch, but yes.
I think the assertions in this patch is right, but it fails because some leakages were detected by weak references. 

I filed a leakage issue[0] but I seem not to get a right answer myself yet.
I hope this patch is helpful to clarify leakage issue.

[0] https://bugzilla.gnome.org/show_bug.cgi?id=794316
Comment 5 Justin Kim 2018-03-19 01:22:00 UTC
@Thibault, I think merging unit test is more important than fixing leakage issue currently. Can I make a squashed commit which has only passed tests?
Comment 6 Thibault Saunier 2018-03-19 01:55:30 UTC
(In reply to Justin J. Kim from comment #5)
> @Thibault, I think merging unit test is more important than fixing leakage
> issue currently. Can I make a squashed commit which has only passed tests?

Ok
Comment 7 Justin Kim 2018-03-19 14:05:50 UTC
The existing test is failed by exception throwing so I can't make further progress on this work. 

Thibault, Could you check this log?

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Gst.App.AppSink' threw an exception. ---> System.EntryPointNotFoundException: gst_aggregator_get_type
  at (wrapper managed-to-native) Gst.Base.Aggregator:gst_aggregator_get_type ()
  at Gst.Base.Aggregator.get_GType () [0x00000] in /home/joykim/git/gst-build/subprojects/gstreamer-sharp/sources/generated/Gst.Bas
e/Aggregator.cs:1222
  at GtkSharp.GstreamerSharp.ObjectManager.Initialize () [0x00115] in /home/joykim/git/gst-build/subprojects/gstreamer-sharp/sources/generated/GtkSharp/ObjectManager.cs:29
  at Gst.App.AppSink..cctor () [0x00000] in /home/joykim/git/gst-build/subprojects/gstreamer-sharp/sources/generated/Gst.App/AppSink.cs:665
   --- End of inner exception stack trace ---
  at AbiTester.___Gst.Main (System.String[] args) [0x030e3] in /home/joykim/git/gst-build/subprojects/gstreamer-sharp/sources/generated/gstreamer-sharp-abi.cs:341


Full Log:
https://gist.github.com/justinjoy/1b34a5d6708b83d14c98afeda6c16277
Comment 8 Thibault Saunier 2018-03-19 14:15:07 UTC
You got to update GStreamer.
Comment 9 Justin Kim 2018-03-19 14:25:58 UTC
(In reply to Thibault Saunier from comment #8)
> You got to update GStreamer.

Hmm, sorry, but I am using the latest versions. Here are my testing commit hashes.


gst-editing-services/
4cff10fb (HEAD -> master, origin/master, origin/HEAD) doc: Remove documentation about GESVideoSource::zorder as it doesn't exist

gst-libav/
5328250 (HEAD -> master, tag: 1.13.91, origin/master, origin/HEAD) Release 1.13.91

gst-plugins-bad/
1da3cd56a (HEAD -> master, origin/master, origin/HEAD) wasapi: try to satisfy both mingw and msvc

gst-plugins-base/
17d5f0831 (HEAD -> master, origin/master, origin/HEAD) oggstream: protect against out-of-bounds read

gst-plugins-good/
42f5f3d1b (HEAD -> master, origin/master, origin/HEAD) splitmuxsink: Allow splitting at exactly the time/bytes threshold

gst-plugins-ugly/
f16550f6 (HEAD -> master, tag: 1.13.91, origin/master, origin/HEAD) Release 1.13.91

gstreamer/
bc431c2af (HEAD -> master, tag: 1.13.91, origin/master, origin/HEAD) Release 1.13.91

gstreamer-sharp/
3c39246 (HEAD -> bgo/794349, master) tests: Use meson as a build system for the tests
Comment 10 Thibault Saunier 2018-03-19 14:41:13 UTC
maybe you have been in your uninstalled env for a long time and the $LD_LIBRARY_PATH hasen'nt been updated, in any case, this is related to you dev env as it is not able to find `gst_aggregator_get_type`: `System.TypeInitializationException: The type initializer for 'Gst.App.AppSink' threw an exception. ---> System.EntryPointNotFoundException: gst_aggregator_get_type` which should be in `libgstbase-1.0`
Comment 11 Thibault Saunier 2018-03-19 14:41:45 UTC
You could use `strace` to figure out what 'libgstbase-1.0.so` is being used.
Comment 12 Justin Kim 2018-03-21 07:56:26 UTC
Created attachment 369943 [details] [review]
Add unit test

Squashed and simplified.
Comment 13 Justin Kim 2018-03-21 08:00:35 UTC
(In reply to Thibault Saunier from comment #11)
> You could use `strace` to figure out what 'libgstbase-1.0.so` is being used.

thank you. mono seems not to recognise LD_LIBRARY_PATH variable so it tries to load 'libgstbase-1.0.so' from /usr/lib first even under gst-build environment.
Comment 14 Justin Kim 2018-03-21 11:37:12 UTC
Created attachment 369952 [details] [review]
Add unit test

mono seems to hold a reference in the same stack frame, and this aspect is very different from VS.Net's.
Comment 15 Thibault Saunier 2018-03-21 12:53:06 UTC
I pushed another version of it with a test for https://bugzilla.gnome.org/show_bug.cgi?id=794483