(t *testing.T)
| 1863 | } |
| 1864 | |
| 1865 | func TestStoreReadOnlyOption(t *testing.T) { |
| 1866 | tmpDir, _ := ioutil.TempDir("", "mossStore") |
| 1867 | defer os.RemoveAll(tmpDir) |
| 1868 | |
| 1869 | // Open store, coll in Regular mode, and write 10 items |
| 1870 | store, coll := openStoreAndWriteNItems(t, tmpDir, 10, 1, false) |
| 1871 | |
| 1872 | if fetchOpsSetFromFooter(store) != 10 { |
| 1873 | t.Errorf("Unexpected number of sets!") |
| 1874 | } |
| 1875 | |
| 1876 | coll.Close() |
| 1877 | store.Close() |
| 1878 | |
| 1879 | // Reopen store, coll in ReadOnly mode, and write 10 more items |
| 1880 | store, coll = openStoreAndWriteNItems(t, tmpDir, 10, 1, true) |
| 1881 | |
| 1882 | // Expect no additional sets since the first batch |
| 1883 | if fetchOpsSetFromFooter(store) != 10 { |
| 1884 | t.Errorf("Extra number of sets detected!") |
| 1885 | } |
| 1886 | |
| 1887 | coll.Close() |
| 1888 | store.Close() |
| 1889 | |
| 1890 | // Reopen store, coll in regular mode, and write 10 more items |
| 1891 | store, coll = openStoreAndWriteNItems(t, tmpDir, 10, 1, false) |
| 1892 | |
| 1893 | // Expect 10 more sets since the first batch |
| 1894 | if fetchOpsSetFromFooter(store) != 20 { |
| 1895 | t.Errorf("Unexpected number of sets!") |
| 1896 | } |
| 1897 | |
| 1898 | coll.Close() |
| 1899 | store.Close() |
| 1900 | } |
| 1901 | |
| 1902 | func TestStoreCollHistograms(t *testing.T) { |
| 1903 | tmpDir, _ := ioutil.TempDir("", "mossStore") |
nothing calls this directly
no test coverage detected
searching dependent graphs…