DefaultLogger::get()->debug("Found UTF-16 BOM ...");
std::vector<unsigned char> output;
- int16_t *ptr = (int16_t*) &data[ 0 ];
utf8::utf16to8(data.begin(), data.end(), back_inserter(output));
return;
}
* a compiler complain is the result.
* @param dest Destination value to be written
* @param db File database, including input stream. */
- template <typename T> inline void Convert (T& dest,
- const FileDatabase& db) const;
-
-
+ template <typename T> inline void Convert (T& dest, const FileDatabase& db) const;
// --------------------------------------------------------
// generic converter
}
// ------------------------------------------------------------------------------------------------
-uint64_t ReadDoubleWord(const char* input, const char*& cursor, const char* end)
-{
+uint64_t ReadDoubleWord(const char* input, const char*& cursor, const char* end) {
const size_t k_to_read = sizeof(uint64_t);
if(Offset(cursor, end) < k_to_read) {
TokenizeError("cannot ReadDoubleWord, out of bounds",input, cursor);
return dword;
}
-
// ------------------------------------------------------------------------------------------------
uint8_t ReadByte(const char* input, const char*& cursor, const char* end)
{
const uint32_t flags = ReadWord(input, cursor, input + length);
const uint8_t padding_0 = ReadByte(input, cursor, input + length); // unused
+ (void) padding_0;
const uint8_t padding_1 = ReadByte(input, cursor, input + length); // unused
-
+ (void) padding_1;
while (cursor < input + length)
{
if(!ReadScope(output_tokens, input, cursor, input + length, flags)) {
// Get the file-size
size_t fileSize = fileStream->FileSize();
+ if ( 0 == fileSize ) {
+ throw DeadlyImportError("File " + pFile + " is empty.");
+ }
IOStreamBuffer<char> streamedBuffer(1024 * 1024);
streamedBuffer.open(fileStream.get());
ai_assert(NULL != out);
//calc element size
- unsigned int lsize = 0;
- switch (eType)
- {
- case EDT_Char:
- case EDT_UChar:
- lsize = 1;
- break;
-
- case EDT_UShort:
- case EDT_Short:
- lsize = 2;
- break;
-
- case EDT_UInt:
- case EDT_Int:
- case EDT_Float:
- lsize = 4;
- break;
-
- case EDT_Double:
- lsize = 8;
- break;
- }
-
bool ret = true;
switch (eType)
{
out->fDouble = (double)d;
break;
+ case EDT_INVALID:
default:
ret = false;
break;
case EDT_Double:
lsize = 8;
break;
+
+ case EDT_INVALID:
+ default:
+ break;
}
//read the next file block if needed
} catch ( ... ) {
ok = false;
}
+ EXPECT_TRUE( ok );
}
TEST_F( BatchLoaderTest, validateAccessTest ) {
public:
virtual bool importerTest() {
Assimp::Importer importer;
- const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/glFT/TwoBoxes/TwoBoxes.gltf", 0 );
- //return nullptr != scene;
-
- return true;
+ const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/glTF/TwoBoxes/TwoBoxes.gltf", 0 );
+ return nullptr != scene;
}
};