Fortran · 1268 bytes Raw Blame History
1 program test_event_model
2 use fgof_watch_types, only : &
3 FGOF_WATCH_EVT_CREATED, &
4 FGOF_WATCH_EVT_MODIFIED, &
5 FGOF_WATCH_EVT_MOVED, &
6 FGOF_WATCH_EVT_NONE, &
7 FGOF_WATCH_EVT_REMOVED, &
8 watch_event
9 implicit none
10
11 type(watch_event) :: event
12
13 if (FGOF_WATCH_EVT_NONE /= 0) error stop "none event constant should be zero"
14 if (FGOF_WATCH_EVT_CREATED <= FGOF_WATCH_EVT_NONE) error stop "created event should be positive"
15 if (FGOF_WATCH_EVT_MODIFIED <= FGOF_WATCH_EVT_CREATED) error stop "modified event ordering should be stable"
16 if (FGOF_WATCH_EVT_REMOVED <= FGOF_WATCH_EVT_MODIFIED) error stop "removed event ordering should be stable"
17 if (FGOF_WATCH_EVT_MOVED <= FGOF_WATCH_EVT_REMOVED) error stop "moved event ordering should be stable"
18
19 event%kind = FGOF_WATCH_EVT_MOVED
20 event%is_directory = .true.
21 event%path = "new-path"
22 event%previous_path = "old-path"
23
24 if (event%kind /= FGOF_WATCH_EVT_MOVED) error stop "event kind should store move values"
25 if (.not. event%is_directory) error stop "event directory flag should be stored"
26 if (event%path /= "new-path") error stop "event path should be stored"
27 if (event%previous_path /= "old-path") error stop "event previous path should be stored"
28 end program test_event_model
29