<commit_before>//
//  DataStoreTests.swift
//  SOGraphDB
//
//  Created by <NAME> on 08.07.14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import XCTest
import SOGraphDB

class DataStoreTests: XCTestCase {

    /**
    - (NSURL *)testFile;
    {
    return
    }
*/
    class Test : Init {
        
        let a : Int
        
        init() {
            a = 0
        }
    }
    
    
    func testFile() -> NSURL {
        let url = SOTools.tempDirectory()
        return url.URLByAppendingPathComponent("data.db")
    }
    
    func test0Delete() {
        var url = testFile()
        
        url.deleteFile()
        
        XCTAssertFalse(url.isFileExisting(), "File not deleted?");
    }
    
    func test1StoreFile() {
        var url = testFile()
        
        NSLog("URL: %@", url.path)
        
        var dataStore = DataStore<ObjectStoreHeader,Test>(url: url)
        
        XCTAssertNotNil(dataStore.fileHandle,"file is not created")
        XCTAssertNil(dataStore.error, "error happend?");
        
        url.deleteFile()
        
        XCTAssertFalse(url.isFileExisting(),"File not deleted?");
    }

    func test3WriteData1() {
        
        var url = testFile()
        url.deleteFile()
        
        var dataStore = DataStore<ObjectStoreHeader,Test>(url: url)
        
        XCTAssertNotNil(dataStore.fileHandle,"file is not created");
        XCTAssertNil(dataStore.error, "error happend?");
        
        var dataValue = Test()
        
        var uid = dataStore.createBlock(dataValue)
        
        XCTAssertEqual(uid, 1, "")
    }
    
    
}



/**
func testExample() {
// This is an example of a functional test case.
XCTAssert(true, "Pass")
}

func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
// Put the code you want to measure the time of here.
}
}
*/<commit_msg>fix problem with not public ObjectStoreHeader struct<commit_after>//
//  DataStoreTests.swift
//  SOGraphDB
//
//  Created by <NAME> on 08.07.14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import XCTest
import SOGraphDB

struct TestHeader : DataStoreHeader  {
    
    var used: Bool = true;
    
}

class DataStoreTests: XCTestCase {

    /**
    - (NSURL *)testFile;
    {
    return
    }
*/
    
    class Test : Init {
        
        let a : Int
        
        init() {
            a = 0
        }
    }
    
    
    func testFile() -> NSURL {
        let url = SOTools.tempDirectory()
        return url.URLByAppendingPathComponent("data.db")
    }
    
    func test0Delete() {
        var url = testFile()
        
        url.deleteFile()
        
        XCTAssertFalse(url.isFileExisting(), "File not deleted?");
    }
    
    func test1StoreFile() {
        var url = testFile()
        
        NSLog("URL: %@", url.path)
        
        var dataStore = DataStore<TestHeader,Test>(url: url)
        
        //XCTAssertNotNil(dataStore.fileHandle,"file is not created")
        XCTAssertNil(dataStore.error, "error happend?");
        
        url.deleteFile()
        
        XCTAssertFalse(url.isFileExisting(),"File not deleted?");
    }

    func test3WriteData1() {
        
        var url = testFile()
        url.deleteFile()
        
        var dataStore = DataStore<TestHeader,Test>(url: url)
        
        //XCTAssertNotNil(dataStore.fileHandle,"file is not created");
        XCTAssertNil(dataStore.error, "error happend?");
        
        var dataValue = Test()
        
        var uid = dataStore.createBlock(dataValue)
        
        XCTAssertEqual(uid, 1, "")
    }
    
    
}



/**
func testExample() {
// This is an example of a functional test case.
XCTAssert(true, "Pass")
}

func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
// Put the code you want to measure the time of here.
}
}
*/
{'fraction_non_alphanumeric': 0.11342057993328201, 'fraction_numerical': 0.008211444701052091, 'mean_word_length': 1.8307915758896152, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1277989', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1194, 'n_words': 283}